Repository navigation
Move the account menu rules to wallet_core - #768
Merged
Merged
Conversation
Before the account menu rules move to wallet_core for the desktop, pin today's phone behaviour: which items each account kind and a wallet heading offer, what each disconnect confirms and removes, the multisig signer order and labels, and how account, multisig and wallet names are saved.
What an account's or a multisig's menu offers, how an account is disconnected (alone, as hardware, or with its whole wallet, numbered among software wallets), the multisig signer order and what a typed name amounts to, as pure functions both apps can share.
The accounts screen's menus, Disconnect, multisig details and Rename now use wallet_core's accountMenuOf, disconnectPlanOf, orderedSignersOf and nameEditOf. The pins in account_menu_rules_test.dart are unchanged.
n13
approved these changes
Nov 20, 2026
n13
left a comment
Collaborator
There was a problem hiding this comment.
Verdict: Approve
Reviewer: GPT-6.1 Sol
Reviewed head 1f01b3d563b0c386605bae44ee4d37a4cf7e22c2 against base a76f24e4f1c32d5fc96f0c96c8358236731f382f.
No blocking findings. The extracted rules preserve the phone's menu ordering and availability, primary-wallet protection, account versus whole-wallet removal, hardware and multisig disconnect behavior, signer ordering, and trimmed account/multisig names. Wallet-heading naming retains its distinct empty-name behavior.
Validation with pinned Flutter 3.47.7:
- Locked Melos bootstrap passed.
timeout 60 flutter test --no-pub --reporter=expandedinwallet_core: 207 tests passed, including all 16 new rule tests.timeout 60 flutter test --no-pub --reporter=failures-only test/screens/account_menu_rules_test.dart test/screens/accounts_screen_menu_test.dartinmobile-app: 25 tests passed, including the 20 new behavior pins.- Workspace formatting check and
git diff --checkpassed; tracked files were unchanged. timeout 10 dart run melos run analyzestopped at the required limit while analyzing the first package; local analysis is incomplete. GitHub's Analyze job is still in progress. No physical-device testing was performed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The phone's account-menu rules move from its widgets to wallet_core, so the desktop's account management (next PR) shares them instead of copying them. The phone behaves as before.
wallet_core/lib/utils/account_menu.dart, all pure functions:accountMenuOf(account, accounts)andmultisigMenu: what an account's or a multisig's menu offers, in order (show address, inner hash, rename, recovery phrase, multisig details, disconnect).disconnectPlanOf(account, accounts): how an account is disconnected. It goes alone (DisconnectAccount), as hardware (DisconnectHardware), or with its whole wallet (DisconnectWallet, with the wallet's index and its number among software wallets). Null when it can't be: Encrypted, external, or the last account of wallet 0.orderedSignersOf(multisig): the creator first when it is a signer, the rest as stored.nameEditOf(current, entered): blank, unchanged, or changed with the trimmed name.Commits
mobile-app/test/screens/account_menu_rules_test.dart, 20 tests against today's phone code. They cover the menu of each account kind and of a wallet heading, and what each disconnect confirms and stores, including a second wallet removed with its phrase. They also cover the active account after a removal, multisig details (signer order, Creator/You, threshold), and renaming an account, a multisig and a wallet. They run against the realSettingsServiceover mocked storage.flutter_secure_storagebecomes a direct dev dependency of the phone, at the version it already resolved.Phone code that changed (please retest by hand)
accounts_screen.dart: the kebab menus of an account and a multisig are built fromaccountMenuOf/multisigMenu; Disconnect keeps its own group.account_menu_screen.dart:canDisconnectanddisconnectfollowdisconnectPlanOf.multisig_details_screen.dart: the signer order comes fromorderedSignersOf.edit_account_screen.dart: saving goes throughnameEditOf.Behaviour changes, invisible in normal use
requireValue). The rows that open the menus only show once the list has loaded.Testing
melos run checkpassed: analyze clean, mobile 859.