tui: analyse the landed wallet + node features and ship a WALLETS & SETTINGS menu (F9) #118

Merged
sirius merged 3 commits from onionwire/t_8bb1bac9-onionwire-tui-analyze-landed-wallet-node into main 2026-09-19 02:41:39 +00:00
Owner

onionwire TUI: the landed wallet + node features analysed, and a WALLETS & SETTINGS menu (F9)

The Monero wallet and the cuprate node all landed, but the TUI only exposed them
through function keys. Nothing discoverable: a user who did not already know F6
opened the wallet could not find wallet setup, endpoint config, the child wallet
or the settings. This PR adds the analysis (Deliverable A) and one discoverable
screen (Deliverable B).

Key: F9 (also /settings). F7 is deliberately left free — the wallet
endpoint config screen that docs/WALLET.md and db208be call "the F7 screen"
ships on feat/wallet-create-import, and src/node.rs still names it F7.

Deliverable A — landed capability vs what the TUI can reach

Every symbol below was read in the working tree, not assumed; line numbers are
origin/main + this branch.

capability backend symbol (exact) reachable from the TUI today? how (key / screen / not at all)
endpoint config — read Node::wallet_config() -> Option<WalletConfig> (src/node.rs:728) no gap: F7 endpoint screen (other branch). This card shows the endpoint state only
endpoint config — save Node::wallet_save_config(cfg: &WalletConfig) -> Result<(), String> (741) no gap: F7 screen. Nothing here reads rpc_login, so nothing can render it
endpoint test-connection Node::wallet_test_connection(rpc_url, rpc_login) -> PingResult (718) no gap: F7 screen
child config — read Node::wallet_child_config() -> ChildConfig (555) read-only F6 wallet screen caveat line (App::wallet_child_screen_line); editing is not reachable
child config — write Node::set_wallet_child_config(cfg: &ChildConfig) -> Result<(), String> (568) no gap: no child-config editor anywhere
child status Node::wallet_child_status() -> WalletChildStatus (644) yes F6 wallet screen; F9 rows child and sync
child start / stop Node::start_wallet_child() (585), Node::stop_wallet_child() (623) yes F6 then s / x; F9 prints F6 s/x
child one-line status Node::wallet_child_line() -> String (677) yes F6 wallet screen
child probe (RPC + chain tip) Node::wallet_child_refresh() (684) yes F6 then p; F9 prints F6 p
wallet status snapshot Node::wallet_status() -> WalletStatus (515) no → yes (this card) F9 reads it for configured / connected / last_error
wallet probe Node::wallet_refresh() (524) indirect no key of its own; called by the pay/tip readiness guard (wallet_readiness, 539)
balance Node::wallet_balance() -> String (763) yes F6; F9 balance row
balance line (status field) Node::wallet_balance_line() (1025) no TUI uses wallet_balance(); left alone (Android/SDK caller)
receive address Node::wallet_receive_address() -> Result<String, String> (1006) yes F6 then r (QR modal); F9 receive row, and c copies it (new)
payment history — wallet side Node::wallet_recent_transfers(cap) (1048) yes F6 wallet screen (last 5, real); F9 payments row prints the count
payment history — peer table store.list_payments(friend_pk) (src/store.rs:953) no gap: no Node accessor exists. Needed: Node::list_payments(&self, friend_pk: &[u8]) -> Result<Vec<Payment>, String>. Not added — src/node.rs is out of scope for this card; sibling card filed
chain-readiness helpers none: no wallet_chain_* symbol exists on Node; Wallet::chain_ready() is private to the child refresh (src/node.rs:704) via child_status readiness shows up as WalletChildState::Ready / Syncing; F6 p probes, F9 sync row names the state in words
self profile — read Node::self_profile() -> Result<FriendProfile, String> (782) yes /profile editor; F9 nickname + profile rows
self profile — write Node::set_self_profile(display_name, bio, xmr_addr) (798) yes /profile (ProfileEditor)
profile push to a peer Node::push_self_profile(friend_pk) (812) yes profile save path
backup Node::write_backup(path, passphrase) (385) yes /backup /path → type BACKUP → passphrase; F9 prints /backup
restore Node::restore_backup(path, passphrase) (408) yes /restore /path → type RESTORE → passphrase; F9 prints /restore
wipe messages Node::wipe_messages() (774) yes /wipe → type WIPE; also Ctrl-Q → CLEAR. F9 prints /wipe
wipe all (identity too) WipeKind::All → AppExit::WipeAll (src/tui.rs:1682) yes /wipe-all → type WIPEALL. F9 prints /wipe-all
friends list Node::list_friends() -> Result<Vec<Friend>, String> (460) yes roster pane, Tab / 1 / j / k
petname write Node::set_petname(pubkey, petname: Option<&str>) (478) no gap: no petname editor exists in the TUI (grep: src/node.rs + store tests only). Sibling card filed
friend profile read Node::friend_profile(pubkey) (790) yes F5 /who overlay
pay readiness guard Node::wallet_readiness(is_tip) (539) yes /pay /tip refuse before dialing
pay / tip Node::pay_invoice (886), Node::tip (922) yes /pay <xmr> [memo], /tip <xmr> [memo]
invite / share Node::qr_payload() (380) yes F2; F9 identity row points at F2
rotate locator / prekey Node::rotate() (1120), Node::rotate_prekey() (1191) yes F4 / F8

