tui: F9 works on the peer-payments screen, and frames dump the real footer
Some checks failed
ci / test (pull_request) Successful in 6m33s
ci / sdk (pull_request) Successful in 1m31s
ci / fuzz (pull_request) Successful in 4m49s
android-ci / android (pull_request) Has been cancelled

Review round 1 on the F9 `payments` row found two false affordances.

1. `footer_hints(Screen::PeerPayments)` prints `F9 menu`, and docs/TUI.md says
   F9 reopens the menu, but the `KeyCode::F(9)` arm opened it only from
   `Screen::Main`, so pressing F9 on the peer history did nothing.

   The function keys are now routed through one table, `function_key_for(screen,
   code)`, and the F9 arm no longer has the Main-only guard: it opens (or
   reopens) the menu from `Main`, `WalletsSettings` and `PeerPayments`. A screen
   that names a key has to answer it while it is open — that is what the table
   encodes, and `mod function_key_tests` locks it, including a test that reads
   the screen's own hint and asserts every `F<n>` it names is answered there.

2. The PR's frame dumps passed `"Esc back  up/down select  ? help"` to
   `status_footer` by hand, so every dumped frame showed a footer the app never
   renders. `peer_payments_footer_hint()` is now the single source both
   `footer_hints` and the fixture read, and
   `peer_payments_frame_shows_the_shipped_footer` pins the dumped frame's last
   line to the shipped one.

Also restores the rustfmt-only reflow of unrelated tests in `tests/tui_spec.rs`
(`queued_row`, a `failed_row` call, `rgb_tokens_…`, `alert_line_…`), keeping this
card's real edits there.

Presentation only: no wire, store, session, send-path or `Node` change.
This commit is contained in:
agent 2026-09-19 00:31:42 -04:00
commit b8fefe9c18
No known key found for this signature in database
4 changed files with 185 additions and 54 deletions

View file

@ -429,14 +429,7 @@ fn pending_row(
}
fn queued_row(message_id: i64, body: &str, attempts: u32, next_in: i64, now: i64) -> OutboxEntry {
pending_row(
message_id,
body,
OutboxStatus::Queued,
attempts,
next_in,
now,
)
pending_row(message_id, body, OutboxStatus::Queued, attempts, next_in, now)
}
fn sending_row(message_id: i64, body: &str, now: i64) -> OutboxEntry {
@ -562,12 +555,7 @@ fn delivery_markers_have_exercised_ascii_fallbacks() {
in_msg(5, "epsilon"),
];
let pending = vec![
failed_row(
1,
"alpha",
"connect peer.onion:80: connection timed out",
now,
),
failed_row(1, "alpha", "connect peer.onion:80: connection timed out", now),
queued_row(2, "beta", 1, 30, now),
sending_row(3, "gamma", now),
];
@ -853,7 +841,9 @@ fn rgb_tokens_resolve_to_palette_fg() {
assert_eq!(t.highlight.fg, Some(Color::Rgb(232, 165, 75)));
assert_eq!(t.highlight.bg, Some(Color::Rgb(48, 42, 28)));
assert!(
t.highlight.add_modifier.contains(Modifier::BOLD),
t.highlight
.add_modifier
.contains(Modifier::BOLD),
"RGB highlight must be bold"
);
}
@ -916,10 +906,7 @@ fn alert_line_prefixes_when_no_color() {
let _guard = std::env::var_os("NO_COLOR");
unsafe { std::env::set_var("NO_COLOR", "1") };
let line = alert_line("peer down", 80);
assert!(
line.starts_with("! "),
"expected '! ' prefix in None mode: {line:?}"
);
assert!(line.starts_with("! "), "expected '! ' prefix in None mode: {line:?}");
unsafe {
match _guard {
Some(v) => std::env::set_var("NO_COLOR", v),