Merge pull request 'tui: F7 becomes the node-setup screen, and F6 goes back to being the wallet' (#169) from onionwire/f7-node-setup into main
All checks were successful
ci / test (push) Successful in 7m8s
ci / sdk (push) Successful in 1m19s
android-ci / android (push) Successful in 13m45s

Reviewed-on: #169
This commit is contained in:
sirius 2026-09-28 00:43:14 +00:00
commit 02f8e4d914
6 changed files with 1796 additions and 80 deletions

View file

@ -22,16 +22,17 @@ ASCII chrome.
| `Wipe` | `/wipe` or `/wipe-all` | Type `WIPE` or `WIPEALL` |
| `Profile` | `/profile` | Edit name, bio, optional Monero address |
| `ConfirmKeys` / `Passphrase` | `/backup`, `/restore` | Type `BACKUP`/`RESTORE`, then passphrase |
| `Wallet` | `F6` | Receive QR, balance, transfers, child, chain source |
| `Wallet` | `F6` | Receive QR, balance, transfers |
| `WalletSelect` | `F6` `w` | Saved wallets, pick one or create one |
| `WalletSetup` | `F6` `c` / `i`, or `/wallet create` / `import` | Spend warning, seed, optional seed-offset passphrase, import |
| `WalletsSettings` | `F9` or `/settings` | Discovery menu (does not replace F-keys) |
| `WalletSetupConfig` | `F7` | Node & wallet setup: RPC endpoint, chain source, start/stop, live node state |
| `PeerPayments` | F9 then `p` | Peer-scoped `/pay` / `/tip` history |
| `Quit` | `Ctrl-Q` | Type `CLEAR` or `QUIT` |
Help (`?`) is an overlay, not a screen. `/who` / `F5` is an overlay on Main.
There is **no `F7`**. Function keys that fire from Main, the settings menu, and
Function keys that fire from Main, the settings menu, and
peer-payments are:
| Key | `FunctionKey` | Action |
@ -41,11 +42,13 @@ peer-payments are:
| `F4` | Rotate | Onion locator |
| `F5` | Who | Selected friend's profile |
| `F6` | Wallet | Wallet screen |
| `F7` | Setup | Node & wallet setup: RPC endpoint, chain source, start/stop |
| `F8` | RotatePrekey | Prekey hard cut |
| `F9` | OpenMenu | Wallets & settings |
`F9` is live on Main, the settings menu, and peer-payments so a printed shortcut
never no-ops there. Other screens handle their own keys (Esc back, typed
never no-ops there, and `F7` joins it for the same reason: `/settings` points at
the setup screen. Other screens handle their own keys (Esc back, typed
confirms).
## Main
@ -53,16 +56,21 @@ confirms).
Focus starts on the composer. Footer hints (`main_footer_hints`):
```
Tab F2 F3 F4 F5 F6 F9 ? help Ctrl-Q
Tab F2 F3 F4 F5 F6 F7 F9 ? help Ctrl-Q
```
Pane-specific (`pane_footer_hints`):
| Pane | Hint |
|---|---|
| Roster | `j k select F3 add F6 wallet F9 settings ? help` |
| Chat | `j k scroll g G ends F4 rotate F9 settings ? help` |
| Composer | `Enter send / commands F9 settings ? help` |
| Roster | `j k F3 add F6 wallet F7 setup F9 ? help` |
| Chat | `j k g G ends F4 rotate F7 setup F9 ? help` |
| Composer | `Enter send / commands F7 setup F9 ? help` |
The status line is drawn from the focused pane's hint, and the compactor drops
tokens from the front until the line fits, so a key that only appears in
`main_footer_hints` never reaches an 80-column terminal. `F7` is therefore named
in both, and the `F9` beside it is left bare so the whole hint still fits at 80.
| Key | Action |
|---|---|
@ -107,10 +115,14 @@ Pane-specific (`pane_footer_hints`):
## Wallet (`F6`)
The wallet, not the node: receive, balance, transfers, and create/import. Chain
and node configuration is `F7` (`Configures the wallet RPC endpoint and the
chain source`), named in the footer so the key is findable from here.
Footer:
```
c create i import r qr w wallets s/x child 1 pruned 2 full 3 testnet Esc back ? help
c create i import r qr w wallets F7 node Esc back ? help
```
| Key | Effect |
@ -119,14 +131,14 @@ c create i import r qr w wallets s/x child 1 pruned 2 full 3 testnet Esc
| `w` | Saved wallets (`WalletSelect`) |
| `c` | Create wallet (`SPEND` then seed once, type `SEEN`) |
| `i` | Import 25-word seed |
| `s` | Start app-owned wallet child |
| `x` | Stop child (idempotent) |
| `p` | Probe child (RPC answering? chain at tip?) |
| `1` | In-process Cuprate **mainnet pruned** (unvalidated) |
| `2` | In-process Cuprate **mainnet full** (unvalidated) |
| `3` | In-process Cuprate **testnet** |
| `F7` | Node & wallet setup (`WalletSetupConfig`) |
| Esc | Back to Main |
The child's state and the chain source are shown here (and on `F9`), but they are
**set** on `F7`: the start/stop/probe keys and the `1`/`2`/`3` in-process picker
that used to live on this screen are gone, so there is one place that configures
the chain.
The chain line for an in-process source always carries
`testnet only — mainnet is unvalidated` (`cuprate::TESTNET_ONLY`). Starting
Cuprate needs `--features cuprate-daemon`; without it, start fails with that
@ -168,11 +180,66 @@ stored identity and locator are catalogue columns, not session state: a locator
rotates (`F4`) and identity is the roster key the node already holds, so the
live header keeps reading them from the node.
## Node & wallet setup (`F7`)
Footer: `Esc back Enter save Ctrl-T test` (plus the status line's own `? help`).
The compactor drops tokens from the front, and at 80 columns the status line
leaves about 25 cells, so the tail is what the default terminal shows. `Tab` and
`?` are universal; the node's own keys (`ctrl-s`, `ctrl-x`, `ctrl-r`) and
`Ctrl-U` are named in the body, on the row they act on.
Live from Main, the `F9` settings menu, and peer payments; the menu's `endpoint`
row names `F7` as the key that edits it. Body is `WalletSetupConfigState`, a
snapshot taken when the screen opens — the render path never reads the store.
This is the only screen that sets up the chain: the wallet RPC endpoint, and the
node that serves it.
| Row | Kind | Notes |
|---|---|---|
| `url` | text | the wallet RPC endpoint |
| `login` | text | `user:pass`. Never rendered back: the row reads `hidden · set` or `(none)` |
| `view-only` | toggle | `no_spend`; `/tip` is refused before any dial |
| `chain` | picker | `space` cycles receive-only, local node, remote daemon, in-process |
| `daemon` | text | `host:port`, for the remote daemon |
| `monerod` | text | the binary this box spawns for a local node |
| `datadir` | text | where the chain is stored. Prefilled with the path already in use; an empty one is refused rather than silently defaulted |
| `prune` | toggle | local and in-process sources |
| `network` | picker | in-process source: `space` cycles mainnet (`unvalidated`) and testnet |
Under them, a `NODE` section: the live `Node::wallet_child_status` line (state,
chain source, `sync h/t` once a daemon reports numbers, the last error) and the
last save/test answer. The live row is the node's answer, never the draft above
it, and it is re-read by `Ctrl-R`.
`Enter` saves and answers on the status row: `saved · not dialled yet — ctrl-s
starts it, ctrl-t tests the endpoint`, or the node's own refusal in its own
words. The endpoint is validated by `Node::wallet_save_config` — loopback host,
login required — and a rejected form is rejected **before** it is written:
nothing in the sealed record moves and a running wallet is not re-dialled.
`Ctrl-T` dials the endpoint and answers with the sanitized `PingResult` line
(never the password). `Ctrl-U` clears the focused field, which is how a hidden
login gets replaced.
`Ctrl-S` saves and then starts the wallet child — the daemon and, for a local
source, `monerod` — so the setup screen is also the key that brings the node up.
A start that lands on a wallet file with no stored passphrase moves the app to
the unlock prompt. `Ctrl-X` stops the child. Both go through the same
`Node::start_wallet_child` / `stop_wallet_child` the app's own lifecycle uses.
The chain row is written only when it was changed. An untouched row leaves the
stored source alone, so opening `F7` to fix a port cannot silently undo an
in-process Cuprate choice or move a chain datadir. Picking a remote daemon says
so in the same frame — `a daemon you do not run sees this wallet's chain
traffic` — because that is the pick that moves chain trust off this box. The
address must parse as `host:port` first.
Esc is the single exit and wipes the login buffer (`Zeroizing<String>`).
## Wallets & settings (`F9` / `/settings`)
Discovery layer, not a replacement. Function keys stay live on this screen.
Rows name the shortcut they sit beside (`F6 c`, `F6 i`, `F6 r`, `F6 s/x`,
`F6 p`, `/profile`, `/backup`, `/wipe`, …).
Rows name the shortcut they sit beside (`F6 c`, `F6 i`, `F6 r`, `/profile`,
`/backup`, `/wipe`, …).
- **No credentials** on this screen. Login, seed, and passphrase are never
passed into the menu snapshot.
@ -180,14 +247,15 @@ Rows name the shortcut they sit beside (`F6 c`, `F6 i`, `F6 r`, `F6 s/x`,
- `p` opens peer payment history for the selected friend (`Node::list_payments`).
- Esc back to Main.
The menu **shows** endpoint state; it does not edit a stored RPC URL. The error
copy for an unconfigured wallet still says “open F7” (`src/wallet.rs`); that
key does not exist. Set `ONIONWIRE_WALLET_RPC` or use `F6` create/import and
the child.
The menu **shows** endpoint state; it does not edit it. The `endpoint` row names
`F7`, which is the key that opens `WalletSetupConfig` and the key the “open F7”
copy in `src/wallet.rs` now points at — that error is no longer advice for a key
that does not exist.
Chain source (binaries, remote host) is stored via `Node::set_wallet_child_config`.
The desktop TUI's in-process picker is `F6` keys `1`/`2`/`3`. There is no
on-screen editor for an external RPC URL or a remote daemon host.
Chain source is stored via `Node::set_wallet_child_config`. `F7` is the one
screen that sets any of the four sources — receive-only, a local `monerod`, a
remote daemon, or the in-process Cuprate node — along with the external RPC URL
and the chain datadir.
## Peer payments (`F9` then `p`)

View file

@ -89,14 +89,17 @@ The child is stopped rather than left answering `-13`, and the status reports
(`open_wallet_with_passphrase`, or the TUI/Android prompt) and it is remembered.
Nothing spawns the child at boot. `Node::start_wallet_child` is the only start
path. The desktop TUI drives it from `F6`:
path. The desktop TUI drives it from `F7` (`Ctrl-S` / `Ctrl-X`), which is also
the screen that picks the chain source:
| Key | Effect |
|---|---|
| `s` | Start the child, then probe it once. A child whose wallet file needs a passphrase opens the passphrase prompt instead of leaving every read at `-13`. |
| `x` | Stop it (idempotent). |
| `p` | Probe: is wallet RPC answering, is the chain at the tip? |
| `1` / `2` / `3` | Store in-process Cuprate as mainnet-pruned / mainnet-full / testnet. |
| `Ctrl-S` | Save the form, then start the child and probe it once. A child whose wallet file needs a passphrase opens the passphrase prompt instead of leaving every read at `-13`. |
| `Ctrl-X` | Stop it (idempotent). |
| `Ctrl-R` | Re-read the live node line (`off` / `connecting` / `syncing` / `ready` / `exited`). |
| `Enter` | Save the endpoint and chain source without dialling or starting anything. |
| `chain` row + `space` | Receive-only / local `monerod` / remote daemon / in-process Cuprate. |
| `network` row + `space` | In-process network: mainnet (unvalidated) or testnet. |
State shown: `off` / `connecting` / `syncing` / `ready` / `exited`, plus a
chain-source label, plus `wallet locked` while a catalogue wallet is configured
@ -149,9 +152,10 @@ cargo build --release --features cuprate-daemon
`this build has no in-process chain daemon — rebuild with --features cuprate-daemon`.
- **Pre-production.** Cuprate's own user book says do not use `cuprated` for
serious purposes. RPC parity is incomplete (`docs/cuprate-launch-spike.md`).
- **Mainnet is unvalidated.** The TUI can store mainnet-pruned (`F6` `1`) or
mainnet-full (`F6` `2`) or testnet (`F6` `3`). Every in-process surface still
prints `testnet only — mainnet is unvalidated` (`cuprate::TESTNET_ONLY`).
- **Mainnet is unvalidated.** The TUI stores the in-process network on `F7`'s
`network` row (mainnet or testnet) and the store's shape on its `prune` row.
Every in-process surface still prints `testnet only — mainnet is unvalidated`
(`cuprate::TESTNET_ONLY`).
Cross-compiled is not device-proven. Pointing a mainnet wallet at it is not
something this build claims to do.
- **No Tor on the chain path.** Cuprate's `arti` feature is off (arti-client
@ -207,10 +211,16 @@ Boot precedence: **stored config → env → disabled**. Stored config that cann
be used (non-loopback, `.onion`, missing login) is reported and falls back to
env rather than dialling the bad endpoint.
`Store::save_wallet_config` / `Node::wallet_save_config` exist. **No TUI screen
writes them.** There is no `F7`. The not-configured refusal still says
`Store::save_wallet_config` / `Node::wallet_save_config` exist, and the `F7`
screen (`WalletSetupConfig`) writes them: the endpoint, its login, the chain
source, and (for a local node) its datadir and network. It is also the only
screen that starts and stops the child (`Ctrl-S` / `Ctrl-X`). `F6` and `F9`
show state, the env vars are the headless path. The not-configured refusal says
`wallet not configured — open F7 to set it up, or set ONIONWIRE_WALLET_RPC`
(`src/wallet.rs`). Live surfaces: `F6`, `F9`, or the env vars.
(`src/wallet.rs`), and that key is real.
A save validated by `Node::wallet_save_config` (loopback host, login required)
re-points the wallet without a restart; a rejected form writes nothing.
`/pay` and `/tip` run `wallet_readiness` before send: