HomePhabricator

[Cashtab] Contact List

Description

[Cashtab] Contact List

Summary:
As per T2080, this is a frequently requested feature from the community across numerous channels.

New Contact List feature added to the Configure and Home components. Contacts can be added via a link from the Tx History dropdowns. Each contact can be renamed, route to Send screen, copied to clipboard or deleted.

This option will only appear for new transactions or old transactions with messages, as prior to this diff only inbound transactions with OP_RETURN messages were storing the sender address.

Within Configure.js, the contact list is an array of objects. Each object has a name and address attribute.

In terms of UI, the Contact List dropdown is kept close to the Saved wallets dropdown in order to group and differentiate them from the main New/Import Wallet buttons.

Subsequent diffs will improve upon this feature by allowing cvs export/import of contact lists.

Will chat to you re: the Configure unit tests on tg.

Test Plan:

  • Navigate to Home and ensure the Add to Contacts option is only available for new inbound transactions or old transactions with OP_RETURN messages
  • Pick an inbound tx and click Add to contacts and ensure app routes to the Configure screen with the Contact List dropdown already opened, along with a general notification of adding this address to the contact list.
  • Click the pen icon next to this newly added contact and enter a new name that is close to 24 characters. Ensure overflow css shows the entirety of the long name and address when mouseover.
  • Rename the same cotact and ensure the new name is reflected.
  • Click on the contact address and ensure it is copied to clipboard
  • Restart browser and ensure this data persisted via local storage
  • Attempt to add this same contact via the Add to Contacts option and ensure that while the app routes to the Configure page, a general notification is displayed indicating this contact already exists in the contact list.
  • Click on the Send icon for the contact and ensure routing to the Send screen with the address already pre-populated
  • Go back to the contact list and delete the newly added contact and ensure the dropdown displays 'Your contact list is empty'
  • Add more than one contact and observe the dropdown length extending.
  • Ensure no cosmetic conflicts with the Saved Wallets dropdown
  • Test localforage behaviour across Chrome, Firefox and Brave
  • Test localforage behaviour across Extension and iOS/Android
  • Test localforage behaviour with a brand new wallet on a browser wiped clean of old cache

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D11266

Details

Provenance
emackAuthored on Mar 28 2022, 02:21
emackPushed on Apr 13 2022, 00:18
Reviewer
Restricted Project
Differential Revision
D11266: [Cashtab] Contact List
Parents
rABC19dc8063f99b: [Cashtab] remove unnecessary constant keys
Branches
Unknown
Tags
Unknown