tui: F7 wallet setup — configure the wallet RPC endpoint and chain source in-app #165

Owner

F7: wallet setup — the RPC endpoint and the chain source, on screen

Implements kanban t_00c81aa6. Stacked on the parent branch
onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o (base verified through the API below).

wallet::NOT_CONFIGURED_MSG has always read "wallet not configured — open F7 to set
it up, or set ONIONWIRE_WALLET_RPC"
, and there was no F7. This makes the copy true.

What landed

src/tui.rs

  • FunctionKey::Setup bound to F7, live on Main, WalletsSettings and
    PeerPayments — the same never-no-op invariant F9 follows.
  • Screen::WalletSetupConfig { state } holding WalletSetupConfigState: a snapshot of
    plain data taken once when the screen opens (Node::wallet_config +
    Node::wallet_child_config), never a handle onto Node, so a repaint cannot re-read
    the store mid-frame.
  • Rows: url, login, view-only, chain, daemon, monerod, prune.
    Tab/Shift-Tab move, space toggles/cycles, Enter saves, Ctrl-T tests,
    Ctrl-U clears the focused field, Esc leaves.
  • The login is never rendered back (the row reads hidden · set / (none)), never
    reaches the status row or a PingResult::line(), and Debug for the state is written
    by hand to redact it.
  • Ctrl-T calls Node::wallet_test_connection and shows the sanitized line. Saving
    never dials.
  • The chain picker covers all four ChainSource cases. An untouched chain row is
    not written, so opening F7 to fix a port cannot silently undo F6's in-process
    choice. Picking a remote daemon prints one line, in the project's voice, at the moment
    the user takes on that trust: a daemon you do not run sees this wallet's chain traffic.
  • The endpoint row of the F9 menu now names F7, the key that edits it.
  • Footer: F7 added to main_footer_hints and to the three pane_footer_hints arms.

src/node.rs — three setters mirroring set_in_process_cuprate, each building on
self.wallet_child_config() and persisting through set_wallet_child_config, so
wallet_child.rs's validator stays the only validator:

  • set_remote_daemon(host, port) -> Result<(), String>
  • set_local_monerod(monerod_bin, prune) -> Result<(), String> (datadir under
    self.home.join("chain"))
  • set_receive_only() — ChainSource::None, the way back to zero.

Nothing in src/wallet.rs, src/wallet_child.rs, src/store.rs, src/main.rs,
Cargo.toml or Cargo.lock was touched. No new crates.

