tui: F7 becomes the node-setup screen, and F6 goes back to being the wallet #169
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/f7-node-setup"
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?
What this is
F7did not exist onmain, whilewallet.rs's not-configured error told users to"open F7" and
docs/TUI.mddocumented "There is noF7". The commit that built it(
a48d40b) was stranded: it was merged into a stacked branch (t_6aa61cf8) that neverreached
main, and its Forgejo branch was deleted mid-session. This PR lands it andfinishes the job.
Why the node could not be set up from the TUI
Not a missing screen — three places had part of the story and none had the write path:
F6's inline1/2/3picker wrote only the in-process Cuprate choice.F9menu showed child/sync state and named keys that edited it.Node::set_local_monerod,set_remote_daemonandset_receive_only— the only wayto point the app at a Monero node — had no TUI caller at all (Kotlin only).
What changed
F7is the node-setup screen (WalletSetupConfig), recovered and extended:datadirrow, new and editable.Node::set_local_monerod_at(bin, datadir, prune)isthe new entry point;
set_local_moneroddelegates with the derived$ONIONWIRE_HOME/chain/mainnet-*default so an existing install keeps its store. Anempty datadir is refused, not silently defaulted: a store that moves unasked looks
like a vanished chain and resyncs into a directory the user did not choose.
networkrow, new — it carries the Cuprate mainnet/testnet choiceF6's1/2/3used to own, so deleting those keys loses nothing. Mainnet reads
unvalidatedbeforeit is picked.
NODEsection draws the liveNode::wallet_child_statusline (state, chain source,sync h/tonce a daemon reports numbers, last error) plus the last save/test answer.The live row is the node's answer, never the draft above it;
Ctrl-Rre-reads it.Ctrl-Ssaves and starts the child (the daemon, andmonerodfor a local source);Ctrl-Xstops it. Both go through the sameNode::start_wallet_child/stop_wallet_childthe app's own lifecycle uses, so a start that lands on a walletfile with no stored passphrase still reaches the unlock prompt.
F6is the wallet again. The chain picker and thes/x/pchild keys are gone;the footer reads
c create i import r qr w wallets F7 node Esc back ? help.App::set_cuprate_chainand thepprobe handler are deleted rather than left dead.The
F9menu'schild/syncrows now nameF7 ctrl-s/xandF7 ctrl-r— the old rowsnamed keys that no longer work, which is how a dead shortcut keeps looking live.
The node's own keys are named in the body, on the section they act on: at 80 columns the
footer has room for one group and the status line already spends half the width. That is
the same reason the login row names
Ctrl-U.Evidence
cargo clippy --locked --all-targets -- -D warnings— exit 0, no warnings.cargo test --locked— 504 passed, 0 failed (this run predates twoformatting-only hunks; clippy and the tui targets were re-run after them, all green).
Six new cases in
src/tui.rs'swallet_setup_config_testsdrive the real key path andthe real node:
a_local_node_saves_the_datadir_the_user_typedChainSource::Localan_empty_datadir_is_refused_and_the_source_is_not_writtenthe_node_row_shows_the_live_state_on_openctrl_s_saves_then_reports_the_nodes_own_refusalCtrl-Ssaves first, then reports the node's wordsthe_in_process_network_is_still_selectablef6_no_longer_owns_the_chain_picker_or_the_child_keystests/tui_spec.rs's menu-key assertion moved to the F7 keys.rustfmt --edition 2024 --check src/tui.rsreports 24 hunks, the same count as atHEADbefore this change —the inherited churn is untouched.
Recovery note
The first commit on this branch is a
-xcherry-pick ofa48d40b, which appliescleanly; the merge did duplicate two
#[cfg(test)]helpers insrc/tui.rs(
key,flattened—mainand the F7 branch each added them), fixed in that samecommit with one helper of each kept.
Docs
README.mdno longer says "There is noF7" (twice: the key table and thetroubleshooting row).
docs/TUI.mdgets aNode & wallet setup (F7)section and anF6 section that is about the wallet.
docs/WALLET.mdmoves the child's start/stop tablefrom
F6toF7and documents thenetworkrow.docs/tui-wallet-ux-review.mdis adated review snapshot and is left as written.