Skip to content

Conversation

@willyogo
Copy link
Member

@willyogo willyogo commented Dec 11, 2025

Summary

  • align the gallery/image fidget to read the Link setting that users configure
  • trim the configured link before rendering so images become clickable again

Testing

  • yarn lint src/fidgets/ui/gallery.tsx (fails: project has no pages or app directory for next lint)
  • yarn check-types --noEmit (terminated manually due to long runtime)

Codex Task

Summary by CodeRabbit

  • Improvements
    • Updated Gallery widget's external link configuration system for enhanced consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nounspace-ts Ready Ready Preview Comment Dec 11, 2025 5:28pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Walkthrough

A property in GalleryFidgetSettings is renamed from RedirectionURL to Link, with corresponding updates to the rendering logic in the gallery component that computes and applies the redirectUrl from the new Link property.

Changes

Cohort / File(s) Summary
Gallery component property rename
src/fidgets/ui/gallery.tsx
Renamed RedirectionURL to Link in GalleryFidgetSettings; updated rendering logic to compute redirectUrl from trimmed Link property and use it for anchor href; adjusted conditional rendering to check for Link-derived URL presence

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Suggested labels

bug

Suggested reviewers

  • r4topunk
  • j-paterson

Poem

🐰 From RedirectionURL to Link so clear,
A simpler name now appears here,
Trimmed and ready to navigate,
The gallery shines, looking first-rate! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix gallery fidget link handling' accurately summarizes the main change: correcting how the gallery fidget processes link configuration settings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/fix-image-fidget-link-functionality

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/fidgets/ui/gallery.tsx (1)

344-397: Consider consistent error display between branches.

The error display differs between the linked and non-linked rendering:

  • Line 371 (linked): Uses inline <div style={errorStyle}>
  • Line 395 (non-linked): Uses <ErrorWrapper> component

This creates inconsistent UX. Additionally, when errors occur (indicating no valid image), wrapping the error message in a clickable link could be confusing.

Apply this diff to use consistent error handling:

       {settings.selectMediaSource?.name === MediaSourceTypes.WALLET ? (
         <div className="absolute bottom-2 right-2 flex h-fit w-fit">
           <TooltipProvider>
             <Tooltip>
               <TooltipTrigger>
                 <VerifiedNft color={badgeColor} />
               </TooltipTrigger>
               <TooltipContent side="left">Verified Owner</TooltipContent>
             </Tooltip>
           </TooltipProvider>
         </div>
       ) : null}
-      {error && <div style={errorStyle}>{error}</div>}
+      {error && <ErrorWrapper icon="⚠️" message={error} />}
     </div>
   </a>

Optional: Add URL validation

Consider validating that redirectUrl is a valid URL to prevent broken links or potential XSS with protocols like javascript:. This is a nice-to-have improvement.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e336694 and 2c1b487.

📒 Files selected for processing (1)
  • src/fidgets/ui/gallery.tsx (2 hunks)
🔇 Additional comments (3)
src/fidgets/ui/gallery.tsx (3)

176-189: LGTM!

The field configuration is clear and well-structured. The display name "Links To" and hint "URL to open when image is clicked" provide good UX guidance.


342-343: LGTM!

The trim() logic correctly handles whitespace and makes the link conditional on having a non-empty value. The optional chaining properly handles undefined/null cases.


33-33: No backward compatibility concerns - this is a new file.

This commit adds a new gallery.tsx file rather than modifying an existing one. The Link property is part of the fresh GalleryFidgetSettings type definition with no prior RedirectionURL property to migrate from. No breaking changes or data migration issues apply here.

@willyogo willyogo added bug Something isn't working LGFTP Looks Good From Testing Perspective and removed codex labels Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working LGFTP Looks Good From Testing Perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants