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

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.
This commit is contained in:
agent 2026-09-18 22:26:57 -04:00
commit 0131803f9c
No known key found for this signature in database
4 changed files with 1058 additions and 16 deletions

View file

@ -47,6 +47,7 @@ fn help_overlay_lists_core_bindings() {
"F5",
"F6",
"F8",
"F9",
"send chat",
"/profile",
"/pay",
@ -56,6 +57,8 @@ fn help_overlay_lists_core_bindings() {
"/file",
"/backup",
"/restore",
"/wipe-all",
"/settings",
"Ctrl-Q",
"?",
] {
@ -175,6 +178,35 @@ fn pane_focus_cycles_roster_chat_composer() {
assert_eq!(Pane::Composer.prev(), Pane::Chat);
}
#[test]
fn menu_key_is_listed_in_help_and_in_the_main_footer() {
// Discoverability: the WALLETS & SETTINGS menu has to be findable from the
// help overlay *and* from the main footer, or F9 is a secret.
let help = help_overlay_text();
assert!(help.contains("F9"), "F9 missing from help:\n{help}");
assert!(
help.contains("/settings"),
"/settings missing from help:\n{help}"
);
let hints = main_footer_hints();
assert!(
hints.contains("F9"),
"F9 missing from footer hints: {hints:?}"
);
let fp = "abcdef0123456789deadbeef";
let onion = "abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion";
for w in [80u16, 120, 200] {
let line = status_footer(w, fp, onion, None, hints);
assert!(line.contains("F9"), "F9 dropped at {w}: {line:?}");
assert!(line.contains("? help"), "? help dropped at {w}: {line:?}");
assert!(line.contains("TOR"), "TOR dropped at {w}: {line:?}");
assert!(
line.chars().count() <= w as usize,
"footer wider than {w}: {line:?}"
);
}
}
#[test]
fn restore_terminal_is_callable_without_panic() {
onionwire::tui::restore_terminal();