Gaps, named: (1) the endpoint config screen (read/save/test) — in flight as
the F7 screen on another branch, not this card; (2) child-config editing
(set_wallet_child_config) — sibling card; (3) peer payment history
(store.list_payments) — needs a new Node method, named above, sibling card;
(4) petname editing (set_petname) — sibling card. No new backend field or
method was added by this PR, and no Node/store/session/pay file was touched.

Deliverable B — the WALLETS & SETTINGS menu

F9 / /settings, listed in help_overlay_text() and in
main_footer_hints(). One screen, never a popup, groups fixed in the card's
order. 19 rows at 80x24 against 21 inner rows — no clipping, no scrolling,
no scrollbar.

group row value key the row prints
WALLET endpoint configured · connected / configured · not connected / not configured · receive-only — (no screen yet, so no invented key)
WALLET child {chain source} · running / not started F6 s/x
WALLET sync chain at tip · wallet answering / wallet answering · chain not at tip / wallet RPC not answering yet / child exited / not probing · no chain source F6 p
WALLET receive the address (truncated) or no address yet · wallet unreachable c copy, F6 r
WALLET balance {xmr} / off / err F6
WALLET payments {n} recent / no transfers yet F6
WALLET create /wallet create · seed shown once F6 c
WALLET import /wallet import · 25-word seed F6 i
SETTINGS nickname the name, or (none) /profile
SETTINGS profile bio set · xmr set /profile
SETTINGS identity {fp}… · identity = pubkey F2
SETTINGS colour auto · follows NO_COLOR / TERM — (env-driven; no runtime toggle exists, so none is promised)
SETTINGS backup encrypted identity export /backup
SETTINGS restore overwrite self keys from a backup /restore
SETTINGS wipe messages · identity and friends stay /wipe
SETTINGS wipe-all deletes your identity key · new person /wipe-all

Guarantees the review should poke at:

  • Every named key is live on the screen. The function keys were handled
    inside the Screen::Main arm; they are now handled once, for Main and
    this screen, so F6 s/x / F2 / F5 work while the menu is open.
  • No credentials. WalletMenuState carries bools, labels and
    display-ready error strings from Node's getters. rpc_login, secret(), a
    seed and a passphrase have no field to travel in.
  • Untrusted values are display data. sanitize::display_text plus a
    newline/tab strip before a value reaches a row, then truncation with the
    chrome ellipsis — a multi-line or bidi-laden backend error cannot split a row
    or reorder it (asserted).
  • Cells, not chars. cell_width() measures with ratatui's own
    Span::width, so no unicode-width dependency was added and
    chars().count() is never used as a width. A double-width CJK name truncates
    at the right cell (asserted).
  • Copy without a clipboard crate. c writes the receive address as OSC 52
    (ESC ] 52 ; c ; <base64> BEL, ~30 lines of base64). The terminal owns the
    clipboard, the address never touches a file, and it survives SSH; a terminal
    that ignores OSC 52 simply does nothing and F6 r still shows the QR.
  • Colour is never the only signal. Every state word is present as a word
    (not connected, child exited, not probing, no transfers yet); the tone
    only answers "what is this?".
  • ASCII fallback. The section rule is ─, or - under ONIONWIRE_ASCII /
    NO_COLOR, alongside the existing ellipsis swap. No emoji.
  • F2/F3/F4/F5/F6/F8 all still work — nothing was removed. F9 and /settings
    are additions; /wipe and /wipe-all were added to the help overlay because
    the menu teaches them.

Evidence

$ cargo test --locked
... 33 test binaries, 356 passed; 0 failed; 1 ignored
$ cargo clippy --locked --all-targets -- -D warnings
Finished `dev` profile ... (no warnings)

New tests (all in tests/tui_spec.rs / tests/tui_chrome.rs; existing
assertions were extended, never rewritten):

  • wallets_settings_menu_lists_both_groups_and_every_key
  • wallets_settings_menu_never_renders_credentials
  • wallets_settings_menu_keeps_one_row_per_cell_even_with_hostile_values
  • wallets_settings_menu_words_every_state
  • wallets_settings_menu_truncates_wide_values_in_cells
  • wallets_settings_menu_fits_80x24_and_120x40
  • wallets_settings_menu_unconfigured_frame_is_not_a_blank_screen
  • wallets_settings_menu_frame_dumps
  • osc52_copy_sequence_is_a_base64_clipboard_write
  • slash_settings_is_the_menu
  • menu_key_is_listed_in_help_and_in_the_main_footer (tui_chrome.rs, needle
    lists extended with F9, /settings, /wipe-all)

Reproduce every frame below with:

cargo test --locked --test tui_spec -- --nocapture wallets_settings_menu_frame_dumps
cargo test --locked --test tui_spec -- --nocapture dump_spec_frames

WALLETS & SETTINGS — 80x24 (configured)

