Commit graph onionwire/tests/tui_spec.rs
Author SHA1 Message Date
agent
69a15fe909
chat: send and receive as ratchet frames through the outbox payload
All checks were successful
ci / test (pull_request) Successful in 4m36s
ci / sdk (pull_request) Successful in 1m15s
android-ci / android (pull_request) Successful in 9m25s
Chat plaintext is ratchet-encrypted once, before the first delivery attempt,
and the frame is what the outbox stores and retries, so a retried message
re-sends identical bytes instead of advancing the sending chain twice.

- dispatch: Kind::Ratchet for the `rat ` prefix, matched before the unknown
  [a-z]{3} prefix rule
- node: encode_chat_frame / ingest_chat_frame (the wire halves of Node::send
  and handle_incoming), bootstrap derived from the peers' static prekey DH
  because the Noise handshake is frozen and carries no ratchet key
- outbox: nullable outbox.payload + Outbox::send_payload; NULL payload keeps
  the previous row-for-row behaviour
- store: additive outbox.payload migration, enqueue_outbox_payload,
  OutboxEntry::payload
- add_friend_payload: a changed prekey clears the (prekey-bound) ratchet state

tests/ratchet_wire.rs (5) covers one frame per send, byte-identical retries,
out-of-order delivery, replay, tampering and fresh-friend both directions.

tests/tui_spec.rs and crates/onionwire-sdk/src/lib.rs only gained a
`payload: None` field in their OutboxEntry test fixtures: the card's required
field on a pub struct cannot be added without it.
2026-09-16 19:02:52 -04:00
agent
d4b0071d1a
tui: fix clippy unnecessary_unwrap in NO_COLOR cleanup
All checks were successful
ci / test (pull_request) Successful in 3m58s
ci / sdk (pull_request) Successful in 56s
android-ci / android (pull_request) Successful in 8m16s
The alert_line_prefixes_when_no_color test stashed the prior NO_COLOR
value and restored it with is_none() + unwrap() — a clippy lint failure
under -D warnings. Replace with a match that takes ownership.

No behavior change; the restored env var is identical.

Co-authored-by: openhands <[email protected]>
2026-09-15 17:34:59 -04:00
agent
6ce97a0e3c
tui: extract pub ColorMode/TokenStyles/tokens_for for testable colour tokens
Some checks failed
ci / test (pull_request) Failing after 4m22s
ci / sdk (pull_request) Successful in 1m16s
android-ci / android (pull_request) Successful in 8m16s
Make ColorMode a pub enum with pub color_mode() fn, add TokenStyles
struct and tokens_for(mode) as the single source of truth for the
style_* helpers. Tests assert RGB/None/Ansi16 fg/bg/modifier resolution
without depending on process environment.
2026-09-15 17:29:26 -04:00
rust-dev
2cbe7d41e5
feat(tui): join outbox rows to chat rows by message id
All checks were successful
ci / test (pull_request) Successful in 4m12s
`chat_with_delivery` matched pending outbox rows to chat rows by body
because `store::Message` carried no id, so an older send that was still
queued showed a delivered mark whenever a newer send of the same text had
already crossed the circuit.

`store::Message` now carries its `messages.id`, and the TUI joins
`OutboxEntry::message_id` == `Message::id`. The body match and its
newest-first fallback are gone.

`list_messages()` keeps its signature; callers that do not need the id
are untouched.
2026-09-12 17:12:30 -04:00
t
b79f1fd6f3
feat(tui): per-message outbox delivery state + N queued footer
All checks were successful
ci / test (pull_request) Successful in 4m9s
Chat rows now carry the state the local outbox actually holds: `✓` delivered,
`◷ queued (try n/8, retry 45s)` while the retry worker still has it, `» sending`
mid-attempt and `✗ failed: <short reason>` once attempts are exhausted. The
footer replaces the flat `sent` / `send failed` copy with the live count
(`2 queued`), and keeps a fail-closed `send failed: …` statement as long as any
row is terminally failed.

States come from the outbox API (`Node::outbox_pending` → `Queued` / `Sending` /
`Failed`; a delivered row is deleted, so absence is `Sent`). No parallel state
model, no new wire prefix. Every new glyph has an ASCII fallback (`ok` plus the
state word) exercised by a test.

- `chat_with_delivery()` / `delivery_tag()` / `retry_in_text()` /
  `short_send_reason()` / `OutboxSummary::note()` are pure and unit-tested.
- `draw_chat()` is now the real chat-pane renderer (extracted from
  `App::draw_main`) so width/wrap is testable without a `Node`.
- docs/TUI.md: delivery markers, copy, and the 80x24 floor / 120x40 target.

Verified: cargo test 26/26 suites ok (tui_spec 20/20, incl. a real Store +
Outbox::send -> pending() -> render path); clippy --all-targets -D warnings clean.
2026-09-12 14:44:35 -04:00
Sirius DevOps
35b8caa716
feat(tui): ASCII chrome, invite wrap, alert truncate, remaining copy
Some checks failed
ci / test (pull_request) Failing after 4m39s
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.
2026-09-12 00:54:16 -04:00
Sirius DevOps
0749d2300a
feat(tui): keep fail-closed footer, flatten main chrome
All checks were successful
ci / test (pull_request) Successful in 4m48s
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).
2026-09-12 00:15:19 -04:00