tui: the spend-authority warning is readable on a standard 80x24 terminal #163
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/t_c6ec1508-onionwire-tui-the-create-wallet-spend-au"
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?
draw_text_overlaysized its popup from the body's logical line count, so the184-char
SPEND_AUTHORITY_WARNING(one logical line, three wrapped rows at 80 columns,plus the blank, the
Type SPEND to confirmprompt and the typed buffer) got a 6-rowpopup with a 4-row body box. The scroll-to-tail then left only
on a standard 80x24 terminal: the sentence that makes the spend warning a warning was
off screen at every terminal size except 200x60.
Fix
Height now comes from the body's wrapped row count plus the border rows, capped by
the frame; width is unchanged.
scroll = wrapped - inner_htherefore stays 0 wheneverthe body fits, and a body that still cannot fit the frame scrolls to its tail exactly as
before (
? helpon 80x24 is unchanged: 30 rows, frame-capped, tail visible — its pintests/tui_spec.rs::help_overlay_at_80x24_is_fullscreen_last_line_visibleandtests/tui_frames.rs::help_overlay_keeps_a_margin_and_shows_the_tailstill pass).Nothing about the warning moved:
SPEND_AUTHORITY_WARNINGis byte-identical,WalletSetup::CreateWarnis still the only screen it is drawn on, and it is still notdismissible.
The 80x24 frame the create flow now draws:
Test
src/tui.rs::tui::wallet_store_tests::the_create_flow_is_still_reachable_and_still_warns(the test this defect forced to run its full-sentence assertion on a 200x60 frame) now
asserts the whole warning and
Type SPEND to confirmon the 80x24 frame drawnthrough
App::draw, and keeps the 200x60 check. It is RED on the parent commit (theframe printed only
trust.) and green after the one-function change.New helper
unframed: a wrapped sentence has the popup's side border glyph between itsrows, so whole-frame whitespace flattening cannot see
...you do not <border> trust.asone sentence. It blanks the box-drawing cells; the copy is what is asserted.
Evidence
rustfmt hunks on
src/tui.rs: 16 before, 16 after (all inherited; only one context linediffers), so this commit adds no formatting churn.
Base
Stacked on
onionwire/t_6aa61cf8-onionwire-tui-a-fresh-install-must-not-o(PR #162),because the assertion being tightened is that PR's test. Retarget this PR to
mainonce#162 merges; no merge conflict is expected (this diff is
draw_text_overlayplus thatone test function).