Skip to content

fix: remove token_uri image fallback in NFT pages#69

Merged
pthmas merged 1 commit intomainfrom
issue-67
Apr 22, 2026
Merged

fix: remove token_uri image fallback in NFT pages#69
pthmas merged 1 commit intomainfrom
issue-67

Conversation

@pthmas
Copy link
Copy Markdown
Collaborator

@pthmas pthmas commented Apr 22, 2026

Summary

Remove token_uri as image URL fallback in NFTTokenPage, NFTContractPage, and AddressPage. token_uri points to JSON metadata, not images — the fallback causes broken image icons. The backend already stores direct image URLs as image_url, so the fallback was never useful.

Closes #67

Summary by CodeRabbit

  • Refactor
    • Simplified NFT image display logic across card views. NFTs without primary images will now consistently show a placeholder instead of attempting alternative image sources.

@pthmas pthmas self-assigned this Apr 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 88157ed1-9acf-4859-9e09-90d8696e723b

📥 Commits

Reviewing files that changed from the base of the PR and between d493e20 and 8883e6c.

📒 Files selected for processing (3)
  • frontend/src/pages/AddressPage.tsx
  • frontend/src/pages/NFTContractPage.tsx
  • frontend/src/pages/NFTTokenPage.tsx

📝 Walkthrough

Walkthrough

Three NFT display pages were updated to remove the fallback from token.token_uri when deriving image URLs. Since token_uri points to JSON metadata, not images, the fallback caused broken image rendering. The fix ensures only image_url is used for displaying images.

Changes

Cohort / File(s) Summary
NFT Image URL Fallback Removal
frontend/src/pages/AddressPage.tsx, frontend/src/pages/NFTContractPage.tsx, frontend/src/pages/NFTTokenPage.tsx
Removed token.token_uri fallback from imageUrl derivation in all three pages. Now only image_url is used; when absent, components render the "No Image" placeholder instead of attempting to display JSON metadata as an image.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three pages, one fix, clean and bright,
Token URIs no longer show broken-image blight!
Metadata stays metadata, images stay true,
The frontend now renders what users should view.
JSON ain't a picture, we've set it right! 🖼️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the token_uri fallback in NFT pages across three files.
Linked Issues check ✅ Passed The PR fully implements the objective from issue #67: replacing token.image_url || token.token_uri || null with token.image_url || null in all three specified locations.
Out of Scope Changes check ✅ Passed All changes are strictly scoped to removing the token_uri fallback in the three identified files; no unrelated modifications present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-67

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.

@pthmas pthmas merged commit 3133fbb into main Apr 22, 2026
10 checks passed
@pthmas pthmas deleted the issue-67 branch April 22, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: remove token_uri image fallback in NFT pages

2 participants