┌(o) wallets & settings────────────────────────────────────────────────────────┐
│WALLET ───────────────────────────────────────────────────────────────────────│
│  endpoint   configured · connected                                           │
│  child      local node · running                                       F6 s/x│
│  sync       chain at tip · wallet answering                              F6 p│
│  receive    4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgY… c copy  F6 r│
│  balance    0.250000000000                                                 F6│
│  payments   3 recent                                                       F6│
│  create     /wallet create · seed shown once                             F6 c│
│  import     /wallet import · 25-word seed                                F6 i│
│                                                                              │
│SETTINGS ─────────────────────────────────────────────────────────────────────│
│  nickname   lance                                                    /profile│
│  profile    bio set · xmr set                                        /profile│
│  identity   abcdef01… · identity = pubkey                                  F2│
│  colour     auto · follows NO_COLOR / TERM                                   │
│  backup     encrypted identity export                                 /backup│
│  restore    overwrite self keys from a backup                        /restore│
│  wipe       messages · identity and friends stay                        /wipe│
│  wipe-all   deletes your identity key · new person                  /wipe-all│
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘
TOR  me:abcdef01… onion:abcdefgh… Esc back c copy ? help                        

WALLETS & SETTINGS — 80x24 (unconfigured: the empty state names its way out)

┌(o) wallets & settings────────────────────────────────────────────────────────┐
│WALLET ───────────────────────────────────────────────────────────────────────│
│  endpoint   not configured · receive-only                                    │
│  child      receive-only · not started                                 F6 s/x│
│  sync       not probing · no chain source                                F6 p│
│  receive    no address yet · wallet unreachable                              │
│  balance    off                                                            F6│
│  payments   no transfers yet                                               F6│
│  create     /wallet create · seed shown once                             F6 c│
│  import     /wallet import · 25-word seed                                F6 i│
│                                                                              │
│SETTINGS ─────────────────────────────────────────────────────────────────────│
│  nickname   lance                                                    /profile│
│  profile    bio set · xmr set                                        /profile│
│  identity   abcdef01… · identity = pubkey                                  F2│
│  colour     auto · follows NO_COLOR / TERM                                   │
│  backup     encrypted identity export                                 /backup│
│  restore    overwrite self keys from a backup                        /restore│
│  wipe       messages · identity and friends stay                        /wipe│
│  wipe-all   deletes your identity key · new person                  /wipe-all│
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘
TOR  me:abcdef01… onion:abcdefgh… Esc back c copy ? help                        

WALLETS & SETTINGS — 120x40 (configured)

┌(o) wallets & settings────────────────────────────────────────────────────────────────────────────────────────────────┐
│WALLET ───────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│  endpoint   configured · connected                                                                                   │
│  child      local node · running                                                                               F6 s/x│
│  sync       chain at tip · wallet answering                                                                      F6 p│
│  receive    4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYJKUGVktfzxayGbMWaC8iqPUE9XUBFGrLyDz4Dp… c copy  F6 r│
│  balance    0.250000000000                                                                                         F6│
│  payments   3 recent                                                                                               F6│
│  create     /wallet create · seed shown once                                                                     F6 c│
│  import     /wallet import · 25-word seed                                                                        F6 i│
│                                                                                                                      │
│SETTINGS ─────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│  nickname   lance                                                                                            /profile│
│  profile    bio set · xmr set                                                                                /profile│
│  identity   abcdef01… · identity = pubkey                                                                          F2│
│  colour     auto · follows NO_COLOR / TERM                                                                           │
│  backup     encrypted identity export                                                                         /backup│
│  restore    overwrite self keys from a backup                                                                /restore│
│  wipe       messages · identity and friends stay                                                                /wipe│
│  wipe-all   deletes your identity key · new person                                                          /wipe-all│
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
TOR  me:abcdef01…  onion:abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion  Esc back c copy  ? help        

WALLETS & SETTINGS — 120x40 (unconfigured)

┌(o) wallets & settings────────────────────────────────────────────────────────────────────────────────────────────────┐
│WALLET ───────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│  endpoint   not configured · receive-only                                                                            │
│  child      receive-only · not started                                                                         F6 s/x│
│  sync       not probing · no chain source                                                                        F6 p│
│  receive    no address yet · wallet unreachable                                                                      │
│  balance    off                                                                                                    F6│
│  payments   no transfers yet                                                                                       F6│
│  create     /wallet create · seed shown once                                                                     F6 c│
│  import     /wallet import · 25-word seed                                                                        F6 i│
│                                                                                                                      │
│SETTINGS ─────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│  nickname   lance                                                                                            /profile│
│  profile    bio set · xmr set                                                                                /profile│
│  identity   abcdef01… · identity = pubkey                                                                          F2│
│  colour     auto · follows NO_COLOR / TERM                                                                           │
│  backup     encrypted identity export                                                                         /backup│
│  restore    overwrite self keys from a backup                                                                /restore│
│  wipe       messages · identity and friends stay                                                                /wipe│
│  wipe-all   deletes your identity key · new person                                                          /wipe-all│
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
│                                                                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
TOR  me:abcdef01…  onion:abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion  Esc back c copy  ? help        

