feat(tui): fail-closed footer, 1-line header, help overlay #24

Merged
sirius merged 3 commits from wt/t_0d3b0f80 into main 2026-09-12 04:25:07 +00:00
Owner

Summary

  • status_footer never drops send failed: / status_note; TOR, me:, ? help still present at 80 and 120.
  • Main at 80x24: 1-line header (not the 3-line wordmark), roster 22 cells, chat primary, composer unboxed with message placeholder, > + bold for focus.
  • Empty roster is a list item no friends.
  • Help at height < 28 is full-screen; last line Esc closes this overlay is visible. Height ≥ 28 is a centered overlay after a full-area Clear (no punch-through).
  • RGB accent kept; 16-color map + NO_COLOR (no fg/bg, weight/glyphs only).
  • Roster names truncate with ellipsis.
  • Calls landed sanitize::display_text on chat and roster names.

Presentation only. docs/PROTOCOL.md unchanged. No new crates.

Review round 2

PR #23 is on main (53f9914). This branch merges that and flips tests/tui_frames.rs status_footer_drops_send_failed_when_crowded so send failed is present at 80, 120, and 200, with TOR / me: / ? help. Head: 7d3e1bd.

Follow-up t_b02176dc owns spacing unit, ASCII/glyph fallback, alert+invite wrap, remaining state copy.

Proof

  • cargo test --locked — green locally (3 ignored live-Tor tests)
  • cargo clippy --locked --all-targets -- -D warnings — green
  • git diff --stat origin/main: src/tui.rs + tests/tui_spec.rs + tests/tui_frames.rs + docs/TUI.md

After frames (TestBackend, dump_spec_frames)

80x24 main (fail-closed visible, 1-line header, roster ~22, composer no box)

onionwire  tor  me:abcdef01  onion:abcdefgh                                     
┌roster 0────────────┐┌  chat──────────────────────────────────────────────────┐
│alice  aaaaaaaa…    ││no friends yet                                          │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
│                    ││                                                        │
└────────────────────┘└────────────────────────────────────────────────────────┘
> hello from composer                                                           
                                                                                
                                                                                
send failed: peer onion down TOR  me:abcdef01… onion:abcdefgh… F5 Ctrl-Q ? help 

Reconstructed (App private). Footer line is the real status_footer helper.

80x24 help (full-screen, last line visible, no punch-through)

┌? help────────────────────────────────────────────────────────────────────────┐
│OnionWire keys                                                                │
│                                                                              │
│Tab / Shift-Tab   cycle roster, chat, composer                                │
│1 / 2 / 3         focus roster / chat / composer                              │
│j k  or  Up Down  move or scroll focused pane                                 │
│g / G             jump to top / bottom                                        │
│Enter             send chat to selected friend, or a /command                 │
│Esc               close overlay, go back, clear composer                      │
│F2                share invite                                                │
│F3                paste invite                                                │
│F4                rotate onion locator                                        │
│F5                selected friend's profile (/who)                            │
│/profile          edit name, bio, Monero address                              │
│/pay <xmr> [memo] invoice to receive                                          │
│/tip <xmr> [memo] pay selected friend                                         │
│/file /path        send file to selected friend (1 MiB)                       │
│/backup /path     encrypted identity export                                   │
│/restore /path    overwrite self keys                                         │
│?                 this help                                                   │
│Ctrl-Q            quit; type CLEAR or QUIT                                    │
│                                                                              │
│Esc closes this overlay                                                       │
└──────────────────────────────────────────────────────────────────────────────┘

Real draw_text_overlay.

120x40 main

1-line header, roster 28 cells, send failed: kept with TOR / me: / ? help. Chat is the leftover (primary) pane.

onionwire  tor  me:abcdef01  onion:abcdefgh                                                                             
┌roster 0──────────────────┐┌  chat────────────────────────────────────────────────────────────────────────────────────┐
│alice  aaaaaaaa…          ││no friends yet                                                                            │
└──────────────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘
> hello from composer                                                                                                   
send failed: peer onion down  TOR  me:abcdef01…  onion:abcdefgh…  Tab F2 F3 F4 F5 Ctrl-Q  ? help                        

(Full 40-row dump: cargo test --locked --test tui_spec dump_spec_frames -- --nocapture)

Locked helpers

banner_for_width(80) is still the 3-line wordmark (tui_chrome). Main does not use it as the 24-row header (main_header_line instead).

