Wallet selector: distinguish loaded wallets and sort alphabetically #698

Closed
opened 2026-05-14 18:34:22 +00:00 by johnny9 · 1 comment
johnny9 commented 2026-05-14 18:34:22 +00:00 (Migrated from github.com)

Summary

Make the wallet selector easier to use when a node has many wallets, especially regtest wallets, by having WalletListModel distinguish loaded wallets from wallets that are only present on disk and by presenting the list alphabetically.

Parent: #577

Problem

WalletListModel currently exposes wallet name and format roles and appends entries in the order returned by walletLoader().listWalletDir(). When there are many regtest wallets, the selector does not make it obvious which wallets are already loaded versus only available to load, and finding a specific wallet is non-trivial because the list is not sorted for scanning.

Work Needed

  • Extend WalletListModel with a role that identifies whether each wallet is loaded/open or not loaded.
  • Update the wallet selector UI to make loaded and unloaded wallets visually distinct without making selection harder.
  • Sort wallet rows alphabetically by display name using deterministic, case-insensitive ordering.
  • Keep row state current when wallets are loaded, selected, closed, or discovered on disk.
  • Preserve behavior for duplicate names, wallet paths, and formats if the backend exposes ambiguous entries.

Acceptance Criteria

  1. Wallets are shown in deterministic alphabetical order in the selector.
  2. Loaded/open wallets are distinguishable from unloaded/on-disk wallets in the selector.
  3. Loading, selecting, and closing wallets updates the visible state without stale rows or lost selection.
  4. Tests cover mixed loaded/unloaded wallets and alphabetical sorting.

Test Guidance

  • Add focused C++ coverage for WalletListModel sorting and loaded-state roles.
  • Add or update QML/Python coverage for the wallet selector rendering mixed wallet states if existing test hooks support it.
## Summary Make the wallet selector easier to use when a node has many wallets, especially regtest wallets, by having `WalletListModel` distinguish loaded wallets from wallets that are only present on disk and by presenting the list alphabetically. Parent: #577 ## Problem `WalletListModel` currently exposes wallet `name` and `format` roles and appends entries in the order returned by `walletLoader().listWalletDir()`. When there are many regtest wallets, the selector does not make it obvious which wallets are already loaded versus only available to load, and finding a specific wallet is non-trivial because the list is not sorted for scanning. ## Work Needed - Extend `WalletListModel` with a role that identifies whether each wallet is loaded/open or not loaded. - Update the wallet selector UI to make loaded and unloaded wallets visually distinct without making selection harder. - Sort wallet rows alphabetically by display name using deterministic, case-insensitive ordering. - Keep row state current when wallets are loaded, selected, closed, or discovered on disk. - Preserve behavior for duplicate names, wallet paths, and formats if the backend exposes ambiguous entries. ## Acceptance Criteria 1. Wallets are shown in deterministic alphabetical order in the selector. 2. Loaded/open wallets are distinguishable from unloaded/on-disk wallets in the selector. 3. Loading, selecting, and closing wallets updates the visible state without stale rows or lost selection. 4. Tests cover mixed loaded/unloaded wallets and alphabetical sorting. ## Test Guidance - Add focused C++ coverage for `WalletListModel` sorting and loaded-state roles. - Add or update QML/Python coverage for the wallet selector rendering mixed wallet states if existing test hooks support it.
johnny9 commented 2026-05-14 19:54:25 +00:00 (Migrated from github.com)

Will add to current close wallet work as it is closely related

Will add to current close wallet work as it is closely related
Sign in to join this conversation.
No description provided.