Skip to content

feat(ui): main-identity selection and a pushed identity detail page#836

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/main-identity-detail-page
Jul 16, 2026
Merged

feat(ui): main-identity selection and a pushed identity detail page#836
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/main-identity-detail-page

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Summary

Two changes to the Identities screen (More → Identities):

Pushed detail page

Tapping an identity now pushes a full page (same pattern as Wallets → accounts) instead of the compact modal sheet. Same content — copyable id card, info card, owned usernames — plus the new main-identity control, with room to grow.

Set your main identity

The SDK deliberately leaves primary-identity selection to the app layer (InMemoryWalletSummary.primaryIdentityId is always nil Rust-side, "source the user's pick from app state"). So:

  • The pick is stored app-side, per wallet (UserDefaults, DWMainIdentityId.<walletIdHex>).
  • DWCurrentUserIdentityInfo resolves the current identity as stored pick → identity index 0 → lowest registered index. The new last fallback also fixes a latent gap: a wallet whose only identity was discovered at a higher slot used to read as unregistered.
  • Setting main runs the registration-completion cascade so everything re-keys live: identity snapshot, the DWGlobalOptions username mirror (re-pointed at the new main's name, or cleared — the Join banner then honestly returns), the registration-status notification chain, and the contacts snapshots.
  • Scoped to the active wallet (DashPay surfaces follow it); identities of other wallets get an explanatory line instead of the button. Confirmation alert states the consequence ("Your username, profile, and contacts will follow this identity").
  • The resolved main is badged with a seal on the list row and the page header — read from the same resolution every DashPay surface uses, so the badge can't disagree with behavior.

Test plan

  • Clean dashpay simulator build (arm64); installed on QA-iPhone16
  • Tap identity → detail page pushes (no sheet); back chevron pops
  • Single-identity wallet: row and page show the Main seal (index-0 fallback)
  • With a second identity (e.g. via Find on a multi-slot seed): Set as Main → confirm → home avatar/username and Contacts owner follow the pick; survives relaunch

🤖 Generated with Claude Code

Identities gains two things:

- Tapping a row pushes a full detail page (WalletsScreen → accounts
  pattern) instead of the compact modal sheet — same cards (copyable
  id, info, usernames) plus the new main-identity control.
- "Set as Main Identity": the SDK deliberately leaves primary-identity
  selection to the app layer (InMemoryWalletSummary.primaryIdentityId
  is always nil Rust-side), so the pick is stored app-side per wallet
  (UserDefaults, identity id as hex) and resolved by
  DWCurrentUserIdentityInfo: stored pick → identity index 0 → lowest
  registered index. The last fallback also fixes a latent gap — a
  wallet whose only identity was discovered at a higher slot used to
  read as unregistered.

Setting main drives the registration-completion cascade so the app
re-keys live: identity snapshot refresh, DWGlobalOptions username
mirror re-pointed at the new main's name (or cleared — the Join banner
then honestly returns), the registration-status notification chain,
and the contacts snapshots. Selection is scoped to the active wallet;
other wallets' identities show an explanatory line instead of the
button. Rows and the page header badge the resolved main with a seal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@QuantumExplorer
QuantumExplorer merged commit cdc19d6 into swift-sdk-integration Jul 16, 2026
1 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/main-identity-detail-page

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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