Skip to content

Comments

Add icon to recipient row#1728

Draft
DRadmir wants to merge 3 commits intomainfrom
1725-add-icon-to-recipient-row
Draft

Add icon to recipient row#1728
DRadmir wants to merge 3 commits intomainfrom
1725-add-icon-to-recipient-row

Conversation

@DRadmir
Copy link
Contributor

@DRadmir DRadmir commented Feb 24, 2026

Simulator Screenshot - iPhone 17 Pro Max - 2026-02-24 at 12 26 59 Simulator Screenshot - iPhone 17 Pro Max - 2026-02-24 at 12 27 25

Close: #1725

- Add type column to AddressRecord with migration
- Set .contact type for local contacts in ContactService
- Set .validator type for validators in StakeService
- Update AddressStore to persist address type
- Update mocks and previews with type parameter
@DRadmir DRadmir self-assigned this Feb 24, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @DRadmir, 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 significantly enhances the user experience by introducing visual cues for different recipient types within the application. By extending core data models and implementing a database migration, the system can now store and display specific icons for domain names (like ENS) and contacts, making it easier for users to identify their transaction recipients at a glance. The changes also include minor refactorings to protocol conformances for improved data handling.

Highlights

  • Recipient Icon Display: Implemented logic to display specific icons for recipients, such as ENS domain icons or contact initials, in the recipient row based on their type.
  • Data Model Enhancements: Extended the AddressName and Recipient data models with new type properties to categorize addresses (e.g., contact, validator, domain) and recipients (e.g., domain).
  • Database Migration: Added a database migration to include a type column in the AddressRecord table, ensuring persistence of recipient type information.
  • Asset Integration: Integrated a new ENS icon asset into the application's style resources for visual representation of ENS domains.
  • Protocol Conformance Refinement: Refactored Equatable and Hashable conformance for TransactionExtended directly into its definition and added Hashable conformance to Transaction and TransactionUtxoInput.

🧠 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.

Changelog
  • Features/Transfer/Sources/ViewModels/ConfirmRecipientViewModel.swift
    • Imported Style module.
    • Updated assetImage assignment to dynamically select an icon based on recipient type.
    • Added recipientImage and addressNameImage computed properties to determine the appropriate icon for domain names (e.g., ENS) and contacts.
  • Features/Transfer/Sources/ViewModels/RecipientSceneViewModel.swift
    • Modified makeRecipientData to include the type property when creating a Recipient from a NameRecord.
  • Packages/ChainServices/StakeService/StakeService.swift
    • Updated AddressName initialization to set type as .validator for stake validators.
  • Packages/FeatureServices/ContactService/ContactService.swift
    • Updated AddressName initialization to set type as .contact for contacts.
  • Packages/Primitives/Sources/AddressName.swift
    • Added an optional type: AddressType? property.
    • Updated the initializer to accept the new type parameter.
  • Packages/Primitives/Sources/Extensions/TransactionExtended+Primitives.swift
    • Removed file containing Equatable and Hashable conformance for TransactionExtended.
  • Packages/Primitives/Sources/Name.swift
    • Modified NameRecord struct to use NameProvider enum directly for its provider property.
    • Relocated NameRecord struct definition.
  • Packages/Primitives/Sources/Recipient.swift
    • Introduced a new RecipientType enum.
    • Added an optional type: RecipientType? property to the Recipient struct.
    • Updated the Recipient initializer to accept the new type parameter.
  • Packages/Primitives/Sources/Scan.swift
    • Added .contact case to the AddressType enum.
  • Packages/Primitives/Sources/Transaction.swift
    • Added Hashable conformance to the Transaction struct.
  • Packages/Primitives/Sources/TransactionExtended.swift
    • Added Equatable and Hashable conformance to the TransactionExtended struct.
  • Packages/Primitives/Sources/TransactionUtxo.swift
    • Added Hashable conformance to the TransactionUtxoInput struct.
  • Packages/Primitives/TestKit/AddressName+PrimitivesTestKit.swift
    • Updated the mock AddressName initializer to include the new type parameter.
  • Packages/Primitives/TestKit/NameRecord+PrimitivesTestKit.swift
    • Updated the mock NameRecord initializer to pass provider directly as NameProvider.
  • Packages/PrimitivesComponents/Sources/Components/TransactionView.swift
    • Updated AddressName initializations in mock data to include type: nil.
  • Packages/Store/Sources/Migrations.swift
    • Added a new migration to add a type column to the addresses database table.
  • Packages/Store/Sources/Models/AddressRecord.swift
    • Added an optional type: AddressType? property.
    • Updated the initializer to accept the new type parameter.
    • Added type to the Columns enum.
    • Modified CreateTable extension to include the type column.
    • Updated toAddressName conversion to include the type property.
  • Packages/Store/Sources/Stores/AddressStore.swift
    • Updated AddressRecord initialization to include the type parameter when saving address names.
  • Packages/Store/TestKit/AddressStore+TestKit.swift
    • Updated AddressName initializations in mock data to include type: nil.
  • Packages/Style/Sources/Images.swift
    • Added ens static property to NameResolve enum for the ENS icon.
  • Packages/Style/Sources/Resources/Assets.xcassets/nameResolve/ens.imageset/Contents.json
    • Added asset catalog content for the ENS icon.
  • Packages/Style/Sources/Resources/Assets.xcassets/nameResolve/ens.imageset/ens.svg
    • Added the ENS SVG image asset.
  • core
    • Updated the subproject commit hash.
Activity
  • No specific human activity (comments, reviews) has been recorded for this pull request yet.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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 introduces functionality to display icons in the recipient row based on the recipient's type (domain or contact). This involves adding new type properties to AddressName and Recipient structs, updating their initializers, and modifying various view models and store operations to handle these new types. A new RecipientType enum is introduced, and the AddressType enum is extended with a .contact case. Additionally, a new ENS icon asset is added. The changes are well-contained and address the stated objective of adding icons to the recipient row.

Comment on lines +49 to +51
case .ens, .basenames: AssetImage.image(Images.NameResolve.ens)
case .ud, .sns, .spaceid, .lens, .ton, .tree, .eths, .did, .suins, .aptos, .injective, .icns, .hyperliquid, .allDomains: nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The switch provider statement for .domain cases has a default nil return for many cases. If new NameProvider cases are added in the future, this switch statement might not cover them, leading to a missing icon. Consider adding a default: nil case to explicitly handle all other NameProvider types, or ensure all cases are explicitly listed if an icon is expected for each.

Comment on lines +398 to +401
migrator.registerMigration("Add type to \(AddressRecord.databaseTableName)") { db in
try? db.alter(table: AddressRecord.databaseTableName) {
$0.add(column: AddressRecord.Columns.type.name, .text)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The migration to add the type column to AddressRecord is correctly implemented. However, it uses try? db.alter, which means if the alteration fails, it will silently ignore the error. For database migrations, it's generally better to let errors propagate to ensure data integrity, especially for schema changes. Consider removing the ? to make it try db.alter.

@DRadmir DRadmir changed the title Icon to recipient row Add icon to recipient row Feb 24, 2026
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.

Add icon to Recipient row

1 participant