Skip to content

Collections updates#1822

Merged
gemcoder21 merged 8 commits intomainfrom
collections-updates
Mar 25, 2026
Merged

Collections updates#1822
gemcoder21 merged 8 commits intomainfrom
collections-updates

Conversation

@gemdev111
Copy link
Contributor

@gemdev111 gemdev111 commented Mar 24, 2026

closes #1814

  • Improve NFT image placeholder: replace flat gray with proportional circle + photo icon, handle nil URL to avoid infinite spinner
  • Extract NftImagePlaceholderView as reusable component with proportional sizing
  • Add VerifiedBadgeView with consistent white checkmark on blue seal across grid and detail views
  • Disable context menu (Save to Photos, Set as Avatar) when image is not loaded
  • Fix layout consistency: add contentMargins for top spacing, align grid horizontal padding with toolbar button
  • Clean up NFT module: remove unused imports, dead code, fix access modifiers

images:

Simulator Screenshot - iPhone 17 Pro Max - 2026-03-24 at 19 27 17 Simulator Screenshot - iPhone 17 Pro Max - 2026-03-24 at 19 27 13

 - Replace hardcoded Colors.grayLight with adaptive systemGray5 background
  - Handle nil image URL to avoid infinite loading spinner for NFTs without images (e.g. ENS domains)
  - Add NftImagePlaceholderView with proportional circle + photo icon that clearly communicates "no image"
  - Show NFT name on placeholder in detail view only
  - Extract placeholder into separate reusable component
- Extract reusable VerifiedBadgeView component
- Use consistent white checkmark styling across grid and detail views
Added isImageLoaded to track if image failed to download
…ifiers

- Remove unused imports: Photos, ImageGalleryService, Foundation, Style, Localization
- Remove dead `description` property that shadows CustomStringConvertible
- Move private members to private extension: contractValue, contractExplorerUrl, enabledChainTypes
- Make enabledChainTypes static since it's constant across instances
@gemdev111 gemdev111 self-assigned this Mar 24, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces several enhancements and refactorings across the NFT collection and collectible views. It focuses on improving the user interface, standardizing UI components, and streamlining the underlying view models by moving logic into computed properties and private extensions.

Highlights

  • Standardized Verified Badges: Replaced direct checkmarkSealFill icons with a new VerifiedBadgeView component for consistent display of verified status across multiple views.
  • Enhanced NFT Image Handling: Introduced NftImagePlaceholderView for better visual feedback during image loading or failure, and updated NftImageView to use this new component along with a binding to track image loading status.
  • Refactored Collectible View Logic: Moved context menu item generation and chain type validation logic from CollectibleViewModel into private extensions and computed properties, improving code organization and readability.
  • UI Layout Adjustments: Applied contentMargins to scrollable content in CollectibleScene and CollectionsScene for improved spacing and visual presentation.
  • Dependency Cleanup: Removed unused imports (Foundation, ImageGalleryService, Localization, Photos, Style) from various scenes and view models, reducing bundle size and improving build times.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request refactors NFT-related UI components and view models, introducing reusable VerifiedBadgeView and NftImagePlaceholderView components for standardized UI elements and improved image loading states. The NftImageView now uses NftImagePlaceholderView for empty/failed states and binds an isImageLoaded flag to the CollectibleViewModel, which in turn controls the visibility of the image context menu. Additionally, the PR includes code cleanup by removing unused imports and reorganizing properties within CollectibleViewModel. A review comment suggests improving the NftImagePlaceholderView by extracting magic numbers used in layout calculations into named constants for better readability and maintainability.

Comment on lines +17 to +19
let showName = size > 250
let circleSize = size * (showName ? 0.3 : 0.35)
let iconSize = circleSize * 0.45
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

These layout calculations use several magic numbers. To improve readability and maintainability, it's best to extract these values into named constants. Please replace these lines with the suggestion and add the following constants struct inside NftImagePlaceholderView:

private struct Layout {
    static let nameVisibilityThreshold: CGFloat = 250
    static let circleSizeRatioWithText: CGFloat = 0.3
    static let circleSizeRatioDefault: CGFloat = 0.35
    static let iconSizeRatio: CGFloat = 0.45
}
Suggested change
let showName = size > 250
let circleSize = size * (showName ? 0.3 : 0.35)
let iconSize = circleSize * 0.45
let showName = size > Layout.nameVisibilityThreshold
let circleSize = size * (showName ? Layout.circleSizeRatioWithText : Layout.circleSizeRatioDefault)
let iconSize = circleSize * Layout.iconSizeRatio

@gemcoder21 gemcoder21 merged commit cc685ec into main Mar 25, 2026
1 check passed
@gemcoder21 gemcoder21 deleted the collections-updates branch March 25, 2026 16:38
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.

Improve nft placeholder

2 participants