Skip to content

Desktop: rename an account or a wallet in the sidebar - #770

Merged
dewabisma merged 24 commits into
mainfrom
beast/desktop-inline-rename
Nov 21, 2026
Merged

dewabisma merged 24 commits into
mainfrom
beast/desktop-inline-rename

Conversation

@dewabisma

@dewabisma dewabisma commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Renaming an account in the sidebar. Rename… on an account row's menu turns its name into a field, with the name selected. So does the menu bar's Account › Rename… while the sidebar shows.
    • Return or clicking away keeps the name, and Escape puts the old one back.
    • A blank name, or one that fails to save, is not kept. The row says why in ember, in its balance's place, for 4 s (the same in-place note as Copy).
    • With the sidebar hidden, Rename… opens Get Info on the name, as before.
    • A click on the row while typing ends the typing; it doesn't switch account.
  • Renaming a wallet. Every wallet heading, the Cold Wallet's included, offers Rename…, as on the phone.
    • A blank name clears the wallet's own name, so it's called "Wallet N" again.
    • The name it's shown by, left unchanged, writes nothing.
    • A name that fails to save is reported under the heading.
  • New string: 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.
  • SidebarRow gets an optional titleEditor, drawn over the title's line so the rows below don't move.
  • AccountManager gets startRename, startRenameWallet and renameWallet. sidebarRenameProvider holds what is being renamed.
  • Three existing account_menu_test checks change with the new behaviour:
    • a software wallet heading now offers Rename… before Show Recovery Phrase…;
    • a Cold Wallet heading offers Rename… (it had no menu);
    • Rename… on a row opens the field instead of Get Info.

Testing

  • Desktop: 996 passing. wallet_core: 214.
  • New screenshot scenes, looked at: account_rename_inline and wallet_rename_inline.

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
@dewabisma
dewabisma requested a review from n13 November 20, 2026 16:58
…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 n13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Request changes
Reviewer: GPT-6.1 Sol

Reviewed head 1f93e4cdcdf3f51380ba888f7e840f67ed92ee20 against base e1af121a88bc519bcab8453337c84dd0872cd5ff.

  1. [P2] Keep the draft before removing the inline editor — desktop-app/lib/ui/components/inline_name_field.dart:68–81, with target replacement at account_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, typing Rainy day, then invoking the native Account → Rename callback for Main: Savings remains Savings. View → Hide Sidebar also discards the draft. Both sequences reproduce for wallet drafts as well (Trading desk remains 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.

  2. [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 with title. 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 types Recovered name during the retry observes Wallet 2 immediately 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.

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.
@dewabisma

Copy link
Copy Markdown
Collaborator Author

Thanks, both findings are valid and fixed.

1. [P2] Keep the draft before removing the inline editor (3a1ee7c)

  • InlineNameField now keeps what was typed when it's taken away while being typed in, not only when it loses the focus. That covers another rename started from the menu bar and View › Hide Sidebar, for accounts and wallets alike. Escape still keeps nothing.
  • The keep runs just after the field is taken down, since the tree is locked during unmount.
  • The keepers in the sidebar and Get Info hold the AccountManager and notifiers they use rather than reading through a widget's ref, which may be gone by then. Once the app's providers are gone too, as when the window closes, they keep nothing.
  • Get Info's name field shares this: closing the sheet with ⌘W while typing now keeps the name.
  • Tests:
    • starting another rename from the menu bar keeps the first;
    • hiding the sidebar keeps it;
    • a wallet name is kept when another rename starts;
    • Escape, then hiding the sidebar, still writes nothing.

2. [P2] Preserve the wallet editor when its error message expires (58a5ed2)

  • The heading is now always one Column, with the error as an optional line under the title, so the title and its field keep their place when the error comes or goes.
  • Since fix 1 this mattered more: replacing the field would have kept a half-typed name.
  • Test: a rename retried while the failure still shows keeps its field, focused and holding Recovered name, after the message expires, and writes nothing.

Desktop suite: 996 passing.

@dewabisma
dewabisma requested a review from n13 November 20, 2026 17:33

@n13 n13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with timeout 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 --check passed.

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.

Base automatically changed from beast/desktop-accounts to main November 21, 2026 02:37
…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
@dewabisma
dewabisma merged commit bc6b715 into main Nov 21, 2026
6 checks passed
@dewabisma
dewabisma deleted the beast/desktop-inline-rename branch November 21, 2026 03:15
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