fix(wallets): link top-nav wallet selector to the Wallets tab#878
fix(wallets): link top-nav wallet selector to the Wallets tab#878lklimek wants to merge 9 commits into
Conversation
…tities only HD-wallet-backed identity keys are derived on demand from the wallet's own seed and already covered by that wallet's password; the Key Protection section is hidden entirely for such identities since there is no separate vault key to protect. Addresses PR #860 review comment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e 1b) Test case specification for restoring IDN-014 receive-deposit funding on the Register and Top-Up identity screens. Descriptions/expected-outcomes only, no test code. Corrects the Phase-1a brief: detection is single-address equality (not known_addresses), funding_address is per-screen, deposit transitions are unit-level via display_task_result (not kittest-reachable today). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…es (Phase 1b)" This reverts commit 8a150eb.
…es (Phase 1b) Test case specification for wiring the top-nav wallet pill (Defect 1: Unwired on Wallets page) and re-syncing WalletsBalancesScreen on arrival (Defect 2). 13 cases (TC-WALLETLINK-01..13), descriptions/expected only, no test code. Flags the dual-hash ambiguity trap: set_selected_hd_wallet preserves the single-key hash while in-tab SK selection clears the HD hash, and construction prefers SK first — so a stale (HD=Some, SK=Some) state resolves to the wrong wallet unless the pill's HD write is made authoritative. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Task breakdown for developer-bilby: D1 make the Wallets-page top-nav pill interactive (Consumed spec swap, no new plumbing), D2 re-sync the cached selection in refresh_on_arrival and fix the set_selected_hd_wallet / single-key-hash asymmetry so an explicit pill HD pick supersedes a stale single-key selection. References TC-WALLETLINK-01..13. AppContext API shape unchanged; single Bilby pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXL4vmWNA1AjUeDVu2EqWA
Two defects that left the top-nav wallet pill and the Wallets tab's own picker out of sync (WAL-028): D1 — the Wallets-page pill was inert. Its spec built `PillConsumption::Unwired`, so the already-wired `apply_global_nav_effect` -> `set_selected_hd_wallet` path never fired. Add a `Consumed` `wallet_only_spec` constructor (mirroring the Masternodes page) and swap it in; delete the un-actioned TODO. Pill click now switches the active wallet in place, no navigation. D2 — the cached selection never re-synced on arrival, and a dual-hash asymmetry made a naive re-sync show the wrong wallet: `set_selected_hd_wallet(Some)` preserved a stale single-key hash while resolution prefers single-key-first, so a pill->HD switch re-resolved to the stale single-key wallet. Fix by clearing the single-key hash inside `set_selected_hd_wallet` when an HD wallet is picked (Some) — restoring symmetry with the single-key setter and making (HD, SK) both-set unrepresentable. Clearing the HD wallet (None) still leaves a single-key selection intact. Extract construction's store->wallet resolution into a shared `resolve_selection_from_store` helper; `refresh_on_arrival` now re-reads the store through it and adopts the result (idempotent when the cache agrees), falling back to first-wallet only when the store names nothing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Flip WAL-028 (top-nav wallet pill on the Wallets tab) to [Implemented] and add the interactive-pill acceptance line to WAL-004. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…setters Close the residual dual-hash gap QA flagged: the (HD, SK) both-set state was only prevented by convention of the one current caller, not by the setters themselves. - set_selected_single_key_wallet(Some) now clears the HD hash at the context layer (mirror of set_selected_hd_wallet), so a direct single-key set is self-enforcing regardless of caller, not only via the screen path. - set_selected_identity now clears the single-key hash when it sets an HD owner, so selecting a User identity while a single-key wallet is active can no longer leave the pill and the active identity disagreeing. - Remove the now-dead subdued_wallet_only_spec (its only production caller moved to wallet_only_spec) and its contrast test. - Trim three internal comment blocks to the length cap. Tests: add single_key_pick_supersedes_a_prior_hd_selection (the setter mirror of TC-07) and setters_never_leave_both_hashes_set (invariant guard across all three setters). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
First live GUI pass — wallet-selector linkingTested on Testnet with 3 wallets loaded (qrtest [funded, has identities], wallet2, wallet3-locked [password-protected]), built from an isolated genuine recompile of HEAD
Verdict: ready to un-draft. The core linking (items 1–3) works correctly — the two selectors are now linked and sync both ways, immediately, across pages. Single-wallet, cross-network, and locked-wallet paths all behave correctly. Two minor follow-up-if-desired notes (not blockers): (a) item 6's fully-cold locked-state and (b) any additional edge of item 5 could be re-confirmed after an app restart, but neither is expected to change given the code paths.
🤖 Generated with Claude Code |
Why this PR exists
Unwired, an explicit un-actionedTODOin the code) and the tab never re-reads the shared selection when you arrive. Two controls that both claim to answer "which wallet am I looking at" disagree.docs/platform-wallet-migration-design) — targets that branch, notv1.0-dev.What was done
Consumed) on the Wallets tab — previously subdued/inert there, everywhere else it already worked. Reuses the existing effect-dispatch wiring, no new plumbing.set_selected_hd_wallet,set_selected_single_key_wallet,set_selected_identity) consistently cleared the other on an explicit pick — meaning a stale selection could silently win over a freshly-chosen one. All three setters now self-enforce "at most one active wallet selection" regardless of which one is called.docs/user-stories.md: addedWAL-028, extendedWAL-004.Testing
cargo clippy -p dash-evo-tool --all-features --all-targets -- -D warnings— clean.cargo test/nextest -p dash-evo-tool --all-features(wallets/top_panel/hub_screen/global_nav/selected scope) — 46 passed, 0 failed, including a RED-then-GREEN test proving the dual-hash fix is actually necessary (it fails without the fix) and an invariant guard across all three setters (setters_never_leave_both_hashes_set).cargo +nightly fmt --check— clean.kittesttest drives a literal pill-click on the Wallets tab specifically (the underlying effect-dispatch logic is unit-tested, and the pill's render/click path is covered generically by an existingglobal_nav_switcherkittest) — a manual GUI spot-check covers cross-network visual behavior, locked-wallet UX, and confirms no Wallets-tab dialog needs a "peek at a different wallet" capability this change would break.Breaking changes
None. Internal state-sync fix; no public API, schema, or backend-task changes.
Checklist
cargo build/cargo clippy --all-features --all-targets -- -D warningscleancargo +nightly fmt --all -- --checkcleandocs/user-stories.mdupdatedAttribution
🤖 Co-authored by Claudius the Magnificent AI Agent