Skip to content

Comments

Add to contacts from Confirm and Transaction#1724

Closed
DRadmir wants to merge 2 commits intomainfrom
469-add-to-contacts
Closed

Add to contacts from Confirm and Transaction#1724
DRadmir wants to merge 2 commits intomainfrom
469-add-to-contacts

Conversation

@DRadmir
Copy link
Contributor

@DRadmir DRadmir commented Feb 23, 2026

Simulator Screenshot - iPhone 17 Pro Max - 2026-02-23 at 15 52 56 Simulator Screenshot - iPhone 17 Pro Max - 2026-02-23 at 15 53 01 Simulator Screenshot - iPhone 17 Pro Max - 2026-02-23 at 15 53 07 Simulator Screenshot - iPhone 17 Pro Max - 2026-02-23 at 15 53 14

@DRadmir DRadmir self-assigned this Feb 23, 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 improves the user experience by integrating contact management directly into the transfer confirmation and transaction detail views. Users can now seamlessly add or update contact information for addresses encountered during these processes, streamlining the workflow and reducing manual data entry. The changes involve substantial refactoring of contact-related view models and services to support these new interaction patterns, along with UI adjustments to expose the functionality.

Highlights

  • New 'Add to Contacts' Functionality: Introduced the ability to add addresses to existing or new contacts directly from the Confirm Transfer and Transaction detail screens, enhancing user convenience for managing recipient information.
  • Refactored Contact Management Flow: The ManageContactViewModel and ContactsViewModel were updated with new Mode enums and associated logic to support various contact interaction scenarios, including adding new contacts, creating a contact from an address, appending an address to an existing contact, and editing contacts.
  • UI Integration for Adding Contacts: An 'Add to Contacts' option was added to the context menu of address list items in relevant screens, providing a direct pathway to the contact management flow.
  • Contact Service Enhancements: The ContactService was extended to support more granular address management, including adding a single address to a contact and ensuring proper deletion of associated address names when contacts or addresses are removed.
  • Localization Updates: The new 'Add to Contacts' string was localized across multiple languages to ensure a consistent user experience.

