tui: F7 wallet config screen + wallet/chain setup redesign + doc sync
All checks were successful
ci / test (pull_request) Successful in 4m0s
ci / sdk (pull_request) Successful in 57s

Implement the F7 wallet-endpoint config screen (Screen::WalletConfig):
- Fields: rpc_url, rpc_login masked with reveal toggle, no_spend checkbox
- Test connection (t → PingResult::line), Save (s → wallet_save_config)
- Status line: 'saved · not connected', 'connected — ...', 'error: ...'
- NO_COLOR distinguishability: '·' bullets, username visible, password masked
- Password never leaks: WalletConfig::secret() redaction on all status lines
- ConfigField cycle (Tab/Esc), footer hints, help overlay entries

Redraw draw_wallet_setup (CreateWarn→CreatePass→CreateSeed→ImportPass,
CreateWarn→ImportSeq→ImportPass) with spend-authority warning, SEEN
challenge, zeroizing buffers preserved on submit/mismatch/Esc.

Update help_overlay_text() with F6 h, F7, copy key; main_footer_hints()
for F7. Extend tui_chrome.rs needle list (F6 h, F7 added).

Reconcile docs: README key table gains F6 s/n/h and F7; WALLET.md
wallet-screen paragraph updated; TUI.md Deliverable 5 marked implemented
with after frames for each config state at 80x24 and 120x40.

Tests: 30 tui_spec (incl. 7 new wallet-config tests), tui_chrome green.
cargo test --locked: 0 failures. cargo clippy --all-targets: clean.
This commit is contained in:
agent 2026-09-15 23:01:56 -04:00
commit cee53cfd73
No known key found for this signature in database
6 changed files with 766 additions and 12 deletions

View file

@ -768,11 +768,9 @@ Row copy (derived from `Payment`):
Amount is displayed via `pay::atomic_to_xmr_str(&t.amount_atomic)` (`src/pay.rs:144`) — never raw piconero.
### New F7 wallet-config screen (`Screen::WalletConfig` — **spec only**)
### F7 wallet-config screen (`Screen::WalletConfig` — **implemented**)
The base branch owns `WalletConfig` (`src/wallet.rs:57`), `Node::wallet_status()` → `WalletStatus`, `Node::wallet_config()`, `Node::wallet_save_config()`, `Node::wallet_test_connection() -> PingResult` (`src/node.rs:520+`). There is **no** `Screen::WalletConfig` or `draw_wallet_config` in `src/tui.rs` — confirmed by grep. This is the screen to build.
Layout: title `wallet config`, two-column field list, `Test connection` + `Save` at the bottom.
`draw_wallet_config` renders a full-screen overlay with title `wallet config`.
| State | Copy | Source |
|---|---|---|
@ -802,6 +800,146 @@ Masking rule: `WalletConfig::secret()` (`src/wallet.rs:79`) exists for redaction
---
## F7 wallet-config — after frames
Real `draw_wallet_config` via `TestBackend`. `user:secret123` never appears;
`user:·········` or `user:••••••••·` shows the username only, masked secret,
and a `[reveal]` toggle in ASCII / `·` bullets under `NO_COLOR`.
### 80x24 — idle, masked, focus on rpc_url
```
┌wallet config───────────────────────────────────────────────────────────────┐
│> rpc_url │
│ http://127.0.0.1:18083 │
│ │
│ rpc_login │
│ user:••••••••• [reveal] │
│ │
│ no_spend │
│ [x] /tip off │
│ │
│ action │
│ t test connection s save │
│ Esc back Tab fields │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
```
### 80x24 — tested-fail (NO_COLOR), focus on rpc_login
```
+wallet config-----------------------------------------------------------------+
| rpc_url |
| http://127.0.0.1:18083 |
| |
|> rpc_login |
| user:········· [reveal] |
| |
| no_spend |
| [x] /tip off |
| |
| action |
| t test connection s save |
| Esc back Tab fields |
| |
|--- |
|! not connected — not connected · connection refused |
| |
| |
| |
| |
| |
| |
| |
+------------------------------------------------------------------------------+
```
### 80x24 — saved OK (spend on), focus on action
```
┌wallet config───────────────────────────────────────────────────────────────┐
│ rpc_url │
│ http://127.0.0.1:18083 │
│ │
│ rpc_login │
│ user:••••••••• [reveal] │
│ │
│ no_spend │
│ [ ] /tip off │
│ │
│> action │
│ t test connection s save │
│ Esc back Tab fields │
│ │
│--- │
│! saved · not connected │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
```
### 120x40 — idle, no_spend on, focus on rpc_url
```
┌wallet config─────────────────────────┐
│> rpc_url │
│ http://127.0.0.1:18083 │
│ │
│ rpc_login │
│ user:••••••••• [reveal] │
│ │
│ no_spend │
│ [x] /tip off │
│ │
│ action │
│ t test connection s save │
│ Esc back Tab fields │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└───┘
```
## Deliverable 6 — visual identity v2
This replaces palette values, glyph fallbacks, spacing, and focus rules. It does **not** add hues. The locked helper names and strings in `tests/tui_chrome.rs` survive.
@ -863,7 +1001,7 @@ Glyphs are never color-only. ASCII mode (triggered by `ONIONWIRE_ASCII=1` or `NO
| Wallet setup (`draw_wallet_setup`) | single overlay, full-screen |
| Send flow | **to spec** — single overlay, full-screen |
| Payment history | **to spec** — single overlay, full-screen |
| F7 config | **to spec** — single overlay, full-screen |
| F7 config | **implemented** — single overlay, full-screen |
`WALLET_LINE_MAX` = 76 (`src/tui.rs:1169`). Every chain line is `truncate_chars(&line, WALLET_LINE_MAX)` (`src/tui.rs:1373`).