tui: F7 becomes the node-setup screen, and F6 goes back to being the wallet
The chain source was reachable from three places and configured from none of them properly: `F6`'s inline `1`/`2`/`3` picker wrote only the in-process choice, the `F9` menu showed the state and named keys that edited it, and `Node::set_local_monerod` / `set_remote_daemon` / `set_receive_only` — the only way to point the app at a Monero node — had **no TUI caller at all** (Kotlin only). `wallet::NOT_CONFIGURED_MSG` told users to "open F7" and there was no F7. F7 (`WalletSetupConfig`) is now the one screen that sets up the node: - The `datadir` row is new and editable. `Node::set_local_monerod_at` takes the path; `set_local_monerod` delegates with the derived default, so an existing install keeps the store it already has. An empty datadir is refused rather than silently replaced — a store that moved unasked looks like a vanished chain and resyncs somewhere the user did not choose. - The `network` row is new: it carries the Cuprate mainnet/testnet choice that `F6`'s `1`/`2`/`3` used to own, so deleting those keys loses nothing. Mainnet reads `unvalidated` before it is picked. - A `NODE` section shows the live `Node::wallet_child_status` line (state, chain source, `sync h/t`, last error) and the last save/test answer. It is the node's answer, never the draft above it, and `Ctrl-R` re-reads it. - `Ctrl-S` saves and starts the child (the daemon, and `monerod` for a local source); `Ctrl-X` stops it. Both go through the same `Node::start_wallet_child` / `stop_wallet_child` the app's own lifecycle uses, so a start that lands on a wallet with no stored passphrase still reaches the unlock prompt. F6 loses the chain picker and the `s`/`x`/`p` child keys — it is the wallet again (receive, balance, transfers, create/import) — and its footer points at `F7 node`. The `F9` menu's `child`/`sync` rows now name `F7 ctrl-s/x` and `F7 ctrl-r` instead of keys that no longer exist on F6. `set_cuprate_chain` and the `p` probe handler are deleted rather than left dead. 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, which is the same reason the login row names `Ctrl-U`. Tests: six new cases in `src/tui.rs`'s `wallet_setup_config_tests` drive the real key path and the real node — the typed datadir reaching `ChainSource::Local`, an empty one being refused with nothing written, the live row on open, `Ctrl-S` saving then reporting the node's own refusal, the in-process network pick reaching the store, and F6 no longer owning keys it does not handle. `tests/tui_spec.rs`'s menu-key check now asserts the F7 keys; the F6 keys it asserted before no longer work.
This commit is contained in:
parent
a37712f3af
commit
5cdfbacf10
6 changed files with 509 additions and 106 deletions
12
README.md
12
README.md
|
|
@ -200,15 +200,19 @@ payload can contain `?`).
|
|||
| `F3` | Paste a friend's invite |
|
||||
| `F4` | Rotate **onion** (locator only) |
|
||||
| `F5` | Selected friend's profile (`/who`) |
|
||||
| `F6` | Wallet (receive QR, create/import, child, chain source) |
|
||||
| `F6` | Wallet (receive QR, balance, transfers, create/import) |
|
||||
| `F7` | Node & wallet setup (wallet RPC endpoint, chain source, start/stop, live node state) |
|
||||
| `F8` | Rotate **prekey** (hard cut: every friend re-pastes the invite) |
|
||||
| `F9` | Wallets & settings menu (`/settings`) |
|
||||
| Enter | Send chat to the selected friend, or run a `/command` |
|
||||
| `Esc` | Close overlay / back to Main / clear composer |
|
||||
| `Ctrl-Q` | Quit: type `CLEAR`+Enter to wipe history, `QUIT`+Enter to leave it, Esc to stay |
|
||||
|
||||
There is **no `F7`**. The not-configured wallet error still says “open F7”; the
|
||||
live screens are `F6` (wallet) and `F9` (settings). Full map: [docs/TUI.md](docs/TUI.md).
|
||||
`F7` is where the Monero side is set up: the wallet RPC endpoint and login, the
|
||||
chain source (receive-only, a local `monerod`, a remote daemon, or the in-process
|
||||
Cuprate node), the chain datadir, and `Ctrl-S`/`Ctrl-X` to start and stop it. It
|
||||
is also what the “open F7” wallet error points at. Full map:
|
||||
[docs/TUI.md](docs/TUI.md).
|
||||
|
||||
Composer `/commands` (`src/tui.rs` `parse_cmd`): `/wipe`, `/wipe-all`, `/profile`,
|
||||
`/who`, `/pay <xmr> [memo]`, `/tip <xmr> [memo]`, `/backup /path`, `/restore /path`,
|
||||
|
|
@ -425,7 +429,7 @@ Do not run `cargo publish`; `publish = false`.
|
|||
| Blank / broken TUI | Real terminal emulator, not `nohup` / systemd without a TTY. |
|
||||
| Two chats, same laptop | Separate `ONIONWIRE_HOME` per process. |
|
||||
| Friend cannot find you after F4 | Expected if they were offline. They F3-paste the new invite. |
|
||||
| Wallet error says “open F7” | There is no F7. Use `F6` / `F9`, or set `ONIONWIRE_WALLET_RPC`. |
|
||||
| Wallet error says “open F7” | `F7` is the node & wallet setup screen: set the RPC endpoint there, or set `ONIONWIRE_WALLET_RPC`. |
|
||||
|
||||
## Not in v1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue