tui: a fresh install must not open on the Monero spend-authority warning #162
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
App::newnow starts a fresh install (empty wallet catalogue) onScreen::Maininstead of
WalletSetup::CreateWarn. Nothing has been created yet, so there isno spend authority to warn about; the warning belongs to the moment a user
commits to creating a wallet, and every one of those entry points is untouched:
/wallet create(src/tui.rs:1579)ckey+ create new walletrow on the wallet listEach still routes into
WalletSetup::CreateWarn, andSPEND_AUTHORITY_WARNING(src/wallet.rs:487, locked by docs/payment-integration-plan.md:243) is unchanged.
The non-empty catalogue branch (a restart lands on the wallets it remembers) and
the
Err(e)branch (store unreadable) are unchanged.Tests (src/tui.rs
mod wallet_store_tests)a_fresh_install_starts_on_main_not_the_spend_warning(replacesan_install_with_no_wallet_starts_on_the_create_flow): asserts the screen isScreen::Mainand that the first frame drawn through the realApp::drawpath at 80x24 does not carry the warning string (whitespace-collapsed, so a
wrapped sentence still matches).
the_create_flow_is_still_reachable_and_still_warns: drives/wallet createon a fresh install, asserts the screen is
CreateWarnand that the warning isin the rendered body.
an_install_with_wallets_starts_on_the_list_read_from_the_catalogueisunchanged and still passes (2 rows, catalogue fields).
a_wallet_recorded_after_startup_appears_the_next_time_the_list_openshad oneline asserting the old start screen on a fresh install; it now asserts
Screen::Main. Its subject (the list is read when the screen opens, nevercached) is unchanged and the rest of the test is untouched.
First frame, fresh install, 80x24, through App::draw
(Box-drawing glyphs shown as
+/-; the real frame uses the unicode chrome.)No
this wallet file can spendanywhere on it.Finding filed, not fixed (out of this card's Allowed scope)
draw_text_overlaysizes the popup from the body's logical line count and thenscrolls to
wrapped - inner_h, so on the create screen the 184-character warningis always partially scrolled off: at 80x24 the frame shows only its last word
(
trust.) aboveType SPEND to confirm; at 100x40 it shows only the finalsentence. The whole warning only fits when it wraps to one visual row. That is a
separate rendering defect against the same locked "unavoidable at wallet
creation" decision - filed as its own card rather than changed here, because this
card's Allowed scope is the start-screen match. The second create-flow assertion
is written against that reality: the standard frame must carry warning copy, the
full sentence is asserted on a 200x60 frame.
Pre-existing flake observed (not mine, not touched)
tests/tui_spec.rs::alert_line_prefixes_when_no_colorfails intermittently(1 run in 12 of the tui_spec binary alone, and once in a full
cargo testbeforethe green rerun below) because it flips the process-global
NO_COLORenv varwhile other tests in the same binary set/remove it. Unrelated to this diff
(nothing here touches colour mode or env); filed separately.
Evidence
rustfmt --edition 2024 --check src/tui.rsreports the same 16 inherited hunks asHEAD:src/tui.rs; this diff adds none. Base verifieda1f5c878d39e30916257ad041eef71676eb8508c.