Repository navigation
Desktop: rename an account or a wallet in the sidebar - #770
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.
…nect English and Indonesian, for AM1a: the context menu's items, the copy notes shown on an account's row, the Info sheet's groups and rows, the Disconnect steps for an account, a hardware account, a multisig and a wallet's last account, and Settings' list of wallets' recovery phrases.
The pop-up button's menu surface and rows move to MenuPanel and MenuPanelRow, unchanged. ContextMenuRegion opens a menu of them at the pointer on a right-click, or a Control-click on the Mac; the arrow keys, Return and Escape work as in the pop-up menu, separators group the items, a destructive item is ember, and an item shows its shortcut.
AccountManager carries out wallet_core's account menu rules on the device: it copies an address or an encrypted account's inner hash and notes it on the account (a failure noted longer, the clipboard left as it was), renames an account or a multisig, and disconnects an account, a hardware account, a wallet with its last account, or a multisig, then reads the accounts again. The fake device storage can now remove, rename and fail to write.
ShellSheet.accountInfo opens on the account it is asked for, which need not be the active one, and closes if that account goes. A local or hardware account shows its name, its address over its checkphrase with Copy, and its wallet's rows; a multisig its threshold and its signers, creator first with own accounts named and Creator / You marked; the encrypted account its inner hash. Return or leaving the name field keeps the name, trimmed; Escape puts it back; a blank name or a failed write says why. The wallet rows' steps come next. The sidebar's wallet headings and the sheet share walletDisplayName.
The Info sheet's Disconnect row opens a caution step, Account Info › Disconnect: an account, a hardware account and a multisig each say what goes and what stays, then Disconnect removes it and closes the sheet. The last account of a wallet takes the wallet and its recovery phrase: Delete Wallet waits for the backed-up box and asks for the system's approval where the computer can ask, going ahead where it cannot, as the phone does; a refusal or a failed removal keeps the step open and says why. Cancel, the path and Command-[ go back.
The recovery phrase steps take the wallet they show instead of the first. With more than one software wallet, Settings' Recovery Phrase says how many there are and opens a list of them, each named with its accounts, scrolling inside the sheet when there are many; a wallet's row opens its caution, and back returns to the list. The Info sheet's Recovery Phrase opens the same steps for the account's wallet, and openRecoveryPhrase opens Settings on a wallet's caution, for the wallet headings' menu. Only the wallet shown is recorded as seen.
A right-click on an account's row, or a Control-click on the Mac, opens its menu in the Mac's words, as wallet_core's rules allow for the account: Get Info, Copy Address (Copy Inner Hash for the encrypted account), Rename…, Show Recovery Phrase… or Show Signers…, then Disconnect…; each acts on that account, opening the Info sheet where it needs one, and the row is ringed while the menu is open. A software wallet's heading offers its recovery phrase. The menu bar's Account menu offers the same items for the active account, with Get Info on ⌘I and Copy Address on ⇧⌘C, both rebindable. A copy is noted on the account's row (or by its name in the top bar with the sidebar hidden), announced to a screen reader. The pop-up and context menus share the menu panel.
The Info sheet finds accounts with firstOrNull instead of the collection package, which the desktop does not depend on; the fake storage marks its removals as overrides; an unused import and a needless cast go.
# Conflicts: # desktop-app/lib/ui/shell/sidebar.dart # desktop-app/tool/screenshots_test.dart # wallet_core/lib/l10n/app_en.arb # wallet_core/lib/l10n/app_id.arb # wallet_core/lib/l10n/app_localizations.dart # wallet_core/lib/l10n/app_localizations_en.dart # wallet_core/lib/l10n/app_localizations_id.dart
Rename… on an account row, or the menu bar's Rename… while the sidebar shows, turns the row's name into a field with the name selected; Return or clicking away keeps it, Escape puts it back. A blank name, or one that fails to save, is not kept, and the row says why in its balance's place. With the sidebar hidden, Rename… opens Get Info on the name as before. Every wallet heading, the Cold Wallet's too, offers Rename…, as on the phone: a blank name clears it, so the wallet is called by its number again. A name that fails to save is said under the heading. Get Info and the sidebar share the field (InlineNameField). SidebarRow takes an optional titleEditor, drawn over the title's line so the rows below do not move.
The ring around a right-clicked item put it in a Stack, which loosened its width: a wallet heading shrank to its name, so a right-click beside the name missed it, and the ring would have been the name's width. The Stack now passes the size given through.
# Conflicts: # desktop-app/test/ui/accounts/account_menu_test.dart
…tems The Account menu's own items (Get Info, Copy Address, Rename…, and the rest) were bound to the account active when the menu was built. Pressed while an account switch was still being saved, Get Info then opened on the account switched from, Copy Address copied its address at once, and a switch that failed did not drop them. Like Receive and Send, they now take their turn in the window's navigation (runOnActive): each acts on the account active when its turn comes, if that account's menu offers it, and is dropped when the switch it waited on fails. Get Info opens within that turn (openInStep), so a switch asked for after it cannot move under it. The context menus keep the account right-clicked. Found by n13's review of #769.
n13
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Reviewer: GPT-6.1 Sol
Reviewed head 1f93e4cdcdf3f51380ba888f7e840f67ed92ee20 against base e1af121a88bc519bcab8453337c84dd0872cd5ff.
-
[P2] Keep the draft before removing the inline editor —
desktop-app/lib/ui/components/inline_name_field.dart:68–81, with target replacement ataccount_management_providers.dart:118.Saving depends entirely on the focus-change listener, but disposing a focused field disposes its focus node without calling
onKeep. Reproduced by opening Savings → Rename, typingRainy day, then invoking the native Account → Rename callback for Main: Savings remainsSavings. View → Hide Sidebar also discards the draft. Both sequences reproduce for wallet drafts as well (Trading deskremains unset). This contradicts the stated behavior that starting another rename keeps the first edit. Finish the current edit before changing targets or removing the sidebar, using the same behavior for account and wallet fields; retain Escape's explicit cancellation. -
[P2] Preserve the wallet editor when its error message expires —
desktop-app/lib/ui/shell/sidebar.dart:230–244.While an error is visible, the title/editor lives inside a
Column; clearing the error replaces that entire subtree withtitle. If a wallet rename fails and the user retries within four seconds, the timer disposes their active editor and constructs a fresh one from the stored name. A widget regression that typesRecovered nameduring the retry observesWallet 2immediately after the timer expires. Keep the editor at a stable position in the widget tree while showing/hiding the error.
Validation: the three focused author suites (account_management_providers_test.dart, account_menu_test.dart, account_info_sheet_test.dart) passed all 81 tests. Five additional temporary widget regressions failed with the draft-loss results above. Tests used timeout 60 flutter test --no-pub ... --reporter expanded. Workspace formatting and git diff --check passed. Local Flutter is 3.44.4 versus pinned 3.47.7; strict bootstrap rejected the SDK-dependent lockfile versions, so test dependencies were resolved locally with flutter pub get --offline. Workspace analysis was incomplete at the required 10-second limit; it also encountered unresolved dependencies in packages outside the focused test setup. GitHub desktop builds were still in progress when checked.
# Conflicts: # desktop-app/lib/providers/account_management_providers.dart # desktop-app/lib/ui/accounts/account_menu_entries.dart
The name typed over a row or a wallet heading was kept only when its field lost the focus. A field taken away while typed in, as when the menu bar starts another rename or View hides the sidebar, was disposed without keeping it: Savings stayed Savings, Trading desk was dropped. InlineNameField now keeps what was typed when it goes away while being typed in, just after it is taken down; Escape still keeps nothing. The sidebar's and Get Info's keepers hold what they use rather than reading through a widget's ref, since they can run once their widget is gone, and keep nothing once the app's providers are gone too. Found by n13's review of #770.
A wallet heading drew its title alone, or in a column with an error under it. When the error's four seconds ran out, the title moved back out of the column and was built afresh: a rename retried meanwhile lost its field, and with it what was typed. The heading is now always the one column, the error an optional line under the title. Found by n13's review of #770.
|
Thanks, both findings are valid and fixed. 1. [P2] Keep the draft before removing the inline editor (3a1ee7c)
2. [P2] Preserve the wallet editor when its error message expires (58a5ed2)
Desktop suite: 996 passing. |
n13
left a comment
There was a problem hiding this comment.
Verdict: Approve
Reviewer: GPT-6.1 Sol
Reviewed head 58a5ed2c58142e7b0a0b79fa30240de4a53e0cf1 against base f2008d07e773711abbea27c62dc87f1007995390.
Both prior findings are fixed: removing a focused editor now keeps its draft, and expiring a wallet error preserves the active editor and its text. Escape still cancels without writing. Account and wallet transitions, the menu-bar path, and the shared Get Info field behave consistently. No blocking findings remain.
Validation:
- The three focused suites (
account_management_providers_test.dart,account_menu_test.dart,account_info_sheet_test.dart) passed all 86 tests withtimeout 60 flutter test --no-pub ... --reporter expanded. - Eight additional temporary widget checks passed: wallet drafts when hiding the sidebar or switching wallets, account-to-wallet rename, Get Info closure with and without Escape, wallet cancellation, and app teardown with either editor focused.
- Workspace formatting and
git diff --checkpassed.
Limits: local Flutter is 3.44.4 versus pinned 3.47.7. Locked bootstrap rejected SDK-dependent lockfile versions; focused test dependencies were resolved offline within the isolated worktree. Workspace analysis was incomplete at the required 10-second limit. GitHub's macOS, Linux, and Windows desktop builds were still in progress when checked; dependency cooldown passed.
…rename # Conflicts: # desktop-app/lib/providers/account_management_providers.dart # desktop-app/lib/ui/accounts/account_info_sheet.dart # desktop-app/lib/ui/accounts/account_menu_entries.dart # desktop-app/lib/ui/shell/sidebar.dart # desktop-app/test/providers/account_management_providers_test.dart # desktop-app/test/ui/accounts/account_menu_test.dart # desktop-app/tool/screenshots_test.dart # wallet_core/lib/l10n/app_en.arb # wallet_core/lib/l10n/app_id.arb # wallet_core/lib/l10n/app_localizations.dart # wallet_core/lib/l10n/app_localizations_en.dart # wallet_core/lib/l10n/app_localizations_id.dart
What
desktopWalletRenameFailed(en, id).Shared code that changed
InlineNameField(new,ui/components/): the field Get Info's name row had, lifted out so Get Info and the sidebar share it. Get Info's tests are unchanged and pass.SidebarRowgets an optionaltitleEditor, drawn over the title's line so the rows below don't move.AccountManagergetsstartRename,startRenameWalletandrenameWallet.sidebarRenameProviderholds what is being renamed.account_menu_testchecks change with the new behaviour:Testing
account_rename_inlineandwallet_rename_inline.