tui: wallet selection screen (F6 -> w) with create as the last row #142
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_14ac0a3f"
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
Adds the wallet selection screen:
Screen::WalletSelect, reachable withF6thenw.+ create new walletis the last item of the list — Enter on it starts the same create flow asF6c, so an empty list still has a way forwardj/kor arrows move, Enter takes the choice, Esc back to Main; the focused row carries>and bold, so focus survives a monochrome terminalCopy that was designed, not defaulted
no saved wallets yet/create one to get an identity and an onion addresscould not read saved wallets/<why>— neverno saved walletsreading saved wallets/one moment(create row stays live)(unlabelled)-unknown(not1970-01-01)Scope and the one seam
Presentation only. The rows are plain display data (
WalletRow); the render path never reads the store, exactly as the F9 menu and the peer-payment history do. Selection is by row index, never by identity key —Store::list_walletsmay return two records that share one.The store API from the schema card (
Store::list_wallets() -> Vec<WalletRecord>, PR #141) is not onmainyet, andNodehas no wallet-record accessor, soF6wcurrently opens the screen on its unavailable state (could not read saved wallets/the wallet store is not wired up yet) rather than fabricating a list. Thecreate new walletrow is real today either way.WalletRowdocuments the mapping the integration card needs:name: r.name.unwrap_or_default(),identity_pubkey: hex(r.identity_pubkey)([u8; 32]),onion_locator: r.onion_locator,created_at: r.created_at. WiringApp::open_wallet_select(one call site) replaces the unavailable state withWalletSelectState::from_rows(...); loading a chosen record into the session, and starting the app on this screen, ist_895853ad(rust-dev) — as its own card body already says.Evidence
cargo test --locked— 35 test binaries, 0 failures.cargo clippy --locked --all-targets -- -D warnings— clean.New suite (
tests/tui_select.rs), all of it drawn through the realdraw_wallet_selectpath onTestBackend:wallet_select_frame_shows_the_shipped_footerpins the dumped frame's last line tostatus_footer_phased(w, fp, onion, Some(TorPhase::Ready), None, wallet_select_footer_hint())— the same calls the app makes, so the dump cannot show a footer the app does not renderwallet_select_frames_fit_at_the_three_sizes+wallet_select_columns_drop_before_they_wrap(a sweep from 20 to 200 columns, measured in cells viaSpan::width, neverchars().count()): trailing columns drop instead of wrapping, and 200x60 shows the identity and locator untruncatedwallet_select_marks_exactly_one_row_and_puts_create_last,wallet_select_windows_a_long_list_and_keeps_create_visible(40 rows:… N below/… N above, create row never falls off)wallet_select_hostile_label_cannot_reach_the_terminal: ESC/BEL/C1/bidi/newline/tab in a label do not reach the frame and do not split a rowformat_day_utc_covers_the_calendar_edges: epoch, leap day (2000-02-29), far future — hand-rolled (no date crate;unicode-widthwas not added either)the_wallet_select_screen_answers_no_function_key_it_does_not_name(in-crate): the screen's hint names noF<n>, so it answers noneNo existing test was rewritten:
tests/tui_chrome.rs,tests/tui_frames.rs,tests/tui_payments.rsandtests/tui_spec.rspass untouched.After — 80x24 (unicode chrome)
Frame dumps:
cargo test --locked --test tui_select -- --nocapture wallet_select_frame_dumps(three sizes × {two wallets, empty, failed read}; the PR comment carries the 120x40 and 200x60 dumps and the same frames under
ONIONWIRE_ASCII=1).After — the empty state (first run, 80x24)
Before / after on the
F6wallet screenNothing about the wallet screen changed except its footer, which now names the new key:
(
status_footer_innerdrops hint tokens from the front when the width is tight, sow walletsis placed where it survives rather than in the part that gets cut at 80 columns.)Files
src/tui.rs— the screen (state, grid, windowing, detail strip, states),Screen::WalletSelect, key routing, draw dispatch,F6wtests/tui_select.rs— the new suitedocs/TUI.md— screen table, theF6wkey, a section on the screen, the dump commandFrame dump — 120x40, unicode chrome, two wallets
Frame dump — 200x60 (first 10 rows of the box; the full frame is in the dump below)
Frame dump — 80x24 under
ONIONWIRE_ASCII=1(no box/block glyphs,...ellipsis)Frame dump — failed read at 80x24 (a different state from
no saved wallets, and the create row stays)Toolchain output
Every frame above came out of
draw_wallet_selectonTestBackend, so the footer on the last line is the app's ownstatus_footer_phasedoutput withwallet_select_footer_hint()— the same single source the test pins it to.CI on
99a4ab6— all greenThe
ci / testjob is the aarch64 one that matters for this change: it runscargo test --lockedpluscargo clippy --locked --all-targets -- -D warningson the same commit this PR would merge. Combined status: success.