tui: settings-menu frame dumps use the footer the app renders
The same defect as the peer-payments fixture, one screen over: after the clean-look chrome redesign (now merged) `App::draw` renders the F9 menu's one status line with `status_footer_phased` and the hint from `footer_hints`, while `tests/tui_spec.rs::render_menu` still built a phase-free `status_footer` from a hand-copied hint string — so every menu frame in the PR body showed a footer the app does not draw (no Tor phase). - `wallets_settings_footer_hint()` is now the single source for that hint, the way `peer_payments_footer_hint()` is for the history screen. - `render_menu` makes the app's own two calls, `TorPhase::Ready` for the healthy-wallet state the fixture describes. - `wallets_settings_menu_frame_shows_the_shipped_footer` pins the dumped frame's last line to the shipped one (RED first: the fixture's line read `TOR me:… Esc back c copy ? help`, the app's `✓ TOR ready me:…`). `cargo test --locked` 384 passed / 0 failed, clippy clean.
This commit is contained in:
parent
e9b4156cf5
commit
c1d13178b6
2 changed files with 49 additions and 5 deletions
12
src/tui.rs
12
src/tui.rs
|
|
@ -3162,7 +3162,7 @@ match screen {
|
|||
}
|
||||
Screen::WalletSetup(WalletSetup::CreateSeed { .. }) => "type SEEN Esc cancel ? help",
|
||||
Screen::WalletSetup(WalletSetup::ImportSeed { .. }) => "paste seed Enter Esc ? help",
|
||||
Screen::WalletsSettings { .. } => "Esc back c copy ? help",
|
||||
Screen::WalletsSettings { .. } => wallets_settings_footer_hint(),
|
||||
Screen::PeerPayments { .. } => peer_payments_footer_hint(),
|
||||
Screen::Quit { .. } => "CLEAR or QUIT then Enter Esc cancel ? help",
|
||||
}
|
||||
|
|
@ -3177,6 +3177,16 @@ pub fn peer_payments_footer_hint() -> &'static str {
|
|||
|
||||
const PEER_PAYMENTS_FOOTER_HINT: &str = "Esc back up/down select F9 menu ? help";
|
||||
|
||||
/// The hint line the WALLETS & SETTINGS menu prints, single-sourced for the
|
||||
/// same reason as [`peer_payments_footer_hint`]: the menu's frame-dump fixture
|
||||
/// must not hand-copy it (and must not pair it with the phase-free footer the
|
||||
/// app stopped using when the chrome redesign landed).
|
||||
pub fn wallets_settings_footer_hint() -> &'static str {
|
||||
WALLETS_SETTINGS_FOOTER_HINT
|
||||
}
|
||||
|
||||
const WALLETS_SETTINGS_FOOTER_HINT: &str = "Esc back c copy ? help";
|
||||
|
||||
fn apply_chrome_borders(block: Block<'_>) -> Block<'_> {
|
||||
let block = block.borders(Borders::ALL);
|
||||
if ascii_chrome() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue