tui: analyse the landed wallet + node features and ship a WALLETS & SETTINGS menu (F9) #118
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/t_8bb1bac9-onionwire-tui-analyze-landed-wallet-node"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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).F7is deliberately left free — the walletendpoint config screen that
docs/WALLET.mdanddb208becall "the F7 screen"ships on
feat/wallet-create-import, andsrc/node.rsstill 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.Node::wallet_config() -> Option<WalletConfig>(src/node.rs:728)Node::wallet_save_config(cfg: &WalletConfig) -> Result<(), String>(741)rpc_login, so nothing can render itNode::wallet_test_connection(rpc_url, rpc_login) -> PingResult(718)Node::wallet_child_config() -> ChildConfig(555)App::wallet_child_screen_line); editing is not reachableNode::set_wallet_child_config(cfg: &ChildConfig) -> Result<(), String>(568)Node::wallet_child_status() -> WalletChildStatus(644)childandsyncNode::start_wallet_child()(585),Node::stop_wallet_child()(623)s/x; F9 printsF6 s/xNode::wallet_child_line() -> String(677)Node::wallet_child_refresh()(684)p; F9 printsF6 pNode::wallet_status() -> WalletStatus(515)configured/connected/last_errorNode::wallet_refresh()(524)wallet_readiness,539)Node::wallet_balance() -> String(763)balancerowNode::wallet_balance_line()(1025)wallet_balance(); left alone (Android/SDK caller)Node::wallet_receive_address() -> Result<String, String>(1006)r(QR modal); F9receiverow, andccopies it (new)Node::wallet_recent_transfers(cap)(1048)paymentsrow prints the countstore.list_payments(friend_pk)(src/store.rs:953)Nodeaccessor exists. Needed:Node::list_payments(&self, friend_pk: &[u8]) -> Result<Vec<Payment>, String>. Not added —src/node.rsis out of scope for this card; sibling card filedwallet_chain_*symbol exists onNode;Wallet::chain_ready()is private to the child refresh (src/node.rs:704)child_statusWalletChildState::Ready/Syncing; F6pprobes, F9syncrow names the state in wordsNode::self_profile() -> Result<FriendProfile, String>(782)/profileeditor; F9nickname+profilerowsNode::set_self_profile(display_name, bio, xmr_addr)(798)/profile(ProfileEditor)Node::push_self_profile(friend_pk)(812)Node::write_backup(path, passphrase)(385)/backup /path→ typeBACKUP→ passphrase; F9 prints/backupNode::restore_backup(path, passphrase)(408)/restore /path→ typeRESTORE→ passphrase; F9 prints/restoreNode::wipe_messages()(774)/wipe→ typeWIPE; also Ctrl-Q →CLEAR. F9 prints/wipeWipeKind::All→AppExit::WipeAll(src/tui.rs:1682)/wipe-all→ typeWIPEALL. F9 prints/wipe-allNode::list_friends() -> Result<Vec<Friend>, String>(460)Tab/1/j/kNode::set_petname(pubkey, petname: Option<&str>)(478)src/node.rs+ store tests only). Sibling card filedNode::friend_profile(pubkey)(790)/whooverlayNode::wallet_readiness(is_tip)(539)/pay/tiprefuse before dialingNode::pay_invoice(886),Node::tip(922)/pay <xmr> [memo],/tip <xmr> [memo]Node::qr_payload()(380)identityrow points at F2Node::rotate()(1120),Node::rotate_prekey()(1191)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 newNodemethod, named above, sibling card;(4) petname editing (
set_petname) — sibling card. No new backend field ormethod was added by this PR, and no
Node/store/session/pay file was touched.Deliverable B — the WALLETS & SETTINGS menu
F9//settings, listed inhelp_overlay_text()and inmain_footer_hints(). One screen, never a popup, groups fixed in the card'sorder. 19 rows at 80x24 against 21 inner rows — no clipping, no scrolling,
no scrollbar.
configured · connected/configured · not connected/not configured · receive-only{chain source} · running/not startedF6 s/xchain at tip · wallet answering/wallet answering · chain not at tip/wallet RPC not answering yet/child exited/not probing · no chain sourceF6 pno address yet · wallet unreachablec copy,F6 r{xmr}/off/errF6{n} recent/no transfers yetF6/wallet create · seed shown onceF6 c/wallet import · 25-word seedF6 i(none)/profilebio set · xmr set/profile{fp}… · identity = pubkeyF2auto · follows NO_COLOR / TERMencrypted identity export/backupoverwrite self keys from a backup/restoremessages · identity and friends stay/wipedeletes your identity key · new person/wipe-allGuarantees the review should poke at:
inside the
Screen::Mainarm; they are now handled once, forMainandthis screen, so
F6 s/x/F2/F5work while the menu is open.WalletMenuStatecarriesbools, labels anddisplay-ready error strings from
Node's getters.rpc_login,secret(), aseed and a passphrase have no field to travel in.
sanitize::display_textplus anewline/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).
cell_width()measures with ratatui's ownSpan::width, so nounicode-widthdependency was added andchars().count()is never used as a width. A double-width CJK name truncatesat the right cell (asserted).
cwrites the receive address as OSC 52(
ESC ] 52 ; c ; <base64> BEL, ~30 lines of base64). The terminal owns theclipboard, the address never touches a file, and it survives SSH; a terminal
that ignores OSC 52 simply does nothing and
F6 rstill shows the QR.(
not connected,child exited,not probing,no transfers yet); the toneonly answers "what is this?".
─, or-underONIONWIRE_ASCII/NO_COLOR, alongside the existing ellipsis swap. No emoji./settingsare additions;
/wipeand/wipe-allwere added to the help overlay becausethe menu teaches them.
Evidence
New tests (all in
tests/tui_spec.rs/tests/tui_chrome.rs; existingassertions were extended, never rewritten):
wallets_settings_menu_lists_both_groups_and_every_keywallets_settings_menu_never_renders_credentialswallets_settings_menu_keeps_one_row_per_cell_even_with_hostile_valueswallets_settings_menu_words_every_statewallets_settings_menu_truncates_wide_values_in_cellswallets_settings_menu_fits_80x24_and_120x40wallets_settings_menu_unconfigured_frame_is_not_a_blank_screenwallets_settings_menu_frame_dumpsosc52_copy_sequence_is_a_base64_clipboard_writeslash_settings_is_the_menumenu_key_is_listed_in_help_and_in_the_main_footer(tui_chrome.rs, needlelists extended with
F9,/settings,/wipe-all)Reproduce every frame below with:
WALLETS & SETTINGS — 80x24 (configured)
WALLETS & SETTINGS — 80x24 (unconfigured: the empty state names its way out)
WALLETS & SETTINGS — 120x40 (configured)
WALLETS & SETTINGS — 120x40 (unconfigured)
WALLETS & SETTINGS — 200x60 (must not break; the full address fits)
Main screen at 80x24 —
F9in the footerHelp overlay at 80x24 —
F9and/settingslistedOut 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.mdanddocs/WALLET.mdare untouched —git diff --stattouches only
src/tui.rs,tests/tui_spec.rs,tests/tui_chrome.rsanddocs/TUI.md. Presentation only; no protocol, session, store or send-pathchange. No new crate (base64 and the cell measurement are hand-rolled /
delegated to ratatui). No repo-wide
cargo fmt.