feat(tui): ASCII chrome, invite wrap, remaining copy #27

Merged
sirius merged 1 commit from wt/t_b02176dc into main 2026-09-12 17:47:52 +00:00
Owner

Summary

Finish remaining docs/TUI.md items the parent card (PR #24) did not cover: 1-cell spacing (roster/chat boxed, composer/header/footer unboxed, overlays one box), ASCII glyph fallback, alert truncate, invite wrap at :, remaining empty-thread and paste-error copy.

Base: origin/main at 33beede (PR #24 already merged). This branch is not stacked on an unmerged parent.

Skipped optional 3-line wordmark at height ≥ 40 — it fights the 1-line header without buying hierarchy.

Commands

cargo test --locked
cargo clippy --locked --all-targets -- -D warnings

Both green locally. git diff --stat: src/tui.rs, tests/tui_spec.rs, docs/TUI.md only.

After frames

80x24 main (hierarchy unchanged from PR #24)

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

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

80x24 share — before (mid-token wrap, from docs/TUI.md)

┌(o) invite────────────────────────────────────────────────────────────────────┐
│give this string to a friend; they F3 paste it                                │
│                                                                              │
│fp  ea4a6c63…                                                                 │
│onion  abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion         │
│                                                                              │
│onionwire:v1:k=ea4a6c63e29c520abef5507b132ec5f9954776aebebe7b92421eea691446d22│
│c:o=abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion:spk=0101010│
│101010101010101010101010101010101010101010101010101010101:sig=46caf16b6da95e86│
│…                                                                             │
└──────────────────────────────────────────────────────────────────────────────┘

80x24 share — after (field boundaries; join lines = payload)

┌(o) invite────────────────────────────────────────────────────────────────────┐
│give this string to a friend; they F3 paste it                                │
│                                                                              │
│fp  ea4a6c63…                                                                 │
│onion  abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion         │
│                                                                              │
│onionwire:v1:                                                                 │
│k=ea4a6c63e29c520abef5507b132ec5f9954776aebebe7b92421eea691446d22c:           │
│o=abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion:             │
│spk=0101010101010101010101010101010101010101010101010101010101010101:         │
│sig=46caf16b6da95e86bf93a6ee80605ec74d9e24a419c4ef802632af74f46406fae9953690e0│
│5401b0af934cefea617f71466f406af4bef956847200a8e915190b                        │
└──────────────────────────────────────────────────────────────────────────────┘

80x24 ASCII (ONIONWIRE_ASCII=1) — no non-ASCII byte, marker is ...

+(o) invite--------------------------------------------------------------------+
|give this string to a friend; they F3 paste it                                |
|                                                                              |
|fp  ea4a6c63...                                                               |
|onion  abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion         |
|                                                                              |
|onionwire:v1:                                                                 |
|k=ea4a6c63e29c520abef5507b132ec5f9954776aebebe7b92421eea691446d22c:           |
|o=abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion:             |
|spk=0101010101010101010101010101010101010101010101010101010101010101:         |
|sig=46caf16b6da95e86bf93a6ee80605ec74d9e24a419c4ef802632af74f46406fae9953690e0|
|5401b0af934cefea617f71466f406af4bef956847200a8e915190b                        |
+------------------------------------------------------------------------------+

120x40 main after

Same 1-line header, 28-cell roster, unboxed composer, fail-closed footer kept. See dump command above.

Tests

  • ascii_switch_80x24_frame_is_pure_ascii fails if the switch is ignored (unicode box/… remain).
  • wrap_invite_breaks_on_field_boundaries / draw_share_invite_does_not_wrap_mid_token
  • alert_line_truncates_to_frame_width
  • empty_friend_chat_has_send_hint / paste_error_keeps_resubmit_hint

tests/tui_chrome.rs helper names and strings unchanged.

## Summary Finish remaining `docs/TUI.md` items the parent card (PR #24) did not cover: 1-cell spacing (roster/chat boxed, composer/header/footer unboxed, overlays one box), ASCII glyph fallback, alert truncate, invite wrap at `:`, remaining empty-thread and paste-error copy. **Base:** `origin/main` at `33beede` (PR #24 already merged). This branch is **not** stacked on an unmerged parent. Skipped optional 3-line wordmark at height ≥ 40 — it fights the 1-line header without buying hierarchy. ## Commands ``` cargo test --locked cargo clippy --locked --all-targets -- -D warnings ``` Both green locally. `git diff --stat`: `src/tui.rs`, `tests/tui_spec.rs`, `docs/TUI.md` only. ## After frames ### 80x24 main (hierarchy unchanged from PR #24) ``` 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 ``` (Full dump: `cargo test --locked --test tui_spec -- --nocapture dump_spec_frames`) ### 80x24 share — before (mid-token wrap, from docs/TUI.md) ``` ┌(o) invite────────────────────────────────────────────────────────────────────┐ │give this string to a friend; they F3 paste it │ │ │ │fp ea4a6c63… │ │onion abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion │ │ │ │onionwire:v1:k=ea4a6c63e29c520abef5507b132ec5f9954776aebebe7b92421eea691446d22│ │c:o=abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion:spk=0101010│ │101010101010101010101010101010101010101010101010101010101:sig=46caf16b6da95e86│ │… │ └──────────────────────────────────────────────────────────────────────────────┘ ``` ### 80x24 share — after (field boundaries; join lines = payload) ``` ┌(o) invite────────────────────────────────────────────────────────────────────┐ │give this string to a friend; they F3 paste it │ │ │ │fp ea4a6c63… │ │onion abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion │ │ │ │onionwire:v1: │ │k=ea4a6c63e29c520abef5507b132ec5f9954776aebebe7b92421eea691446d22c: │ │o=abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion: │ │spk=0101010101010101010101010101010101010101010101010101010101010101: │ │sig=46caf16b6da95e86bf93a6ee80605ec74d9e24a419c4ef802632af74f46406fae9953690e0│ │5401b0af934cefea617f71466f406af4bef956847200a8e915190b │ └──────────────────────────────────────────────────────────────────────────────┘ ``` ### 80x24 ASCII (`ONIONWIRE_ASCII=1`) — no non-ASCII byte, marker is `...` ``` +(o) invite--------------------------------------------------------------------+ |give this string to a friend; they F3 paste it | | | |fp ea4a6c63... | |onion abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion | | | |onionwire:v1: | |k=ea4a6c63e29c520abef5507b132ec5f9954776aebebe7b92421eea691446d22c: | |o=abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion: | |spk=0101010101010101010101010101010101010101010101010101010101010101: | |sig=46caf16b6da95e86bf93a6ee80605ec74d9e24a419c4ef802632af74f46406fae9953690e0| |5401b0af934cefea617f71466f406af4bef956847200a8e915190b | +------------------------------------------------------------------------------+ ``` ### 120x40 main after Same 1-line header, 28-cell roster, unboxed composer, fail-closed footer kept. See dump command above. ## Tests - `ascii_switch_80x24_frame_is_pure_ascii` fails if the switch is ignored (unicode box/`…` remain). - `wrap_invite_breaks_on_field_boundaries` / `draw_share_invite_does_not_wrap_mid_token` - `alert_line_truncates_to_frame_width` - `empty_friend_chat_has_send_hint` / `paste_error_keeps_resubmit_hint` `tests/tui_chrome.rs` helper names and strings unchanged.
feat(tui): ASCII chrome, invite wrap, alert truncate, remaining copy
Some checks failed
ci / test (pull_request) Failing after 4m39s
35b8caa716
ONIONWIRE_ASCII (and NO_COLOR) switches truncation to ... and ASCII
borders. Share/paste wrap at : so a mouse-copy cannot lose a mid-hex
line. Alerts truncate to the frame; empty threads and paste errors keep
the next-step hint. Skip the optional 40-row wordmark.
sirius merged commit e6e2a158a8 into main 2026-09-12 17:47:52 +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!27
No description provided.