feat(tui): per-message outbox delivery state (queued/sending/sent/failed) + N queued footer #48
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tui-outbox-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Per-message delivery state in the chat pane, read from the local outbox, plus a
live
N queuedfooter summary.you: ping ✓you: pong ◷ queued (try 2/8, retry 45s)you: pong » sendingyou: pong ✗ failed: connection timed outthem: pong(no marker)Footer while rows are outstanding:
2 queued; any terminal failure keeps afail-closed
send failed: {short}statement (!prefixed when colour is off).States are the store/outbox ones (
Queued/Sending/Sent/Failed) — noparallel model, no new wire prefix, no server.
Stacked base — read this
PR #27 is merged (
e6e2a15), sodocs/TUI.mdand thesrc/tui.rschromeconventions are now on
main. The one dependency still open is PR #45(
feat/local-outbox), whose API this card renders:feat/tui-outbox-state=origin/main(4338e8a) merged withorigin/feat/local-outbox(clean), then this card's commit on top. Review thesrc/tui.rs/tests/tui_spec.rs/docs/TUI.mddiff; thesrc/outbox.rs,src/store.rsandsrc/node.rshunks belong to #45 and disappear once it lands.Do not merge before #45. No README changes.
Scope
Allowed files only:
src/tui.rs,tests/tui_spec.rs,docs/TUI.md.README.md,src/node.rs,src/store.rs,src/outbox.rsuntouched (the lastthree are byte-identical to the parents' heads —
cargo fmtrun only on myfiles).
How it is verified
Real output from this worktree:
New tests (
tests/tui_spec.rs):queued_and_delivered_messages_render_different_markers— distinct, assertablemarkers for a queued vs a delivered row, incl.
try 2/8/retry 45s.delivery_markers_have_exercised_ascii_fallbacks—ONIONWIRE_ASCII=1frame ispure ASCII and the fallbacks are exact (
failed: …,queued (try 1/8, retry 30s),sending,ok); the fallback path is exercised, not just declared.chat_and_footer_rows_fit_80x24_and_wrap_instead_of_clipping— draws the realdraw_chat+status_footerat 80x24, asserts every chat and footer row is<= 80, that both markers render, and that an over-long message wraps insteadof being clipped. Floor 80x24 / target 120x40 are now stated in
docs/TUI.md.footer_summary_counts_queued_and_keeps_fail_closed—2 queued,send failed: {short}(incl. the!ornament withNO_COLOR), and{n} queued, send failed: …for the mixed case.renders_a_queued_row_from_a_real_outbox_send— realStore+ realOutbox::sendagainst a dead onion →pending()row → render; no hand-writtenfixture for the state.
retry_age_and_failure_reason_are_short_forms,delivery_tag_reads_the_outbox_status_enum— unit level.Frame dump (real helpers,
--nocapture):Helpers renamed / moved
App::chat_lines()→App::chat_view()(private, returns lines and theoutbox summary; nothing in
tests/tui_spec.rs/tests/tui_frames.rsasserts on it).
App::pane_block()kept; its body moved to the freepane_block_for()so theextracted
draw_chat()can style the pane.draw_chatis new and public.status_footer()signature unchanged; the!ornament now triggers onnote.contains("send failed")instead ofstarts_with, so{n} queued, send failed: …keeps its fail-closed marker. Existing chromeassertions (
TOR,me:,? helpat 80/120) still pass.Known limitation (honest)
A delivered row is deleted from the outbox, so absence means
Sent; pending rowsare matched to chat rows by body, newest send first — the outbox exposes
message_idbutstore::Messagehas no id andNode::list_messagesdoes notsurface one, and
src/node.rsis out of scope for this card. Consequence: twoidentical bodies where only the newer one is still queued attach the marker to
the newer send. Follow-up card created for an id-bearing accessor so the marker
can join exactly.
README (deferred)
README.mdis owned by PR #38 — not touched. In "First run", the sentenceshould become (coordinate with PR #45, which already supersedes the "no outbox"
clause):
N queuedfooter43d68a25657c6de696a1CI + verification on the rebased head
Rebased on
origin/main4338e8a(PR #27 merged) +origin/feat/local-outbox; head is now7c6de69.test,#48,7c6de69): success — https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/157cargo test→ 26/26 suites ok (tui_spec20 passed; 3 ignored network tests unchanged);cargo clippy --all-targets -- -D warnings→ clean.git statusshows onlysrc/tui.rs,tests/tui_spec.rs,docs/TUI.mdchanged by this card;README.md,src/node.rs,src/store.rs,src/outbox.rsuntouched.Follow-up card for the exact id join (removes the body-match caveat): t_19109ff7.
N queuedfooterCorrection + final head
The previous comment named
7c6de69— that was the base merge (main +feat/local-outbox) pushed without this card's commit (staging mistake on my side). The commit is now on the branch and pushed.ebd3a30—feat(tui): per-message outbox delivery state + \N queued` footer`test,#48,ebd3a30): success — https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/158src/tui.rs,tests/tui_spec.rs,docs/TUI.md(11 changed files total = those 3 plus PR #45's 9 until it merges).ebd3a30:cargo test→ 26/26 suites ok (tui_spec20 passed);cargo clippy --all-targets -- -D warnings→ exit 0.Follow-up card for the exact id join (removes the body-match caveat): t_19109ff7.
ebd3a306e8b79f1fd6f3