Merge branch 'main' into onionwire/t_af8b509e-onionwire-tui-invite-mouse-copy-must-not
All checks were successful
ci / test (pull_request) Successful in 5m17s
ci / sdk (pull_request) Successful in 1m11s
ci / fuzz (pull_request) Successful in 4m52s
android-ci / android (pull_request) Successful in 12m17s

This commit is contained in:
sirius 2026-09-19 14:46:33 +00:00
commit 87196e2297
7 changed files with 1435 additions and 52 deletions

View file

@ -653,7 +653,8 @@ fires it, including the F6 wallet screen's own keys (`F6 c`, `F6 i`, `F6 r`,
| WALLET | sync | chain readiness word (`chain at tip · wallet answering`, `wallet answering · chain not at tip`, `wallet RPC not answering yet`, `child exited`, `not probing · no chain source`) | `F6 p` |
| WALLET | receive | the receive address (truncated) or `no address yet · wallet unreachable` | `c copy` / `F6 r` |
| WALLET | balance | `{xmr}` / `off` / `err` | `F6` |
| WALLET | payments | `{n} recent` / `no transfers yet` | `F6` |
| WALLET | transfers | `{n} recent` / `no transfers yet` — the wallet's **own** transfer list | `F6` |
| WALLET | payments | `{n} with {peer}` / `no history with {peer}` / `no friend selected` / `history unreadable · {peer}` — the **peer's** payment rows | `p` |
| WALLET | create | `/wallet create · seed shown once` | `F6 c` |
| WALLET | import | `/wallet import · 25-word seed` | `F6 i` |
| SETTINGS | nickname | the self-profile name, or `(none)` | `/profile` |
@ -665,7 +666,13 @@ fires it, including the F6 wallet screen's own keys (`F6 c`, `F6 i`, `F6 r`,
| SETTINGS | wipe | `messages · identity and friends stay` | `/wipe` |
| SETTINGS | wipe-all | `deletes your identity key · new person` | `/wipe-all` |
19 rows at 80x24 against 21 available inner rows: nothing clips or scrolls.
20 rows at 80x24 against 21 available inner rows: nothing clips or scrolls.
`transfers` and `payments` are deliberately two rows: `transfers` is the
wallet's own list (`Node::wallet_recent_transfers`, F6), `payments` is the
peer-scoped history (`Node::list_payments`, `p`). Signed `/pay` invoices and
`/tip` receipts a peer sent never appear in the wallet's own transfers, so the
two histories are not interchangeable and the menu names both.
### Guarantees
@ -699,12 +706,86 @@ sibling-card work, not presentation:
`Node::wallet_test_connection(..)` — the endpoint config screen is F7 on
`feat/wallet-create-import`; the menu shows the endpoint's *state* and leaves
the key free.
- Peer payment history — `store.list_payments(..)` has no `Node` accessor, so
the menu can only offer the wallet's own transfer list (F6).
- Peer payment history — **closed by this screen.** `Node::list_payments` exists
on `main`; the `payments` row (key `p`) opens the peer-scoped history, and the
row is distinct from the wallet's own transfer list (`transfers`, F6).
- `Node::set_wallet_child_config(cfg)` — the child can be started/stopped and
probed, not edited.
- `Node::set_petname(..)` — no petname editor exists.
## Peer payment history (F9 → `payments`, key `p`)
A screen, not a popup, and peer-scoped: it renders what
`Node::list_payments(&friend_pk)` returns for the chat's selected friend, so the
signed `/pay` invoices and `/tip` receipts a peer sent are visible even though
they never appear in the wallet's own transfer list (F6). The call takes the
store lock only — no Tor dial, no wallet RPC — so it is safe while offline or
while Arti is still bootstrapping, and an empty result (`Ok(vec![])`) is the
**no history** state, never an error.
```
cargo test --locked --test tui_payments -- --nocapture peer_payments_frame_dumps
```
dumps the screen at 80x24, 120x40 and 200x60, populated and empty.
### Layout
```
dir kind amount XMR receipt memo
> in receipt 0.025 verified lunch money
out tip 0.005 coffee
out invoice 0.1 rent
tx 3f2a91c0d9e4b7a2c1f0e8d7b6a5948372615041324758697a8b9c0d1e2f3041
addr 4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYJKUGVktfzxayGbMW
aC8iqPUE9XUBFGrLyDz4DpEBM
```
- Rows are **newest first**: `payments.id` ascending is oldest first, so
`PeerPaymentsState::from_payments` reverses it and the render path windows the
result. Rows outside the window are counted in an explicit `… N older` /
`… N newer` line — nothing is dropped silently.
- The focused row is marked with `>` **and** bold, so focus survives a
monochrome terminal. `up`/`down` (or `k`/`j`) move it, `Esc` returns to the
main screen, `F9` reopens the menu.
- `F9` is honoured **while this screen is open**, not only from the main screen:
the function-key table (`function_key_for`) answers it from `Main`,
`WalletsSettings` and `PeerPayments` alike, so the hint the screen prints
cannot be a no-op there. `peer_payments_footer_hint()` is the single place that
hint string is written, and the frame-dump fixture is driven from it — a dumped
frame cannot show a footer the app does not render.
- The selected row's `tx` and `addr` are spelled out under the rows: a 64-hex
txid is unusable truncated, and a 95-character base58 address is **wrapped**
over two lines rather than clipped to a prefix.
- Amounts use `pay::atomic_to_xmr_str`, the same piconero formatter the chat
lines use; the XMR unit is stated once, in the column header.
- Columns are dropped from the right when the pane is narrower than they need,
so no row can wrap or overrun at any width — not just at 80.
### States
| State | Frame |
|---|---|
| populated | the rows, plus the selected row's `tx` / `addr` |
| empty | `no payments with {peer}` and `invoices, receipts and tips from this peer land here` |
| read failed | `could not read payments` plus the sanitized reason — never a blank pane |
| no friend selected | the menu row refuses before the screen opens (`no friend selected` in the status line) |
### Guarantees
- **Memo is peer-signed text, sanitized at draw time.** `Node::list_payments`
returns `memo` as stored; the row goes through the same
`menu_cell_text`-then-`fit_cells` path the F9 menu uses, so C0/C1 controls,
ESC, bidi marks and newlines cannot reach the frame buffer or split a row.
`tests/tui_payments.rs` asserts a hostile memo (ESC, BEL, C1, bidi, newline)
never appears in a rendered frame.
- **Only receipts carry `verified`.** The flag column prints `verified` /
`unverified` for receipts and stays blank for invoices and tips, which have no
signature to check; `unverified` also takes the warn tone, so colour is never
the only signal.
- **Read-only.** The screen reads one getter and draws; it cannot send, sign or
dial.
## Clean-look chrome redesign — implemented
The main screen was restructured around one accent, one primary pane and honest