## Summary - `status_footer` never drops `send failed:` / `status_note`; `TOR`, `me:`, `? help` still present at 80 and 120. - Main at 80x24: 1-line header (not the 3-line wordmark), roster 22 cells, chat primary, composer unboxed with `message` placeholder, `> ` + bold for focus. - Empty roster is a list item `no friends`. - Help at height < 28 is full-screen; last line `Esc closes this overlay` is visible. Height ≥ 28 is a centered overlay after a full-area Clear (no punch-through). - RGB accent kept; 16-color map + `NO_COLOR` (no fg/bg, weight/glyphs only). - Roster names truncate with ellipsis. - Calls landed `sanitize::display_text` on chat and roster names. Presentation only. `docs/PROTOCOL.md` unchanged. No new crates. ## Review round 2 PR #23 is on `main` (53f9914). This branch merges that and flips `tests/tui_frames.rs` `status_footer_drops_send_failed_when_crowded` so `send failed` **is** present at 80, 120, and 200, with `TOR` / `me:` / `? help`. Head: `7d3e1bd`. Follow-up `t_b02176dc` owns spacing unit, ASCII/glyph fallback, alert+invite wrap, remaining state copy. ## Proof - `cargo test --locked` — green locally (3 ignored live-Tor tests) - `cargo clippy --locked --all-targets -- -D warnings` — green - `git diff --stat origin/main`: `src/tui.rs` + `tests/tui_spec.rs` + `tests/tui_frames.rs` + `docs/TUI.md` ## After frames (TestBackend, `dump_spec_frames`) ### 80x24 main (fail-closed visible, 1-line header, roster ~22, composer no box) ``` onionwire tor me:abcdef01 onion:abcdefgh ┌roster 0────────────┐┌ chat──────────────────────────────────────────────────┐ │alice aaaaaaaa… ││no friends yet │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ └────────────────────┘└────────────────────────────────────────────────────────┘ > hello from composer send failed: peer onion down TOR me:abcdef01… onion:abcdefgh… F5 Ctrl-Q ? help ``` Reconstructed (`App` private). Footer line is the real `status_footer` helper. ### 80x24 help (full-screen, last line visible, no punch-through) ``` ┌? help────────────────────────────────────────────────────────────────────────┐ │OnionWire keys │ │ │ │Tab / Shift-Tab cycle roster, chat, composer │ │1 / 2 / 3 focus roster / chat / composer │ │j k or Up Down move or scroll focused pane │ │g / G jump to top / bottom │ │Enter send chat to selected friend, or a /command │ │Esc close overlay, go back, clear composer │ │F2 share invite │ │F3 paste invite │ │F4 rotate onion locator │ │F5 selected friend's profile (/who) │ │/profile edit name, bio, Monero address │ │/pay <xmr> [memo] invoice to receive │ │/tip <xmr> [memo] pay selected friend │ │/file /path send file to selected friend (1 MiB) │ │/backup /path encrypted identity export │ │/restore /path overwrite self keys │ │? this help │ │Ctrl-Q quit; type CLEAR or QUIT │ │ │ │Esc closes this overlay │ └──────────────────────────────────────────────────────────────────────────────┘ ``` Real `draw_text_overlay`. ### 120x40 main 1-line header, roster 28 cells, `send failed:` kept with `TOR` / `me:` / `? help`. Chat is the leftover (primary) pane. ``` onionwire tor me:abcdef01 onion:abcdefgh ┌roster 0──────────────────┐┌ chat────────────────────────────────────────────────────────────────────────────────────┐ │alice aaaaaaaa… ││no friends yet │ └──────────────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘ > hello from composer send failed: peer onion down TOR me:abcdef01… onion:abcdefgh… Tab F2 F3 F4 F5 Ctrl-Q ? help ``` (Full 40-row dump: `cargo test --locked --test tui_spec dump_spec_frames -- --nocapture`) ## Locked helpers `banner_for_width(80)` is still the 3-line wordmark (`tui_chrome`). Main does **not** use it as the 24-row header (`main_header_line` instead).
feat(tui): keep fail-closed footer, flatten main chrome
All checks were successful
ci / test (pull_request) Successful in 4m48s
0749d2300a
status_footer never drops send failed / status_note; TOR, me:, and ? help
still fit at 80 and 120. Main at 24 rows uses a one-line header, a 22-cell
roster, chat as the primary pane, and an unboxed composer with a message
placeholder. Help at height < 28 is full-screen so Esc closes this overlay
is visible. Palette maps RGB to 16-color and NO_COLOR (glyphs/weight only).

Do not include docs/TUI.md or tests/tui_frames.rs (PR #23).
test(tui): keep send-failed visible in crowded status_footer
All checks were successful
ci / test (pull_request) Successful in 3m5s
7d3e1bd627
PR #23 locked the old drop. Flip status_footer_drops_send_failed_when_crowded
to assert the note stays at 80/120/200 with TOR, me:, and ? help.
Author
Owner

Review round 2 (changes requested): merged origin/main (PR #23 / 53f9914) and flipped status_footer_drops_send_failed_when_crowded.

RED: old lock panicked 80 still has room? "send failed: peer onion down TOR me:abcdef01… onion:abcdefgh… F5 Ctrl-Q ? help"
GREEN: test now asserts send failed + TOR + me: + ? help at 80/120/200; line length ≤ width.

Head 7d3e1bd. Files vs origin/main: src/tui.rs tests/tui_spec.rs tests/tui_frames.rs docs/TUI.md.

Local: cargo test --locked green (3 ignored live-Tor). cargo clippy --locked --all-targets -- -D warnings green.

80x24 after footer (real status_footer):
send failed: peer onion down TOR me:abcdef01… onion:abcdefgh… F5 Ctrl-Q ? help

Did not expand into t_b02176dc (spacing/ASCII/wrap/remaining copy).

Review round 2 (changes requested): merged `origin/main` (PR #23 / 53f9914) and flipped `status_footer_drops_send_failed_when_crowded`. RED: old lock panicked `80 still has room? "send failed: peer onion down TOR me:abcdef01… onion:abcdefgh… F5 Ctrl-Q ? help"` GREEN: test now asserts `send failed` + `TOR` + `me:` + `? help` at 80/120/200; line length ≤ width. Head `7d3e1bd`. Files vs `origin/main`: `src/tui.rs` `tests/tui_spec.rs` `tests/tui_frames.rs` `docs/TUI.md`. Local: `cargo test --locked` green (3 ignored live-Tor). `cargo clippy --locked --all-targets -- -D warnings` green. 80x24 after footer (real `status_footer`): `send failed: peer onion down TOR me:abcdef01… onion:abcdefgh… F5 Ctrl-Q ? help` Did not expand into t_b02176dc (spacing/ASCII/wrap/remaining copy).
sirius merged commit 33beeded92 into main 2026-09-12 04:25:07 +00:00
sirius deleted branch wt/t_0d3b0f80 2026-09-12 04:25:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!24
No description provided.