🧠 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/Contacts/Package.swift
    • Removed 'StoreTestKit' dependency.
    • Added 'ContactServiceTestKit' dependency.
  • Features/Contacts/Sources/Scenes/ContactsScene.swift
    • Updated contact selection action to use onSelectContact.
    • Modified add contact button action to use onSelectAddContact.
    • Consolidated sheet presentation logic for managing contacts to use a single item binding with ManageContactViewModel.Mode.
  • Features/Contacts/Sources/Scenes/ManageContactNavigationStack.swift
    • Made ManageContactNavigationStack public.
    • Made initializer and body of ManageContactNavigationStack public.
  • Features/Contacts/Sources/Scenes/ManageContactScene.swift
    • Implemented conditional dismissal logic based on model.shouldDismissOnSave.
  • Features/Contacts/Sources/Types/AddAddressInput.swift
    • Added new AddAddressInput struct to define input for adding an address.
  • Features/Contacts/Sources/Types/ManageContactViewModel+Mode.swift
    • Introduced ManageContactViewModel.Mode enum with add, create, append, and edit cases.
    • Added Identifiable conformance to ManageContactViewModel.Mode.
    • Provided a computed property contact to extract contact data from the mode.
  • Features/Contacts/Sources/ViewModels/ContactsViewModel.swift
    • Defined ContactsViewModel.Mode enum for different contact view states.
    • Updated isPresentingContact to be of type ManageContactViewModel.Mode?.
    • Modified initializer to accept ContactsViewModel.Mode.
    • Added onSelectAddContact to handle adding new contacts or creating from an address.
    • Added onSelectContact to handle editing contacts or appending addresses.
    • Adjusted onManageContactComplete to handle completion based on the current mode.
  • Features/Contacts/Sources/ViewModels/ManageContactViewModel.swift
    • Removed internal Mode enum, now using the shared ManageContactViewModel.Mode.
    • Updated initialization logic to support create and append modes, pre-filling data as needed.
    • Modified isAddMode to correctly identify add and create modes.
    • Added shouldDismissOnSave property to control view dismissal.
    • Updated onSave to handle add, create, append, and edit modes for contact operations.
  • Features/Contacts/Tests/ContactsTests/ManageContactViewModelTests.swift
    • Removed StoreTestKit import.
    • Added ContactServiceTestKit import.
    • Updated mock ContactService initialization to use ContactService.mock().
  • Features/Transactions/Package.swift
    • Added Contacts package as a dependency.
    • Added ContactService product from FeatureServices as a dependency.
  • Features/Transactions/Sources/ItemModels/TransactionParticipantItemModel.swift
    • Added an optional onAddContact closure property.
    • Passed onAddContact to AddressListItemViewModel.
  • Features/Transactions/Sources/TransactionNavigationView.swift
    • Imported Contacts module.
    • Added a new sheet case .addToContact to present ContactsScene for adding addresses.
  • Features/Transactions/Sources/Types/TransactionSheetType.swift
    • Imported Contacts module.
    • Added addToContact(AddAddressInput) case to TransactionSheetType.
  • Features/Transactions/Sources/ViewModels/TransactionParticipantViewModel.swift
    • Added an optional onAddContact closure to the initializer.
    • Conditionally passed onAddContact to TransactionParticipantItemModel if the account has no name.
  • Features/Transactions/Sources/ViewModels/TransactionSceneViewModel.swift
    • Imported Contacts and ContactService modules.
    • Added contactService as a dependency in the initializer.
    • Updated item(for:) to pass onSelectAddContact to TransactionParticipantViewModel.
    • Implemented onSelectAddContact to create AddAddressInput and trigger the contact sheet.
  • Features/Transactions/Tests/TransactionsTests/ViewModels/TransactionSceneViewModelTests.swift
    • Removed Store import.
    • Added ContactService and ContactServiceTestKit imports.
    • Updated mock TransactionSceneViewModel initializations to include a mock contactService.
  • Features/Transfer/Package.swift
    • Added Contacts package as a dependency.
    • Added ContactService product from FeatureServices as a dependency.
  • Features/Transfer/Sources/Scenes/ConfirmTransferScene.swift
    • Imported Contacts module.
    • Added a new sheet case .addToContact to present ContactsScene for adding addresses.
  • Features/Transfer/Sources/Types/ConfirmTransferSheetType.swift
    • Imported Contacts module.
    • Added addToContact(AddAddressInput) case to ConfirmTransferSheetType.
  • Features/Transfer/Sources/ViewModels/ConfirmRecipientViewModel.swift
    • Added an optional onAddContact closure to the initializer.
    • Conditionally passed onAddContact to AddressListItemViewModel if the address has no name.
  • Features/Transfer/Sources/ViewModels/ConfirmTransferSceneViewModel.swift
    • Imported Contacts and ContactService modules.
    • Added contactService as a dependency in the initializer.
    • Updated item(for:) to pass onSelectAddContact to ConfirmRecipientViewModel.
    • Implemented onSelectAddContact to create AddAddressInput and trigger the contact sheet.
  • Features/Transfer/Tests/ViewModels/ConfirmTransferSceneViewModelTests.swift
    • Added ContactServiceTestKit import.
    • Updated mock ConfirmTransferSceneViewModel initializations to include a mock contactService.
  • Gem/Navigation/Settings/SettingsNavigationStack.swift
    • Updated ContactsScene initialization to explicitly pass .view mode.
  • Gem/Navigation/Transactions/TransactionsNavigationStack.swift
    • Added contactService as an environment object.
    • Updated TransactionNavigationView initialization to pass contactService.
  • Gem/Navigation/Wallet/WalletNavigationStack.swift
    • Added contactService as an environment object.
    • Updated TransactionNavigationView initialization to pass contactService.
  • Gem/Services/ServicesFactory.swift
    • Passed contactService to AppResolver.Services initialization.
  • Gem/Services/ViewModelFactory.swift
    • Imported ContactService module.
    • Added contactService as a property and to the initializer.
    • Updated ConfirmTransferSceneViewModel initialization to pass contactService.
  • Packages/FeatureServices/ContactService/ContactService.swift
    • Modified updateContact to use ContactAddress objects for diffing and deleting address names.
    • Modified deleteContact to also delete associated address names.
    • Added addAddress method to add a single address to an existing contact.
    • Added private helper method deleteAddressNames.
  • Packages/FeatureServices/ContactService/TestKit/ContactService+TestKit.swift
    • Added new file for ContactService mock implementation.
  • Packages/FeatureServices/Package.swift
    • Added ContactServiceTestKit library and target definition.
  • Packages/Localization/Sources/Localized.swift
    • Added contacts.add_to_contacts localization key.
  • Packages/Localization/Sources/Resources/ar.lproj/Localizable.strings
    • Added Arabic translation for 'Add to Contacts'.
  • Packages/Localization/Sources/Resources/bn.lproj/Localizable.strings
    • Added Bengali translation for 'Add to Contacts'.
  • Packages/Localization/Sources/Resources/cs.lproj/Localizable.strings
    • Added Czech translation for 'Add to Contacts'.
  • Packages/Localization/Sources/Resources/da.lproj/Localizable.strings
    • Added Danish translation for 'Føj til Kontakter'.
  • Packages/Localization/Sources/Resources/de.lproj/Localizable.strings
    • Added German translation for 'Zu Kontakten hinzufügen'.
  • Packages/Localization/Sources/Resources/en.lproj/Localizable.strings
    • Added English translation for 'Add to Contacts'.
  • Packages/Localization/Sources/Resources/es.lproj/Localizable.strings
    • Added Spanish translation for 'Añadir a contactos'.
  • Packages/Localization/Sources/Resources/fa.lproj/Localizable.strings
    • Added Farsi translation for 'اضافه کردن به مخاطبین'.
  • Packages/Localization/Sources/Resources/fil.lproj/Localizable.strings
    • Added Filipino translation for 'Idagdag sa Mga Kontak'.
  • Packages/Localization/Sources/Resources/fr.lproj/Localizable.strings
    • Added French translation for 'Ajouter aux contacts'.
  • Packages/Localization/Sources/Resources/ha.lproj/Localizable.strings
    • Added Hausa translation for 'Ƙara zuwa Lambobin Sadarwa'.
  • Packages/Localization/Sources/Resources/he.lproj/Localizable.strings
    • Added Hebrew translation for 'הוסף לאנשי קשר'.
  • Packages/Localization/Sources/Resources/hi.lproj/Localizable.strings
    • Added Hindi translation for 'संपर्क के खाते में जोड़ दे'.
  • Packages/Localization/Sources/Resources/id.lproj/Localizable.strings
    • Added Indonesian translation for 'Tambahkan ke Kontak'.
  • Packages/Localization/Sources/Resources/it.lproj/Localizable.strings
    • Added Italian translation for 'Aggiungi ai contatti'.
  • Packages/Localization/Sources/Resources/ja.lproj/Localizable.strings
    • Added Japanese translation for '連絡先に追加'.
  • Packages/Localization/Sources/Resources/ko.lproj/Localizable.strings
    • Added Korean translation for '연락처에 추가'.
  • Packages/Localization/Sources/Resources/ms.lproj/Localizable.strings
    • Added Malay translation for 'Tambah ke Kenalan'.
  • Packages/Localization/Sources/Resources/nl.lproj/Localizable.strings
    • Added Dutch translation for 'Toevoegen aan contacten'.
  • Packages/Localization/Sources/Resources/pl.lproj/Localizable.strings
    • Added Polish translation for 'Dodaj do kontaktów'.
  • Packages/Localization/Sources/Resources/pt-BR.lproj/Localizable.strings
    • Added Brazilian Portuguese translation for 'Adicionar aos contatos'.
  • Packages/Localization/Sources/Resources/ro.lproj/Localizable.strings
    • Added Romanian translation for 'Adăugați la Contacte'.
  • Packages/Localization/Sources/Resources/ru.lproj/Localizable.strings
    • Added Russian translation for 'Добавить в контакты'.
  • Packages/Localization/Sources/Resources/sw.lproj/Localizable.strings
    • Added Swahili translation for 'Ongeza kwenye Anwani'.
  • Packages/Localization/Sources/Resources/th.lproj/Localizable.strings
    • Added Thai translation for 'เพิ่มลงในรายชื่อติดต่อ'.
  • Packages/Localization/Sources/Resources/tr.lproj/Localizable.strings
    • Added Turkish translation for 'Kişilere Ekle'.
  • Packages/Localization/Sources/Resources/uk.lproj/Localizable.strings
    • Added Ukrainian translation for 'Додати до контактів'.
  • Packages/Localization/Sources/Resources/ur.lproj/Localizable.strings
    • Added Urdu translation for 'رابطوں میں شامل کریں۔'.
  • Packages/Localization/Sources/Resources/vi.lproj/Localizable.strings
    • Added Vietnamese translation for 'Thêm vào danh bạ'.
  • Packages/Localization/Sources/Resources/zh-Hans.lproj/Localizable.strings
    • Added Simplified Chinese translation for '添加到联系人'.
  • Packages/Localization/Sources/Resources/zh-Hant.lproj/Localizable.strings
    • Added Traditional Chinese translation for '加入聯絡人'.
  • Packages/PrimitivesComponents/Sources/Components/AddressListItemView.swift
    • Refactored contextMenu to use a computed property.
    • Added conditional 'Add to Contacts' context menu item based on onAddContact availability.
  • Packages/PrimitivesComponents/Sources/ViewModels/AddressListItemViewModel.swift
    • Added an optional onAddContact closure property.
  • Packages/Store/Sources/Models/ContactAddressRecord.swift
    • Removed references(AssetRecord.databaseTableName) from the address column definition.
  • Packages/Store/Sources/Stores/AddressStore.swift
    • Made deleteAddress method public and marked it as @discardableResult.
  • Packages/Store/Sources/Stores/ContactStore.swift
    • Renamed getAddressIds to getAddresses and changed its return type to [ContactAddress].
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 successfully implements the 'Add to Contacts' functionality from the transaction confirmation and details screens. The integration across different modules (Contacts, Transactions, Transfer) is well-structured and follows existing patterns. I've identified a minor state management issue in ContactsViewModel where the presentation state isn't cleared in all modes, which could lead to inconsistent UI behavior if the view is reused.

- Add context menu option to add recipient address to contacts
- Reuse existing ContactsScene with Mode enum for add address flow
- Hide "Add to Contact" option when address already has a name
- Add ContactServiceTestKit for testing
- Update localization
@DRadmir DRadmir force-pushed the 469-add-to-contacts branch from 7298393 to eee9964 Compare February 23, 2026 11:48
@DRadmir DRadmir closed this Feb 23, 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.

1 participant