Skip to content

Conversation

@piyalbasu
Copy link
Contributor

@piyalbasu piyalbasu commented Dec 10, 2025

Closes #2326

Adds Collectible Details UI

  • When clicking on a collectible, it will open up the details of that collectible (from the redux store) into a modal, similar to how we deal with asset details
  • Clicking refresh metadata will re-fetch just the metadata for only the selected collectible. The new metadata is then added to redux to make sure our redux store stays in sync while minimizing the amount of API's calls we need to make
Screenshot 2025-12-10 at 1 13 12 PM Screenshot 2025-12-10 at 1 13 19 PM

Example of changing metadata for a collectible:

Screen.Recording.2025-12-09.at.5.06.49.PM.mov

);
return {
collectionAddress: collection.address,
collectionName: collection.name,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding these keys to the collectible object to make displaying details a little simpler. Mobile follows a similar data model

@socket-security
Copy link

socket-security bot commented Dec 10, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​radix-ui/​react-popover@​1.1.15991007196100

View full report

@@ -0,0 +1,41 @@
import * as React from "react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

implementing Popover from shadcn as a test run 🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Picked up directly from here: https://ui.shadcn.com/docs/components/popover

) : (
<View.Content>
<div className="CollectibleDetail__content">
{collectible.metadata?.image && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't have any control of collectible metadata (as it's hosted by the NFT creator), so I'm using defensive checks for all the pieces of data we want to show. I'm working under the assumption some (or all) of these fields may not have been configured properly

<div className="CollectibleDetail__header__right-button__popover-content__item__label">
{t("Hide collectible")}
</div>
</div>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this button functionality will be implemented in the next PR

tokenId: selectedCollectible.tokenId,
tokenUri: collectible.tokenUri || "",
});
setIsPopoverOpen(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: we don't have an error state designed for what to do if refreshing metadata fails. For now, this fails silently but we should provide the user with some feedback if it failed @sdfcharles

collections[resolvedData?.networkDetails?.network || ""]?.[
resolvedData?.publicKey || ""
] || []
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use our value from redux so when we refresh metadata, the change is reflected in all views

@piyalbasu piyalbasu marked this pull request as ready for review December 10, 2025 20:46
},
];
}
console.log(tokenMetadataCount);
Copy link
Contributor

Choose a reason for hiding this comment

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

leftover debug log

title={name}
customBackAction={handleItemClose}
rightButton={
<Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>
Copy link
Contributor

Choose a reason for hiding this comment

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

A couple of things I noticed -
The detail view should be a bottom slider but the Popover is for modals, should this use the sheet instead?
Our bottom sheets have the x icon for the dismiss action, here we use the back arrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, thanks for bringing that up. I did see that the mobile app uses the bottom sheet for this view, but I opted to re-use the style we use for the asset detail subview for consistency.

@sdfcharles What do you think? I can implement the shadcn bottom sheet, but I'd imagine we'd want to do this for the asset detail subview, as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After chatting with Charles, we decided to move forward with implementing shadcn's sheet. It is a sizable change so I opened a new PR for this work to make it easier to review: #2463

@CassioMG CassioMG assigned CassioMG and piyalbasu and unassigned CassioMG Dec 10, 2025
@CassioMG CassioMG linked an issue Dec 10, 2025 that may be closed by this pull request
Copy link
Contributor

@CassioMG CassioMG left a comment

Choose a reason for hiding this comment

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

Nice! Good work on making the "refresh metadata" fetch the metadata for a single collectible, we should probably do the same on mobile

@piyalbasu piyalbasu force-pushed the feature/collectible-detail branch from aee6ae5 to d3daa5a Compare December 14, 2025 19:55
@piyalbasu piyalbasu merged commit ea3ee99 into release/5.37.0 Dec 14, 2025
2 of 3 checks passed
@piyalbasu piyalbasu deleted the feature/collectible-detail branch December 14, 2025 20:27
piyalbasu added a commit that referenced this pull request Dec 29, 2025
* add CollectibleDetail UI

* add popover and tests

* adds additional testing

* fetch only the metadata for the current detail

* use state from hook

* fix missing translations helpers

* rm log

* fix tests

* test failing due to copy change

* rm empty dir and fix test due to copy change
piyalbasu added a commit that referenced this pull request Jan 8, 2026
* add CollectibleDetail UI

* add popover and tests

* adds additional testing

* fetch only the metadata for the current detail

* use state from hook

* fix missing translations helpers

* rm log

* fix tests

* test failing due to copy change

* rm empty dir and fix test due to copy change
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.

[Collectibles] Collectible Details UI

4 participants