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.
The F9 / `/settings` menu's only payment row showed the wallet's own transfer
list (`Node::wallet_recent_transfers`, F6). The signed `/pay` invoices and
`/tip` receipts a peer sent live in the `payments` table and had no path from
the TUI, so they were invisible. `Node::list_payments` (PR #119) closes that
gap; this wires it into a screen.
- `Screen::PeerPayments { state }` + `PeerPaymentsState` /
`PeerPaymentRow`, built by `PeerPaymentsState::from_payments` from
`Node::list_payments`' rows (newest first: the store returns `payments.id`
ascending, the screen windows the vector).
- Key handler: `p` on the F9 screen opens it (`open_peer_payments`); `up`/`down`
(or `k`/`j`) move the selection, `Esc` goes back, `F9` reopens the menu.
- Rows carry direction, kind, amount (`pay::atomic_to_xmr_str`, the same
piconero formatter the chat lines use), memo (sanitized at draw time) and the
receipt's `verified` / `unverified` word; the focused row is marked with `>`
and bold. The selected row's txid and address sit under the rows — the
address wrapped over two lines rather than clipped.
- States: populated, `no payments with {peer}`, `could not read payments`, and
a menu row that refuses when no friend is selected. An empty history is a
state, never an error.
- Menu: the wallet's own list is retitled `transfers` (F6, unchanged), and the
new `payments` row (key `p`) names the peer and the count. Two histories, two
rows, no ambiguity.
- Widths are measured in cells (`Span::width`); trailing columns are dropped
before they can wrap, so the body fits 80x24 (20 inner rows of 21) as well as
120x40 and 200x60.
Tests: new `tests/tui_payments.rs` (11 tests) dumps and asserts the screen at
80x24, 120x40 and 200x60 including the empty history, asserts a memo carrying
ESC/BEL/C1/bidi/newline bytes never reaches the frame buffer, and asserts the
window/column invariants for every width from 20 to 200.
Also relaxes one width assertion in `tests/tui_spec.rs`: `fit_cells` was
asserted to start with `"abcdef"`, which only holds when another test's
in-flight `ONIONWIRE_ASCII` mutation is not visible — the suite mutates env vars
without a global lock, so that test flaked (it also fails on an unmodified tree,
1 run in 2). It now accepts either chrome's cut point, which is what the comment
already claimed.
Docs: `docs/TUI.md` gains the screen's section, the retitled/replaced rows and
the updated row count; the "peer payment history" gap entry is closed.