Merge pull request 'tui: drop the F9 menu that restates F6 and F7' (#178) from onionwire/t_7121b6ba-onionwire-tui-drop-the-menu-that-restate into main
Some checks failed
ci / test (push) Failing after 20s
ci / sdk (push) Successful in 1m31s
android-ci / android (push) Successful in 12m45s

Reviewed-on: #178
This commit is contained in:
sirius 2026-10-08 21:24:42 +00:00
commit d89539e8b0
5 changed files with 391 additions and 1147 deletions

View file

@ -25,15 +25,13 @@ ASCII chrome.
| `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 |
| `PeerPayments` | `p` on Main (roster or chat) | 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.
Function keys that fire from Main, the settings menu, and
peer-payments are:
Function keys that fire from Main are:
| Key | `FunctionKey` | Action |
|---|---|---|
@ -44,33 +42,33 @@ peer-payments are:
| `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, and `F7` joins it for the same reason: `/settings` points at
the setup screen. Other screens handle their own keys (Esc back, typed
confirms).
`F7` also fires on the wallet screen, which prints it. There is no `F9` and no
`/settings`: that menu restated F6 and F7. A screen that does not name a
function key does not answer one. Other screens handle their own keys (Esc
back, typed confirms).
## Main
Focus starts on the composer. Footer hints (`main_footer_hints`):
```
Tab F2 F3 F4 F5 F6 F7 F9 ? help Ctrl-Q
Tab F2 F3 F4 F5 Ctrl-Q F6 F7 ? help
```
Pane-specific (`pane_footer_hints`):
| Pane | Hint |
|---|---|
| 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` |
| Roster | `j k p pay F3 add F6 wallet F7 setup ? help` |
| Chat | `j k g G p pay F6 wallet F7 setup ? help` |
| Composer | `Enter send / commands F6 wallet F7 setup ? 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.
`main_footer_hints` never reaches an 80-column terminal. `F6` and `F7` are
therefore named in both, at the tail. `p` is named only on roster and chat:
the composer types the letter.
| Key | Action |
|---|---|
@ -96,7 +94,6 @@ in both, and the `F9` beside it is left bare so the whole hint still fits at 80.
| `/file /path` | File send, 1 MiB, one-shot |
| `/wallet create` | Same as `F6` then `c` |
| `/wallet import` | Same as `F6` then `i` |
| `/settings` | Same as `F9` |
| `/backup /path` | Encrypted identity export |
| `/restore /path` | Overwrite self keys |
| `/wipe` | Type `WIPE` — chat/payments/outbox; identity stays |
@ -134,15 +131,15 @@ c create i import r qr w wallets F7 node Esc back ? help
| `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 child's state and the chain source are shown here, 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
feature name.
`testnet only — mainnet is unvalidated` (`cuprate::TESTNET_ONLY`). The default
binary includes the in-process daemon. A build compiled without that feature
still shows the rebuild message on the chain row, and start fails with that
feature name only on such a build.
Create/import require the wallet RPC started with `--wallet-dir`. Filename:
`onionwire`. Seed is never collected on the composer.
@ -187,9 +184,9 @@ 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.
Live from Main and from the wallet screen, which prints `F7 node`. 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.
@ -246,41 +243,25 @@ 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.
A build without `cuprate-daemon` says so on the `chain` row, where the choice is
made, rather than offering it and refusing at start: the in-process wording is
followed by `this build has no in-process chain daemon — rebuild with --features
cuprate-daemon` (`crate::cuprate::NO_FEATURE_MSG`, clamped to the frame width).
The pick is still offered — builds with the feature exist, and a stored
in-process source must still be readable.
The default `onionwire` binary includes the in-process daemon. A build without
that feature says so on the `chain` row, where the choice is made, rather than
offering it and refusing at start: the in-process wording is followed by
`NO_FEATURE_MSG` (clamped to the frame width). The pick is still offered — a
stored in-process source must still be readable — and that rebuild line appears
only on a build that left the feature out.
Esc is the single exit and wipes the login buffer (`Zeroizing<String>`).
## Wallets & settings (`F9` / `/settings`)
`/profile`, `/backup`, `/restore`, `/wipe` and `/wipe-all` stay composer
commands. They are named in help (`?`). There is no settings menu that restates
them, and no `F9`.
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`, `/profile`,
`/backup`, `/wipe`, …).
- **No credentials** on this screen. Login, seed, and passphrase are never
passed into the menu snapshot.
- `c` copies the receive address (OSC 52).
- `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 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 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`)
## Peer payments (`p` on Main)
Peer-scoped signed invoices and tips, not the wallet's own transfer list.
`j`/`k` or arrows select. Esc back. Footer: `Esc back up/down select F9 menu ? help`.
`p` opens it from the roster or the chat (the composer types the letter). With
no friend selected the screen says `no friend selected`. `j`/`k` or arrows
select. Esc back. Footer: `Esc back up/down select ? help`.
## Delivery markers (chat)
@ -302,6 +283,6 @@ Floor **80×24**. Target **120×40**. Frame dumps:
```
cargo test --locked --test tui_spec -- --nocapture dump_spec_frames
cargo test --locked --test tui_spec -- --nocapture wallets_settings_menu_frame_dumps
cargo test --locked --lib f6_and_f7_frames_fit -- --nocapture
cargo test --locked --test tui_select -- --nocapture wallet_select_frame_dumps
```