Docs — docs/TUI.md (screens table, FunctionKey table, the "There is no
F7
" paragraph, footer hints, the F9 menu's "no on-screen editor" paragraph, plus a
new ## Wallet setup (F7) section) and docs/WALLET.md:210-213 ("No TUI screen
writes them.
There is no F7.") now describe what ships.

Evidence

$ export TMPDIR=/home/lancelot/.hermes/tmp/onionwire-tui/tmp
$ export CARGO_TARGET_DIR=/home/lancelot/.hermes/tmp/onionwire-tui/target
$ unset FUZZ_TMP_DIR GIT_WORK_TREE GIT_DIR
$ cargo test --locked
EXIT=0   # 35 test binaries, all "test result: ok", 492 tests, 0 failed
$ cargo clippy --locked --all-targets -- -D warnings
EXIT=0   # "Finished `dev` profile" — no warnings

15 new tests in tui::wallet_setup_config_tests drive the real key path and read the
frames the app actually paints; 4 new tests in src/node.rs::tests cover the setters
and the save path:

tui::wallet_setup_config_tests::f7_opens_the_setup_screen_and_esc_leaves_it ... ok
tui::wallet_setup_config_tests::f7_is_live_on_the_three_screens_that_name_it ... ok
tui::wallet_setup_config_tests::the_screen_opens_on_what_is_already_stored ... ok
tui::wallet_setup_config_tests::the_setup_screen_never_renders_the_login ... ok
tui::wallet_setup_config_tests::the_login_never_leaves_in_a_message ... ok
tui::wallet_setup_config_tests::enter_saves_the_form_through_the_node ... ok
tui::wallet_setup_config_tests::a_rejected_form_writes_nothing ... ok
tui::wallet_setup_config_tests::a_rejected_form_leaves_the_whole_stored_config_alone ... ok
tui::wallet_setup_config_tests::a_remote_daemon_is_named_trusted_and_needs_an_address ... ok
tui::wallet_setup_config_tests::an_untouched_chain_row_leaves_the_in_process_source_alone ... ok
tui::wallet_setup_config_tests::a_fresh_install_needs_no_env_vars_to_reach_a_saved_config ... ok
tui::wallet_setup_config_tests::esc_wipes_the_login_buffer ... ok
tui::wallet_setup_config_tests::every_row_fits_the_frame_at_any_width ... ok
tui::wallet_setup_config_tests::the_footer_offers_f7_where_the_screen_is_reachable ... ok
tui::wallet_setup_config_tests::the_setup_screen_prints_its_own_hint ... ok
node::tests::the_setup_screen_persists_each_chain_source ... ok
node::tests::a_rejected_setup_chain_source_is_not_persisted ... ok
node::tests::a_screen_save_round_trips_and_keeps_the_wallet_passphrase ... ok
node::tests::a_rejected_wallet_config_is_not_persisted ... ok

Frames through the real App::draw path

80x24:

┌(o) wallet setup · F7─────────────────────────────────────────────────────────┐
│WALLET RPC ───────────────────────────────────────────────────────────────────│
│> url        (none)                                                           │
│  login      (none) · type user:pass                                          │
│  view-only  no · this wallet can spend                                       │
│                                                                              │
│CHAIN SOURCE ─────────────────────────────────────────────────────────────────│
│  chain      receive-only · no chain, no spend  (space changes)               │
│  daemon     127.0.0.1:18081                                                  │
│  monerod    monerod                                                          │
│  prune      no · full chain store                                            │
│                                                                              │
│status    nothing saved yet · enter saves, ctrl-t tests                       │
└──────────────────────────────────────────────────────────────────────────────┘
… TOR connecting  me:577db60f… onion:test.oni… Enter save Ctrl-T test ? help

120x40 (body identical, full footer):

… TOR connecting  me:577db60f…  onion:test.onion  Esc back Enter save Ctrl-T test  ? help
hint before after delta
main_footer_hints 43 47 +4
pane_footer_hints(Composer) 43 44 +1
pane_footer_hints(Roster) 50 44 −6
pane_footer_hints(Chat) 52 46 −6

The status line is drawn from the focused pane's hint, and the compactor drops
tokens from the front, so F7 had to go in both main_footer_hints and the pane arms —
and the neighbouring F9 lost its word (F9 settings → F9) to pay for it. The
rendered 80-column Main footer is asserted to contain F7 and to fit 80 columns by
the_footer_offers_f7_where_the_screen_is_reachable.

The F7 screen's own hint is Esc back Enter save Ctrl-T test (33 cells + the status
line's ? help). At 80 columns TOR + fingerprint + locator leave only ~26 cells, so the
first draft (Enter save Ctrl-T test Tab field Ctrl-U clear Esc back, 66 cells) showed
only its tail — Ctrl-U clear Esc back — and had to be cut down; the two keys a save
needs are now the tail that survives. Tab and ? are universal, and Ctrl-U is named
on the login row it clears.

Not verified

  • No live monero-wallet-rpc dial: there is no wallet in this environment, so
    Ctrl-T is exercised only against the harness's disabled wallet (the test asserts the
    answer is non-empty and carries no secret, not that it says connected).
  • No real monerod or Cuprate child start: set_local_monerod /
    set_in_process_cuprate persistence is tested, process start is not.
  • No real .onion daemon: ChainSource::is_onion and the SOCKS child path were not
    touched, and the remote case is tested for storage, not for a dial.
# F7: wallet setup — the RPC endpoint and the chain source, on screen Implements kanban `t_00c81aa6`. Stacked on the parent branch `onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o` (base verified through the API below). `wallet::NOT_CONFIGURED_MSG` has always read *"wallet not configured — open F7 to set it up, or set ONIONWIRE_WALLET_RPC"*, and there was no `F7`. This makes the copy true. ## What landed **`src/tui.rs`** - `FunctionKey::Setup` bound to `F7`, live on `Main`, `WalletsSettings` and `PeerPayments` — the same never-no-op invariant `F9` follows. - `Screen::WalletSetupConfig { state }` holding `WalletSetupConfigState`: a snapshot of plain data taken once when the screen opens (`Node::wallet_config` + `Node::wallet_child_config`), never a handle onto `Node`, so a repaint cannot re-read the store mid-frame. - Rows: `url`, `login`, `view-only`, `chain`, `daemon`, `monerod`, `prune`. `Tab`/`Shift-Tab` move, `space` toggles/cycles, `Enter` saves, `Ctrl-T` tests, `Ctrl-U` clears the focused field, `Esc` leaves. - The login is never rendered back (the row reads `hidden · set` / `(none)`), never reaches the status row or a `PingResult::line()`, and `Debug` for the state is written by hand to redact it. - `Ctrl-T` calls `Node::wallet_test_connection` and shows the sanitized line. Saving never dials. - The chain picker covers all four `ChainSource` cases. An **untouched** chain row is not written, so opening F7 to fix a port cannot silently undo `F6`'s in-process choice. Picking a remote daemon prints one line, in the project's voice, at the moment the user takes on that trust: `a daemon you do not run sees this wallet's chain traffic`. - The `endpoint` row of the `F9` menu now names `F7`, the key that edits it. - Footer: `F7` added to `main_footer_hints` and to the three `pane_footer_hints` arms. **`src/node.rs`** — three setters mirroring `set_in_process_cuprate`, each building on `self.wallet_child_config()` and persisting through `set_wallet_child_config`, so `wallet_child.rs`'s validator stays the only validator: - `set_remote_daemon(host, port) -> Result<(), String>` - `set_local_monerod(monerod_bin, prune) -> Result<(), String>` (datadir under `self.home.join("chain")`) - `set_receive_only()` — `ChainSource::None`, the way back to zero. Nothing in `src/wallet.rs`, `src/wallet_child.rs`, `src/store.rs`, `src/main.rs`, `Cargo.toml` or `Cargo.lock` was touched. No new crates. **Docs** — `docs/TUI.md` (screens table, `FunctionKey` table, the "There is **no `F7`**" paragraph, footer hints, the `F9` menu's "no on-screen editor" paragraph, plus a new `## Wallet setup (F7)` section) and `docs/WALLET.md:210-213` ("**No TUI screen writes them.** There is no `F7`.") now describe what ships. ## Evidence ``` $ export TMPDIR=/home/lancelot/.hermes/tmp/onionwire-tui/tmp $ export CARGO_TARGET_DIR=/home/lancelot/.hermes/tmp/onionwire-tui/target $ unset FUZZ_TMP_DIR GIT_WORK_TREE GIT_DIR $ cargo test --locked EXIT=0 # 35 test binaries, all "test result: ok", 492 tests, 0 failed $ cargo clippy --locked --all-targets -- -D warnings EXIT=0 # "Finished `dev` profile" — no warnings ``` 15 new tests in `tui::wallet_setup_config_tests` drive the real key path and read the frames the app actually paints; 4 new tests in `src/node.rs::tests` cover the setters and the save path: ``` tui::wallet_setup_config_tests::f7_opens_the_setup_screen_and_esc_leaves_it ... ok tui::wallet_setup_config_tests::f7_is_live_on_the_three_screens_that_name_it ... ok tui::wallet_setup_config_tests::the_screen_opens_on_what_is_already_stored ... ok tui::wallet_setup_config_tests::the_setup_screen_never_renders_the_login ... ok tui::wallet_setup_config_tests::the_login_never_leaves_in_a_message ... ok tui::wallet_setup_config_tests::enter_saves_the_form_through_the_node ... ok tui::wallet_setup_config_tests::a_rejected_form_writes_nothing ... ok tui::wallet_setup_config_tests::a_rejected_form_leaves_the_whole_stored_config_alone ... ok tui::wallet_setup_config_tests::a_remote_daemon_is_named_trusted_and_needs_an_address ... ok tui::wallet_setup_config_tests::an_untouched_chain_row_leaves_the_in_process_source_alone ... ok tui::wallet_setup_config_tests::a_fresh_install_needs_no_env_vars_to_reach_a_saved_config ... ok tui::wallet_setup_config_tests::esc_wipes_the_login_buffer ... ok tui::wallet_setup_config_tests::every_row_fits_the_frame_at_any_width ... ok tui::wallet_setup_config_tests::the_footer_offers_f7_where_the_screen_is_reachable ... ok tui::wallet_setup_config_tests::the_setup_screen_prints_its_own_hint ... ok node::tests::the_setup_screen_persists_each_chain_source ... ok node::tests::a_rejected_setup_chain_source_is_not_persisted ... ok node::tests::a_screen_save_round_trips_and_keeps_the_wallet_passphrase ... ok node::tests::a_rejected_wallet_config_is_not_persisted ... ok ``` ### Frames through the real `App::draw` path 80x24: ``` ┌(o) wallet setup · F7─────────────────────────────────────────────────────────┐ │WALLET RPC ───────────────────────────────────────────────────────────────────│ │> url (none) │ │ login (none) · type user:pass │ │ view-only no · this wallet can spend │ │ │ │CHAIN SOURCE ─────────────────────────────────────────────────────────────────│ │ chain receive-only · no chain, no spend (space changes) │ │ daemon 127.0.0.1:18081 │ │ monerod monerod │ │ prune no · full chain store │ │ │ │status nothing saved yet · enter saves, ctrl-t tests │ └──────────────────────────────────────────────────────────────────────────────┘ … TOR connecting me:577db60f… onion:test.oni… Enter save Ctrl-T test ? help ``` 120x40 (body identical, full footer): ``` … TOR connecting me:577db60f… onion:test.onion Esc back Enter save Ctrl-T test ? help ``` ### Footer hint widths (cells, measured in `cell_width` = `Span::width`) | hint | before | after | delta | |---|---|---|---| | `main_footer_hints` | 43 | 47 | +4 | | `pane_footer_hints(Composer)` | 43 | 44 | +1 | | `pane_footer_hints(Roster)` | 50 | 44 | −6 | | `pane_footer_hints(Chat)` | 52 | 46 | −6 | The status line is drawn from the **focused pane's** hint, and the compactor drops tokens from the front, so `F7` had to go in both `main_footer_hints` and the pane arms — and the neighbouring `F9` lost its word (`F9 settings` → `F9`) to pay for it. The rendered 80-column Main footer is asserted to contain `F7` and to fit 80 columns by `the_footer_offers_f7_where_the_screen_is_reachable`. The F7 screen's own hint is `Esc back Enter save Ctrl-T test` (33 cells + the status line's `? help`). At 80 columns TOR + fingerprint + locator leave only ~26 cells, so the first draft (`Enter save Ctrl-T test Tab field Ctrl-U clear Esc back`, 66 cells) showed only its tail — `Ctrl-U clear Esc back` — and had to be cut down; the two keys a save needs are now the tail that survives. `Tab` and `?` are universal, and `Ctrl-U` is named on the login row it clears. ## Not verified - No live `monero-wallet-rpc` dial: there is no wallet in this environment, so `Ctrl-T` is exercised only against the harness's disabled wallet (the test asserts the answer is non-empty and carries no secret, not that it says `connected`). - No real `monerod` or Cuprate child start: `set_local_monerod` / `set_in_process_cuprate` persistence is tested, process start is not. - No real `.onion` daemon: `ChainSource::is_onion` and the SOCKS child path were not touched, and the remote case is tested for storage, not for a dial.
tui: F7 wallet setup — RPC endpoint and chain source on screen
All checks were successful
android-ci / android (pull_request) Successful in 10m33s
ci / test (pull_request) Successful in 6m53s
ci / sdk (pull_request) Successful in 1m33s
ci / fuzz (pull_request) Successful in 5m4s
a48d40bc4e
`wallet::NOT_CONFIGURED_MSG` has always said "open F7 to set it up" and there
was no F7. This is that screen.

- `FunctionKey::Setup` on `F7`, live on Main, the settings menu and peer
  payments, same invariant `F9` follows.
- `Screen::WalletSetupConfig` carries `WalletSetupConfigState`: a snapshot of
  plain data taken when the screen opens, never a handle onto `Node`.
- Rows: the wallet RPC endpoint and its login (never rendered back — the row
  says `hidden · set`, `Debug` redacts it), the view-only toggle, and a chain
  picker over all four `ChainSource` cases with their own fields.
- `Node::set_remote_daemon` / `set_local_monerod` / `set_receive_only`, so the
  TUI can reach what only the Android API could, plus `F6`'s in-process source.
- An untouched chain row is not written, so an F7 save cannot silently undo the
  in-process choice; picking a remote daemon says who is trusted in the same
  frame, one line, lowercase.
- `Ctrl-T` tests the endpoint and shows the sanitized `PingResult::line()`.
  Saving never dials. A rejected form writes nothing — the node validates.
- Docs that claimed there is no F7 (`docs/TUI.md`, `docs/WALLET.md`) now
  describe the screen; the settings menu's `endpoint` row names the key.
Merge branch 'onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o' into onionwire/t_00c81aa6-onionwire-tui-f7-setup-screen-configure
Some checks failed
ci / test (pull_request) Failing after 40s
ci / sdk (pull_request) Successful in 1m35s
ci / fuzz (pull_request) Successful in 5m4s
android-ci / android (pull_request) Has been cancelled
31f21e9c69
sirius merged commit 6a08a8c2e6 into onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o 2026-09-27 18:10:27 +00:00
sirius deleted branch onionwire/t_00c81aa6-onionwire-tui-f7-setup-screen-configure 2026-09-27 18:10:34 +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!165
No description provided.