WALLETS & SETTINGS — 200x60 (must not break; the full address fits)

┌(o) wallets & settings────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│WALLET ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│  endpoint   configured · connected                                                                                                                                                                   │
│  child      local node · running                                                                                                                                                               F6 s/x│
│  sync       chain at tip · wallet answering                                                                                                                                                      F6 p│
│  receive    4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYJKUGVktfzxayGbMWaC8iqPUE9XUBFGrLyDz4DpEBM                                                                               c copy  F6 r│
│  balance    0.250000000000                                                                                                                                                                         F6│
│  payments   3 recent                                                                                                                                                                               F6│
│  create     /wallet create · seed shown once                                                                                                                                                     F6 c│
│  import     /wallet import · 25-word seed                                                                                                                                                        F6 i│
│                                                                                                                                                                                                      │
│SETTINGS ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│  nickname   lance                                                                                                                                                                            /profile│
│  profile    bio set · xmr set                                                                                                                                                                /profile│
│  identity   abcdef01… · identity = pubkey                                                                                                                                                          F2│
│  colour     auto · follows NO_COLOR / TERM                                                                                                                                                           │
│  backup     encrypted identity export                                                                                                                                                         /backup│
│  restore    overwrite self keys from a backup                                                                                                                                                /restore│
│  wipe       messages · identity and friends stay                                                                                                                                                /wipe│
│  wipe-all   deletes your identity key · new person                                                                                                                                          /wipe-all│
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
│                                                                                                                                                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
TOR  me:abcdef01…  onion:abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion  Esc back c copy  ? help                                                                                        
onionwire  tor  me:abcdef01  onion:abcdefgh                                     
┌roster 0────────────┐┌  chat──────────────────────────────────────────────────┐
│alice  aaaaaaaa…    ││no friends yet                                          │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
└────────────────────┘└────────────────────────────────────────────────────────┘
> hello from composer                                                           
                                                                                
                                                                                
send failed: peer onion down TOR  me:abcdef01… onion:abcdefgh… F9 Ctrl-Q ? help 

Help overlay at 80x24 — F9 and /settings listed

┌? help────────────────────────────────────────────────────────────────────────┐
│F2                share invite                                                │
│F3                paste invite                                                │
│F4                rotate onion locator                                        │
│F5                selected friend's profile (/who)                            │
│F6                wallet (receive QR, create/import)                          │
│F8                rotate prekey                                               │
│F9                wallets & settings menu                                     │
│/profile          edit name, bio, Monero address                              │
│/pay <xmr> [memo] invoice to receive                                          │
│/tip <xmr> [memo] pay selected friend                                         │
│/wallet create    new spend wallet (seed shown once)                          │
│/wallet import    restore from existing seed                                  │
│/file /path        send file to selected friend (1 MiB)                       │
│/backup /path     encrypted identity export                                   │
│/restore /path    overwrite self keys                                         │
│/wipe             wipe messages; identity and friends stay                    │
│/wipe-all         wipe identity too — you become a new person                 │
│/settings         wallets & settings menu                                     │
│?                 this help                                                   │
│Ctrl-Q            quit; type CLEAR or QUIT                                    │
│                                                                              │
│Esc closes this overlay                                                       │
└──────────────────────────────────────────────────────────────────────────────┘

Out of scope, on purpose

src/node.rs, src/wallet.rs, src/wallet_child.rs, src/store.rs,
src/session.rs, src/pay.rs, src/dispatch.rs, crates/, android/,
docs/PROTOCOL.md and docs/WALLET.md are untouched — git diff --stat
touches only src/tui.rs, tests/tui_spec.rs, tests/tui_chrome.rs and
docs/TUI.md. Presentation only; no protocol, session, store or send-path
change. No new crate (base64 and the cell measurement are hand-rolled /
delegated to ratatui). No repo-wide cargo fmt.

