Skip to content

Conversation

@Gaubee
Copy link
Contributor

@Gaubee Gaubee commented Dec 26, 2025

Summary

Improve contact UI, implement multi-address support, and add Avataaars-based avatar system.

Changes

Avatar System

  • Add ContactAvatar component with Avataaars-based avatars
  • Implement 46-bit → 8-char base64 avatar encoding for QR code embedding
  • Support avatar:HASH URL scheme
  • Allow avatar change when editing contacts (random seed)

Multi-Address Support

  • Each contact can have up to 3 addresses
  • Custom label per address (max 10 chars, no fallback to chain type)
  • Label input before address input in editor
  • ContactPicker groups addresses by contact with proper spacing

Address Validation

  • BioForest chains are mutually compatible (shared key system)
  • Ethereum and BSC addresses are compatible
  • Invalid addresses shown as disabled in picker

AddressInput Enhancement

  • Show matched contact avatar and name when address matches
  • Clear button to reset to input mode

Breaking Changes

  • Storage version 3, no migration from older versions
  • Remove chainType field from ContactAddress
  • Labels only display custom content (no auto chain type)

Documentation

  • Add Contact component documentation
  • Update state management doc with AddressBookStore

Testing

  • All 1489 unit tests pass
  • Typecheck passes

@Gaubee Gaubee force-pushed the feat/contact-card-style branch from d2557c0 to 4931764 Compare December 26, 2025 04:46
- Add ContactAvatar component with Avataaars-based avatars
- Implement 8-char base64 avatar encoding for QR code embedding
- Add snapdom for DOM screenshot download functionality
- Remove memo from shared QR content (privacy: memo is private)
- Fix store initialization: ensure contacts visible across all pages
- Add AddressBookSuggestionProvider for decoupled AddressInput
- Add E2E test for contact-to-transfer flow validation
- Create AppInitializer for unified store initialization at App level
- Remove defensive initialization from AddressBookPage, ContactPickerJob, AddressBookSuggestionProvider
- This ensures single source of truth: initialization happens once in App, components only read
- Add recentContactIds to preferences store (stores only IDs, not copies)
- Add trackRecentContact action to update recent list after transfer
- Update TransferTab to lookup contacts by ID from addressBookStore
- Track contact on successful transfer in SendPage

This follows single source of truth principle:
- Contact data lives only in addressBookStore.contacts
- recentContactIds is just an ordered list of ID references
- Display reads from contacts using IDs, ensuring data consistency
… of truth

- Delete contact-suggestion-context.tsx (unnecessary middleware layer)
- AddressInput now directly uses useStore(addressBookStore)
- All contact-related components read from the same addressBookStore:
  - AddressBookPage
  - AddressInput (dropdown suggestions)
  - ContactPickerJob (bottom sheet)
  - TransferTab (recent contacts)

This ensures true single source of truth:
- No Context Provider copying/caching data
- All components directly subscribe to addressBookStore
- Data consistency guaranteed across all views
- Show all contacts in picker/dropdown, disable invalid addresses
- Use isValidAddressForChain() for real-time address validation
- Add 3-address limit per contact (QR capacity constraint)
- Add noValidAddress i18n translation
- Update keyboard nav to skip disabled addresses
BREAKING CHANGE: ContactAddress no longer has chainType field

- Remove chainType from ContactAddress interface
- Add custom label field (e.g. 'Main', 'Exchange')
- Use detectAddressFormat for chain validation instead of stored type
- Update all components to display label or detected chain type
- Add addressLabel input in ContactEditJob
- Update QR protocol to use label instead of chainType
- Limit contacts to max 3 addresses (QR capacity)
- Show custom label only (no fallback to chain type)
- Multi-address input with label before address (max 3)
- ContactPicker: group addresses by contact with better spacing
- AddressInput: show matched contact avatar and name
- Allow avatar change when editing contact (random seed)
- BioForest chains are mutually compatible for address validation
- Breaking: storage version 3, no migration from older versions
- Add Contact.md with ContactAvatar, ContactCard, ContactPicker specs
- Update state management doc with AddressBookStore
- Update component index
@Gaubee Gaubee force-pushed the feat/contact-card-style branch from 572cdc8 to 9be0724 Compare December 26, 2025 06:24
@Gaubee Gaubee changed the title feat(contact): optimize contact card UI with avataaars and snapdom feat(contact): improve contact UI and multi-address support Dec 26, 2025
@Gaubee Gaubee merged commit 4f89bf4 into main Dec 26, 2025
5 checks passed
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.

2 participants