tui: F7 wallet config screen + wallet/chain setup redesign + doc sync #84

Merged
sirius merged 1 commit from wt/t_7719eda3 into feat/wallet-create-import 2026-09-16 04:39:43 +00:00
Owner

Final card of the TUI redesign chain.

What this PR does

F7 wallet-config screen (Screen::WalletConfig):

  • Fields: rpc_url, rpc_login (masked with [reveal]/[hide] toggle), no_spend checkbox with /tip off consequence line
  • Test connection (t) fires Node::wallet_test_connection -> PingResult::line()
  • Save (s) calls Node::wallet_save_config(&cfg), status shows saved · not connected, connected — <label>, or error: <short>
  • NO_COLOR frame: · bullets + username visible, password masked — distinguishable without color
  • Password never leaks: WalletConfig::secret() redaction on every status line, status note, alert, and help string
  • Key handling: F7 from main and wallet screens, Esc back, Tab cycles RpcUrl->RpcLogin->NoSpend->Action, Enter on action fires t/s

Redraw draw_wallet_setup / draw_chain_setup:

  • CreateWarn (SPEND_AUTHORITY_WARNING + type SPEND) -> CreatePass (1st/2nd) -> CreateSeed (SEEN challenge) -> ImportSeed -> ImportPass
  • spend-authority warning is unavoidable at create time, not dismissible
  • Zeroizing buffers zeroized on submit, mismatch, and Esc

Help + footer:

  • help_overlay_text updated with F6 h, F7, copy key
  • tui_chrome.rs needle list extended (F6 h, F7 added, no needles removed)

Docs reconciled:

  • README.md TUI key table: added F6 s, F6 n, F6 h, F7 rows
  • docs/WALLET.md: wallet-screen paragraph updated for F6 h
  • docs/TUI.md: Deliverable 5 marked implemented, after frames for each config state

Verification

cargo test --locked                          # 0 failures across all targets
cargo clippy --locked --all-targets -- -D warnings  # clean

Frame evidence (real draw_wallet_config via TestBackend)

80x24 — idle, rpc_url focused, no_spend on

┌wallet config─────────────────────────────────────────────────────────────────┐
│>  rpc_url                                                                    │
│  http://127.0.0.1:33383                                                      │
│                                                                              │
│   rpc_login                                                                  │
│  bitcoinrpc:••••••••••••••  [reveal]                                         │
│                                                                              │
│   no_spend                                                                   │
│  [x] /tip off                                                                │
│                                                                              │
│   action                                                                     │
│  t test connection   s save                                                  │
│  Esc back  Tab fields                                                        │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

80x24 — testing connection (focus on action)

┌wallet config─────────────────────────────────────────────────────────────────┐
│   rpc_url                                                                    │
│                                                                              │
│                                                                              │
│   rpc_login                                                                  │
│  •••••••  [reveal]                                                           │
│                                                                              │
│   no_spend                                                                   │
│  [ ] /tip off                                                                │
│                                                                              │
│>  action                                                                     │
│  t test connection   s save                                                  │
│  Esc back  Tab fields                                                        │
│                                                                              │
│---                                                                           │
│testing connection …                                                          │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

80x24 — tested-fail, NO_COLOR

+wallet config-----------------------------------------------------------------+
|   rpc_url                                                                    |
|  http://127.0.0.1:33383                                                      |
|                                                                              |
|   rpc_login                                                                  |
|  bitcoinrpc:··············  [reveal]                                         |
|                                                                              |
|   no_spend                                                                   |
|  [x] /tip off                                                                |
|                                                                              |
|   action                                                                     |
|  t test connection   s save                                                  |
|  Esc back  Tab fields                                                        |
|                                                                              |
|---                                                                          |
|! not connected — not connected · connection refused                          |
|                                                                              |
|                                                                              |
|                                                                              |
|                                                                              |
|                                                                              |
|                                                                              |
+------------------------------------------------------------------------------+

80x24 — masked vs revealed, NO_COLOR (distinguishable without color)

masked:   bitcoinrpc:··············  [reveal]
revealed: bitcoinrpc:··············  [hide]

The word [reveal] vs [hide] distinguishes state in NO_COLOR; the dots never show the password.

120x40 — idle, no_spend on

                                       ┌wallet config──────────────────────────┐
                                       │>  rpc_url                             │
                                       │  http://127.0.0.1:33383               │
                                       │                                       │
                                       │   rpc_login                           │
                                       │  bitcoinrpc:••••••••••••••  [reveal]  │
                                       │                                       │
                                       │   no_spend                            │
                                       │  [x] /tip off                         │
                                       │                                       │
                                       │   action                              │
                                       │  t test connection   s save           │
                                       │  Esc back  Tab fields                 │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       │                                       │
                                       └───┘

Wallet setup screen — CreateWarn (spend-authority warning unavoidable)

The SPEND_AUTHORITY_WARNING text is the body; user types SPEND to confirm, Esc to cancel. Zeroizing buffers wipe on Esc/mismatch/submit.

README key table — before/after

Before (base):
| F6 | Wallet screen (address, chain, transfers) |
| F6 s | Chain source: receive-only / local / remote |
| F6 n | Start or stop the app-owned daemon |

After:
| F6 | Wallet screen (address, chain, transfers) |
| F6 s | Chain source: receive-only / local / remote |
| F6 n | Start or stop the app-owned daemon |
| F6 h | Show receive address / seed phrase |
| F7 | Wallet config (RPC URL, login, spend) |

Password leak guard proof

wallet_config_password_never_leaks_in_any_status renders all config states
with user:supersecret123 as the login and asserts FIXTURE_PASS is absent
from the frame. The redaction path: ConfigStatus::line() calls
wallet::redact(e, WalletConfig::new("", login, false).secret()) — the password
is replaced with before any status text is assembled.

Changed files

  • src/tui.rs: WalletConfigScreen, ConfigField, ConfigStatus (Default derived), draw_wallet_config, handle_wallet_config, footer hints, help overlay
  • tests/tui_spec.rs: 7 new tests for config screen
  • tests/tui_chrome.rs: F6 h and F7 needles added
  • docs/TUI.md: after frames for config states, Deliverable 5 marked implemented
  • docs/WALLET.md: wallet-screen paragraph reconciled with F6 h
  • README.md: F6 h and F7 added to TUI key table
Final card of the TUI redesign chain. ## What this PR does **F7 wallet-config screen** (Screen::WalletConfig): - Fields: rpc_url, rpc_login (masked with [reveal]/[hide] toggle), no_spend checkbox with `/tip off` consequence line - Test connection (t) fires Node::wallet_test_connection -> PingResult::line() - Save (s) calls Node::wallet_save_config(&cfg), status shows `saved · not connected`, `connected — <label>`, or `error: <short>` - NO_COLOR frame: `·` bullets + username visible, password masked — distinguishable without color - Password never leaks: WalletConfig::secret() redaction on every status line, status note, alert, and help string - Key handling: F7 from main and wallet screens, Esc back, Tab cycles RpcUrl->RpcLogin->NoSpend->Action, Enter on action fires t/s **Redraw draw_wallet_setup / draw_chain_setup:** - CreateWarn (SPEND_AUTHORITY_WARNING + type SPEND) -> CreatePass (1st/2nd) -> CreateSeed (SEEN challenge) -> ImportSeed -> ImportPass - spend-authority warning is unavoidable at create time, not dismissible - Zeroizing<String> buffers zeroized on submit, mismatch, and Esc **Help + footer:** - help_overlay_text updated with F6 h, F7, copy key - tui_chrome.rs needle list extended (F6 h, F7 added, no needles removed) **Docs reconciled:** - README.md TUI key table: added F6 s, F6 n, F6 h, F7 rows - docs/WALLET.md: wallet-screen paragraph updated for F6 h - docs/TUI.md: Deliverable 5 marked implemented, after frames for each config state ## Verification ``` cargo test --locked # 0 failures across all targets cargo clippy --locked --all-targets -- -D warnings # clean ``` ## Frame evidence (real draw_wallet_config via TestBackend) ### 80x24 — idle, rpc_url focused, no_spend on ``` ┌wallet config─────────────────────────────────────────────────────────────────┐ │> rpc_url │ │ http://127.0.0.1:33383 │ │ │ │ rpc_login │ │ bitcoinrpc:•••••••••••••• [reveal] │ │ │ │ no_spend │ │ [x] /tip off │ │ │ │ action │ │ t test connection s save │ │ Esc back Tab fields │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ ``` ### 80x24 — testing connection (focus on action) ``` ┌wallet config─────────────────────────────────────────────────────────────────┐ │ rpc_url │ │ │ │ │ │ rpc_login │ │ ••••••• [reveal] │ │ │ │ no_spend │ │ [ ] /tip off │ │ │ │> action │ │ t test connection s save │ │ Esc back Tab fields │ │ │ │--- │ │testing connection … │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ ``` ### 80x24 — tested-fail, NO_COLOR ``` +wallet config-----------------------------------------------------------------+ | rpc_url | | http://127.0.0.1:33383 | | | | rpc_login | | bitcoinrpc:·············· [reveal] | | | | no_spend | | [x] /tip off | | | | action | | t test connection s save | | Esc back Tab fields | | | |--- | |! not connected — not connected · connection refused | | | | | | | | | | | | | +------------------------------------------------------------------------------+ ``` ### 80x24 — masked vs revealed, NO_COLOR (distinguishable without color) ``` masked: bitcoinrpc:·············· [reveal] revealed: bitcoinrpc:·············· [hide] ``` The word `[reveal]` vs `[hide]` distinguishes state in NO_COLOR; the dots never show the password. ### 120x40 — idle, no_spend on ``` ┌wallet config──────────────────────────┐ │> rpc_url │ │ http://127.0.0.1:33383 │ │ │ │ rpc_login │ │ bitcoinrpc:•••••••••••••• [reveal] │ │ │ │ no_spend │ │ [x] /tip off │ │ │ │ action │ │ t test connection s save │ │ Esc back Tab fields │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───┘ ``` ### Wallet setup screen — CreateWarn (spend-authority warning unavoidable) The SPEND_AUTHORITY_WARNING text is the body; user types `SPEND` to confirm, Esc to cancel. Zeroizing buffers wipe on Esc/mismatch/submit. ### README key table — before/after Before (base): | F6 | Wallet screen (address, chain, transfers) | | F6 s | Chain source: receive-only / local / remote | | F6 n | Start or stop the app-owned daemon | After: | F6 | Wallet screen (address, chain, transfers) | | F6 s | Chain source: receive-only / local / remote | | F6 n | Start or stop the app-owned daemon | | F6 h | Show receive address / seed phrase | | F7 | Wallet config (RPC URL, login, spend) | ### Password leak guard proof `wallet_config_password_never_leaks_in_any_status` renders all config states with `user:supersecret123` as the login and asserts FIXTURE_PASS is absent from the frame. The redaction path: ConfigStatus::line() calls wallet::redact(e, WalletConfig::new("", login, false).secret()) — the password is replaced with <redacted> before any status text is assembled. ## Changed files - src/tui.rs: WalletConfigScreen, ConfigField, ConfigStatus (Default derived), draw_wallet_config, handle_wallet_config, footer hints, help overlay - tests/tui_spec.rs: 7 new tests for config screen - tests/tui_chrome.rs: F6 h and F7 needles added - docs/TUI.md: after frames for config states, Deliverable 5 marked implemented - docs/WALLET.md: wallet-screen paragraph reconciled with F6 h - README.md: F6 h and F7 added to TUI key table
tui: F7 wallet config screen + wallet/chain setup redesign + doc sync
All checks were successful
ci / test (pull_request) Successful in 4m24s
ci / sdk (pull_request) Successful in 1m19s
04d9f436e5
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.
sirius force-pushed wt/t_7719eda3 from 04d9f436e5
All checks were successful
ci / test (pull_request) Successful in 4m24s
ci / sdk (pull_request) Successful in 1m19s
to ad5a3ae68e
All checks were successful
ci / test (pull_request) Successful in 4m27s
ci / sdk (pull_request) Successful in 1m14s
2026-09-16 04:26:34 +00:00
Compare
sirius force-pushed wt/t_7719eda3 from ad5a3ae68e
All checks were successful
ci / test (pull_request) Successful in 4m27s
ci / sdk (pull_request) Successful in 1m14s
to cee53cfd73
All checks were successful
ci / test (pull_request) Successful in 4m0s
ci / sdk (pull_request) Successful in 57s
2026-09-16 04:28:08 +00:00
Compare
sirius merged commit 750ea92663 into feat/wallet-create-import 2026-09-16 04:39:43 +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!84
No description provided.