# onionwire TUI: the landed wallet + node features analysed, and a WALLETS & SETTINGS menu (F9) The Monero wallet and the cuprate node all landed, but the TUI only exposed them through function keys. Nothing discoverable: a user who did not already know F6 opened the wallet could not find wallet setup, endpoint config, the child wallet or the settings. This PR adds the analysis (Deliverable A) and one discoverable screen (Deliverable B). **Key: `F9`** (also `/settings`). `F7` is deliberately left free — the wallet endpoint config screen that `docs/WALLET.md` and `db208be` call "the F7 screen" ships on `feat/wallet-create-import`, and `src/node.rs` still names it F7. ## Deliverable A — landed capability vs what the TUI can reach Every symbol below was read in the working tree, not assumed; line numbers are `origin/main` + this branch. | capability | backend symbol (exact) | reachable from the TUI today? | how (key / screen / not at all) | |---|---|---|---| | endpoint config — read | `Node::wallet_config() -> Option<WalletConfig>` (`src/node.rs:728`) | **no** | gap: F7 endpoint screen (other branch). This card shows the endpoint *state* only | | endpoint config — save | `Node::wallet_save_config(cfg: &WalletConfig) -> Result<(), String>` (`741`) | **no** | gap: F7 screen. Nothing here reads `rpc_login`, so nothing can render it | | endpoint test-connection | `Node::wallet_test_connection(rpc_url, rpc_login) -> PingResult` (`718`) | **no** | gap: F7 screen | | child config — read | `Node::wallet_child_config() -> ChildConfig` (`555`) | read-only | F6 wallet screen caveat line (`App::wallet_child_screen_line`); **editing is not reachable** | | child config — write | `Node::set_wallet_child_config(cfg: &ChildConfig) -> Result<(), String>` (`568`) | **no** | gap: no child-config editor anywhere | | child status | `Node::wallet_child_status() -> WalletChildStatus` (`644`) | yes | F6 wallet screen; F9 rows `child` and `sync` | | child start / stop | `Node::start_wallet_child()` (`585`), `Node::stop_wallet_child()` (`623`) | yes | F6 then `s` / `x`; F9 prints `F6 s/x` | | child one-line status | `Node::wallet_child_line() -> String` (`677`) | yes | F6 wallet screen | | child probe (RPC + chain tip) | `Node::wallet_child_refresh()` (`684`) | yes | F6 then `p`; F9 prints `F6 p` | | wallet status snapshot | `Node::wallet_status() -> WalletStatus` (`515`) | **no → yes (this card)** | F9 reads it for `configured` / `connected` / `last_error` | | wallet probe | `Node::wallet_refresh()` (`524`) | indirect | no key of its own; called by the pay/tip readiness guard (`wallet_readiness`, `539`) | | balance | `Node::wallet_balance() -> String` (`763`) | yes | F6; F9 `balance` row | | balance line (status field) | `Node::wallet_balance_line()` (`1025`) | no | TUI uses `wallet_balance()`; left alone (Android/SDK caller) | | receive address | `Node::wallet_receive_address() -> Result<String, String>` (`1006`) | yes | F6 then `r` (QR modal); F9 `receive` row, and `c` copies it (new) | | payment history — wallet side | `Node::wallet_recent_transfers(cap)` (`1048`) | yes | F6 wallet screen (last 5, real); F9 `payments` row prints the count | | payment history — peer table | `store.list_payments(friend_pk)` (`src/store.rs:953`) | **no** | **gap**: no `Node` accessor exists. Needed: `Node::list_payments(&self, friend_pk: &[u8]) -> Result<Vec<Payment>, String>`. Not added — `src/node.rs` is out of scope for this card; sibling card filed | | chain-readiness helpers | none: no `wallet_chain_*` symbol exists on `Node`; `Wallet::chain_ready()` is private to the child refresh (`src/node.rs:704`) | via `child_status` | readiness shows up as `WalletChildState::Ready` / `Syncing`; F6 `p` probes, F9 `sync` row names the state in words | | self profile — read | `Node::self_profile() -> Result<FriendProfile, String>` (`782`) | yes | `/profile` editor; F9 `nickname` + `profile` rows | | self profile — write | `Node::set_self_profile(display_name, bio, xmr_addr)` (`798`) | yes | `/profile` (`ProfileEditor`) | | profile push to a peer | `Node::push_self_profile(friend_pk)` (`812`) | yes | profile save path | | backup | `Node::write_backup(path, passphrase)` (`385`) | yes | `/backup /path` → type `BACKUP` → passphrase; F9 prints `/backup` | | restore | `Node::restore_backup(path, passphrase)` (`408`) | yes | `/restore /path` → type `RESTORE` → passphrase; F9 prints `/restore` | | wipe messages | `Node::wipe_messages()` (`774`) | yes | `/wipe` → type `WIPE`; also Ctrl-Q → `CLEAR`. F9 prints `/wipe` | | wipe all (identity too) | `WipeKind::All` → `AppExit::WipeAll` (`src/tui.rs:1682`) | yes | `/wipe-all` → type `WIPEALL`. F9 prints `/wipe-all` | | friends list | `Node::list_friends() -> Result<Vec<Friend>, String>` (`460`) | yes | roster pane, `Tab` / `1` / `j` / `k` | | petname write | `Node::set_petname(pubkey, petname: Option<&str>)` (`478`) | **no** | **gap**: no petname editor exists in the TUI (grep: `src/node.rs` + store tests only). Sibling card filed | | friend profile read | `Node::friend_profile(pubkey)` (`790`) | yes | F5 `/who` overlay | | pay readiness guard | `Node::wallet_readiness(is_tip)` (`539`) | yes | `/pay` `/tip` refuse before dialing | | pay / tip | `Node::pay_invoice` (`886`), `Node::tip` (`922`) | yes | `/pay <xmr> [memo]`, `/tip <xmr> [memo]` | | invite / share | `Node::qr_payload()` (`380`) | yes | F2; F9 `identity` row points at F2 | | rotate locator / prekey | `Node::rotate()` (`1120`), `Node::rotate_prekey()` (`1191`) | yes | F4 / F8 | **Gaps, named:** (1) the endpoint config screen (read/save/test) — in flight as the F7 screen on another branch, not this card; (2) child-config editing (`set_wallet_child_config`) — sibling card; (3) peer payment history (`store.list_payments`) — needs a new `Node` method, named above, sibling card; (4) petname editing (`set_petname`) — sibling card. No new backend field or method was added by this PR, and no `Node`/store/session/pay file was touched. ## Deliverable B — the WALLETS & SETTINGS menu `F9` / `/settings`, listed in `help_overlay_text()` and in `main_footer_hints()`. One screen, never a popup, groups fixed in the card's order. **19 rows at 80x24 against 21 inner rows** — no clipping, no scrolling, no scrollbar. | group | row | value | key the row prints | |---|---|---|---| | WALLET | endpoint | `configured · connected` / `configured · not connected` / `not configured · receive-only` | — (no screen yet, so no invented key) | | WALLET | child | `{chain source} · running` / `not started` | `F6 s/x` | | WALLET | sync | `chain at tip · wallet answering` / `wallet answering · chain not at tip` / `wallet RPC not answering yet` / `child exited` / `not probing · no chain source` | `F6 p` | | WALLET | receive | the address (truncated) or `no address yet · wallet unreachable` | `c copy`, `F6 r` | | WALLET | balance | `{xmr}` / `off` / `err` | `F6` | | WALLET | payments | `{n} recent` / `no transfers yet` | `F6` | | WALLET | create | `/wallet create · seed shown once` | `F6 c` | | WALLET | import | `/wallet import · 25-word seed` | `F6 i` | | SETTINGS | nickname | the name, or `(none)` | `/profile` | | SETTINGS | profile | `bio set · xmr set` | `/profile` | | SETTINGS | identity | `{fp}… · identity = pubkey` | `F2` | | SETTINGS | colour | `auto · follows NO_COLOR / TERM` | — (env-driven; no runtime toggle exists, so none is promised) | | SETTINGS | backup | `encrypted identity export` | `/backup` | | SETTINGS | restore | `overwrite self keys from a backup` | `/restore` | | SETTINGS | wipe | `messages · identity and friends stay` | `/wipe` | | SETTINGS | wipe-all | `deletes your identity key · new person` | `/wipe-all` | Guarantees the review should poke at: - **Every named key is live on the screen.** The function keys were handled inside the `Screen::Main` arm; they are now handled once, for `Main` *and* this screen, so `F6 s/x` / `F2` / `F5` work while the menu is open. - **No credentials.** `WalletMenuState` carries `bool`s, labels and display-ready error strings from `Node`'s getters. `rpc_login`, `secret()`, a seed and a passphrase have no field to travel in. - **Untrusted values are display data.** `sanitize::display_text` plus a newline/tab strip before a value reaches a row, then truncation with the chrome ellipsis — a multi-line or bidi-laden backend error cannot split a row or reorder it (asserted). - **Cells, not chars.** `cell_width()` measures with ratatui's own `Span::width`, so no `unicode-width` dependency was added and `chars().count()` is never used as a width. A double-width CJK name truncates at the right cell (asserted). - **Copy without a clipboard crate.** `c` writes the receive address as OSC 52 (`ESC ] 52 ; c ; <base64> BEL`, ~30 lines of base64). The terminal owns the clipboard, the address never touches a file, and it survives SSH; a terminal that ignores OSC 52 simply does nothing and `F6 r` still shows the QR. - **Colour is never the only signal.** Every state word is present as a word (`not connected`, `child exited`, `not probing`, `no transfers yet`); the tone only answers "what is this?". - **ASCII fallback.** The section rule is `─`, or `-` under `ONIONWIRE_ASCII` / `NO_COLOR`, alongside the existing ellipsis swap. No emoji. - **F2/F3/F4/F5/F6/F8 all still work** — nothing was removed. F9 and `/settings` are additions; `/wipe` and `/wipe-all` were added to the help overlay because the menu teaches them. ## Evidence ``` $ cargo test --locked ... 33 test binaries, 356 passed; 0 failed; 1 ignored $ cargo clippy --locked --all-targets -- -D warnings Finished `dev` profile ... (no warnings) ``` New tests (all in `tests/tui_spec.rs` / `tests/tui_chrome.rs`; existing assertions were extended, never rewritten): - `wallets_settings_menu_lists_both_groups_and_every_key` - `wallets_settings_menu_never_renders_credentials` - `wallets_settings_menu_keeps_one_row_per_cell_even_with_hostile_values` - `wallets_settings_menu_words_every_state` - `wallets_settings_menu_truncates_wide_values_in_cells` - `wallets_settings_menu_fits_80x24_and_120x40` - `wallets_settings_menu_unconfigured_frame_is_not_a_blank_screen` - `wallets_settings_menu_frame_dumps` - `osc52_copy_sequence_is_a_base64_clipboard_write` - `slash_settings_is_the_menu` - `menu_key_is_listed_in_help_and_in_the_main_footer` (`tui_chrome.rs`, needle lists extended with `F9`, `/settings`, `/wipe-all`) Reproduce every frame below with: ``` cargo test --locked --test tui_spec -- --nocapture wallets_settings_menu_frame_dumps cargo test --locked --test tui_spec -- --nocapture dump_spec_frames ``` ### WALLETS & SETTINGS — 80x24 (configured) ``` ┌(o) wallets & settings────────────────────────────────────────────────────────┐ │WALLET ───────────────────────────────────────────────────────────────────────│ │ endpoint configured · connected │ │ child local node · running F6 s/x│ │ sync chain at tip · wallet answering F6 p│ │ receive 4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgY… c copy F6 r│ │ balance 0.250000000000 F6│ │ payments 3 recent F6│ │ create /wallet create · seed shown once F6 c│ │ import /wallet import · 25-word seed F6 i│ │ │ │SETTINGS ─────────────────────────────────────────────────────────────────────│ │ nickname lance /profile│ │ profile bio set · xmr set /profile│ │ identity abcdef01… · identity = pubkey F2│ │ colour auto · follows NO_COLOR / TERM │ │ backup encrypted identity export /backup│ │ restore overwrite self keys from a backup /restore│ │ wipe messages · identity and friends stay /wipe│ │ wipe-all deletes your identity key · new person /wipe-all│ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ TOR me:abcdef01… onion:abcdefgh… Esc back c copy ? help ``` ### WALLETS & SETTINGS — 80x24 (unconfigured: the empty state names its way out) ``` ┌(o) wallets & settings────────────────────────────────────────────────────────┐ │WALLET ───────────────────────────────────────────────────────────────────────│ │ endpoint not configured · receive-only │ │ child receive-only · not started F6 s/x│ │ sync not probing · no chain source F6 p│ │ receive no address yet · wallet unreachable │ │ balance off F6│ │ payments no transfers yet F6│ │ create /wallet create · seed shown once F6 c│ │ import /wallet import · 25-word seed F6 i│ │ │ │SETTINGS ─────────────────────────────────────────────────────────────────────│ │ nickname lance /profile│ │ profile bio set · xmr set /profile│ │ identity abcdef01… · identity = pubkey F2│ │ colour auto · follows NO_COLOR / TERM │ │ backup encrypted identity export /backup│ │ restore overwrite self keys from a backup /restore│ │ wipe messages · identity and friends stay /wipe│ │ wipe-all deletes your identity key · new person /wipe-all│ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ TOR me:abcdef01… onion:abcdefgh… Esc back c copy ? help ``` ### WALLETS & SETTINGS — 120x40 (configured) ``` ┌(o) wallets & settings────────────────────────────────────────────────────────────────────────────────────────────────┐ │WALLET ───────────────────────────────────────────────────────────────────────────────────────────────────────────────│ │ endpoint configured · connected │ │ child local node · running F6 s/x│ │ sync chain at tip · wallet answering F6 p│ │ receive 4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYJKUGVktfzxayGbMWaC8iqPUE9XUBFGrLyDz4Dp… c copy F6 r│ │ balance 0.250000000000 F6│ │ payments 3 recent F6│ │ create /wallet create · seed shown once F6 c│ │ import /wallet import · 25-word seed F6 i│ │ │ │SETTINGS ─────────────────────────────────────────────────────────────────────────────────────────────────────────────│ │ nickname lance /profile│ │ profile bio set · xmr set /profile│ │ identity abcdef01… · identity = pubkey F2│ │ colour auto · follows NO_COLOR / TERM │ │ backup encrypted identity export /backup│ │ restore overwrite self keys from a backup /restore│ │ wipe messages · identity and friends stay /wipe│ │ wipe-all deletes your identity key · new person /wipe-all│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ TOR me:abcdef01… onion:abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion Esc back c copy ? help ``` ### WALLETS & SETTINGS — 120x40 (unconfigured) ``` ┌(o) wallets & settings────────────────────────────────────────────────────────────────────────────────────────────────┐ │WALLET ───────────────────────────────────────────────────────────────────────────────────────────────────────────────│ │ endpoint not configured · receive-only │ │ child receive-only · not started F6 s/x│ │ sync not probing · no chain source F6 p│ │ receive no address yet · wallet unreachable │ │ balance off F6│ │ payments no transfers yet F6│ │ create /wallet create · seed shown once F6 c│ │ import /wallet import · 25-word seed F6 i│ │ │ │SETTINGS ─────────────────────────────────────────────────────────────────────────────────────────────────────────────│ │ nickname lance /profile│ │ profile bio set · xmr set /profile│ │ identity abcdef01… · identity = pubkey F2│ │ colour auto · follows NO_COLOR / TERM │ │ backup encrypted identity export /backup│ │ restore overwrite self keys from a backup /restore│ │ wipe messages · identity and friends stay /wipe│ │ wipe-all deletes your identity key · new person /wipe-all│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ TOR me:abcdef01… onion:abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion Esc back c copy ? help ``` ### WALLETS & SETTINGS — 200x60 (must not break; the full address fits) ``` ┌(o) wallets & settings────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │WALLET ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│ │ endpoint configured · connected │ │ child local node · running F6 s/x│ │ sync chain at tip · wallet answering F6 p│ │ receive 4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYJKUGVktfzxayGbMWaC8iqPUE9XUBFGrLyDz4DpEBM c copy F6 r│ │ balance 0.250000000000 F6│ │ payments 3 recent F6│ │ create /wallet create · seed shown once F6 c│ │ import /wallet import · 25-word seed F6 i│ │ │ │SETTINGS ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│ │ nickname lance /profile│ │ profile bio set · xmr set /profile│ │ identity abcdef01… · identity = pubkey F2│ │ colour auto · follows NO_COLOR / TERM │ │ backup encrypted identity export /backup│ │ restore overwrite self keys from a backup /restore│ │ wipe messages · identity and friends stay /wipe│ │ wipe-all deletes your identity key · new person /wipe-all│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ TOR me:abcdef01… onion:abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion Esc back c copy ? help ``` ### Main screen at 80x24 — `F9` in the footer ``` onionwire tor me:abcdef01 onion:abcdefgh ┌roster 0────────────┐┌ chat──────────────────────────────────────────────────┐ │alice aaaaaaaa… ││no friends yet │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ └────────────────────┘└────────────────────────────────────────────────────────┘ > hello from composer send failed: peer onion down TOR me:abcdef01… onion:abcdefgh… F9 Ctrl-Q ? help ``` ### Help overlay at 80x24 — `F9` and `/settings` listed ``` ┌? help────────────────────────────────────────────────────────────────────────┐ │F2 share invite │ │F3 paste invite │ │F4 rotate onion locator │ │F5 selected friend's profile (/who) │ │F6 wallet (receive QR, create/import) │ │F8 rotate prekey │ │F9 wallets & settings menu │ │/profile edit name, bio, Monero address │ │/pay <xmr> [memo] invoice to receive │ │/tip <xmr> [memo] pay selected friend │ │/wallet create new spend wallet (seed shown once) │ │/wallet import restore from existing seed │ │/file /path send file to selected friend (1 MiB) │ │/backup /path encrypted identity export │ │/restore /path overwrite self keys │ │/wipe wipe messages; identity and friends stay │ │/wipe-all wipe identity too — you become a new person │ │/settings wallets & settings menu │ │? this help │ │Ctrl-Q quit; type CLEAR or QUIT │ │ │ │Esc closes this overlay │ └──────────────────────────────────────────────────────────────────────────────┘ ``` ## Out of scope, on purpose `src/node.rs`, `src/wallet.rs`, `src/wallet_child.rs`, `src/store.rs`, `src/session.rs`, `src/pay.rs`, `src/dispatch.rs`, `crates/`, `android/`, `docs/PROTOCOL.md` and `docs/WALLET.md` are untouched — `git diff --stat` touches only `src/tui.rs`, `tests/tui_spec.rs`, `tests/tui_chrome.rs` and `docs/TUI.md`. Presentation only; no protocol, session, store or send-path change. No new crate (base64 and the cell measurement are hand-rolled / delegated to ratatui). No repo-wide `cargo fmt`.
tui: WALLETS and SETTINGS menu (F9 / /settings) over the landed wallet + node features
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
ci / fuzz (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
0131803f9c
The Monero wallet and the cuprate node shipped behind function keys only, so a
user who did not already know F6 opened the wallet could not find wallet setup,
the child wallet, the chain source or the settings.

F9 (also /settings) now opens one discoverable screen with the two groups the
card fixes: WALLET (endpoint, child, sync, receive, balance, payments, create,
import) then SETTINGS (nickname, profile, identity, colour, backup, restore,
wipe, wipe-all). Every actionable row prints the key or command that fires it,
including the F6 wallet screen's own keys, and those keys stay live on the
screen so no row can name a dead key.

- Screen, not popup: 19 rows at 80x24 against 21 inner rows; 120x40 and 200x60
  hold. The footer is the shared status_footer, so TOR / identity / ? help stay
  put.
- No credentials: WalletMenuState carries booleans, labels and display-ready
  error strings only. rpc_login, secret(), seeds and passphrases have no field
  to travel in.
- Untrusted values are display data: sanitize + newline/tab strip, then
  truncated in cells.
- Cells, not chars: cell_width() measures through ratatui's own Span::width, so
  no unicode-width dependency was added and chars().count() is never a width.
- Copy without a clipboard crate: c writes the receive address as an OSC 52
  sequence; the terminal owns the clipboard and it survives SSH.
- Colour is never the only signal: every state also spells itself out.
- F7 stays free for the endpoint config screen that names it (db208be,
  docs/WALLET.md).

F2/F3/F4/F5/F6/F8 keep working: the function keys are now handled once, for Main
and this screen, instead of inside the Main arm.
ci: re-trigger the checks (the first attempt was cancelled by the runner, no code change)
Some checks failed
ci / test (pull_request) Successful in 5m43s
ci / sdk (pull_request) Successful in 1m36s
ci / fuzz (pull_request) Has been cancelled
android-ci / android (pull_request) Has been cancelled
3b44cb0faf
Merge branch 'main' into onionwire/t_8bb1bac9-onionwire-tui-analyze-landed-wallet-node
Some checks failed
ci / sdk (pull_request) Has been cancelled
ci / fuzz (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
android-ci / android (pull_request) Has been cancelled
b99d96a145
sirius merged commit 14f9284463 into main 2026-09-19 02:41:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!118
No description provided.