Skip to content

feat(tui): add focused reader for completed responses - #181

Merged
BunsDev merged 13 commits into
mainfrom
feat/transcript-response-reader
Aug 16, 2026
Merged

BunsDev merged 13 commits into
mainfrom
feat/transcript-response-reader

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 15, 2026

Copy link
Copy Markdown
Member

Summary

  • add a focused Markdown reader for completed transcript responses, with Enter-to-read, navigation, search, copy, and a clear return path
  • annotate each completed response in the transcript with its readable line count
  • preserve transcript text semantics across mixed text and thinking blocks, and prevent submits while the reader is open

Test plan

  • cargo test -p claurst-tui --quiet
  • cargo clippy -p claurst-tui --all-targets -- -D warnings
  • cargo fmt --check
  • git diff --check

Copilot AI lite review requested due to automatic review settings August 15, 2026 15:14
@vercel

vercel Bot commented Aug 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 15, 2026 11:48pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a full-screen “Response Reader” overlay in the Rust TUI so users can open completed assistant responses in a focused Markdown view with navigation, search, copy, and a clear return path, while also surfacing a per-response rendered line count in the transcript.

Changes:

  • Introduces ResponseReaderState + renderer to display completed assistant text in a centered overlay.
  • Adds a transcript footer (“Response · N lines · Enter to read”) for completed assistant messages with visible text, and routes Enter to open the reader when the prompt is empty.
  • Integrates reader lifecycle with app event handling (blocking submit while open, closing on new streaming turn) and adds focused tests + a design spec.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src-rust/crates/tui/src/response_reader.rs New overlay state + renderer for reading completed assistant responses (with tests).
src-rust/crates/tui/src/render.rs Adds transcript footer + renders the reader overlay (with tests for footer targeting/line counts).
src-rust/crates/tui/src/lib.rs Exposes the new response_reader module.
src-rust/crates/tui/src/app.rs Adds reader state to App, routes keys (Enter/search/copy/nav), blocks submit while open, and adds tests.
src-rust/crates/cli/src/main.rs Routes empty-prompt Enter through App so the reader open behavior works in interactive mode.
docs/superpowers/specs/2026-08-15-transcript-response-reader-design.md Design/spec doc for behavior, scope, and validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src-rust/crates/tui/src/app.rs Resolved
Comment thread src-rust/crates/tui/src/app.rs Resolved
@BunsDev BunsDev self-assigned this Aug 15, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…able after replace_messages

Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
@BunsDev
BunsDev merged commit 8eb323f into main Aug 16, 2026
3 of 4 checks passed
BunsDev added a commit that referenced this pull request Sep 15, 2026
* style(tui): format response_reader to satisfy the fmt gate

`cargo fmt --all -- --check` (rust-ci.yml:52) fails on a pristine
checkout of main: `render_response_reader` has a chained
`saturating_add` that rustfmt wants broken across lines. It landed
unformatted in #181, so the gate is currently red on main and every
new PR inherits the failure.

Pure formatting, no behavior change. Kept as its own commit so the
code-block work in this branch stays readable.

Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>

* feat(tui): render fenced code on a surface, sized to the frame

Fenced code in the transcript was drawn as a fixed 50-dash rule plus a
yellow gutter, with the raw source line pushed verbatim. Three problems
followed from that.

The block had no edges. Code inherited the app background, so a fence
bled into the prose above and below it and read as indented text rather
than as a block.

The rules ignored the frame. They were a hardcoded 50 dashes regardless
of terminal width, so they under- or overshot on every terminal that was
not exactly that wide.

Worst, long lines were clipped silently. `render_markdown` already
receives the frame width and the code path ignored it, so ratatui cut
the line at the buffer edge with no marker. A truncated line was
indistinguishable from a complete one, which matters most for exactly
the content a reader is most likely to copy.

Code rows now sit on COVEN_CODE_PANEL_BG and are fitted to the frame:
clipped when they overrun, padded when they fall short, so a block reads
as one continuous slab with a square right edge. Rules span the actual
width. Body lines truncate with an ellipsis so a cut is visible. A
tagged fence gets an accent-colored chip naming the language.

The fence colors move off Color::Yellow and Color::White onto the
COVEN_CODE_* tokens, per follow-up 4 of
docs/tui-ux-accessibility-review.md: the named ANSI colors are
terminal-theme dependent, so contrast there cannot be reasoned about.

Two details worth review attention:

- The edge glyph and the chip are independent. An untagged fence still
  opens with the opening edge; it just has no chip. An earlier version
  keyed the glyph off the label and opened untagged fences with the
  closing edge.
- The fence tag is model output, so it is validated against a
  conservative identifier set and a length cap and rejected outright
  rather than mangled into a chip.

Tests cover the surface fill, frame-width fitting, the chip, matching
open and close edges, tag rejection, truncation, and narrow frames down
to zero width. The live `render_markdown` fence path had no tests
before; only the unreachable `messages::render_code_block` was
snapshotted.

Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>

---------

Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
@BunsDev
BunsDev deleted the feat/transcript-response-reader branch October 13, 2026 08:58

This branch was successfully deployed

1 active deployment
Preview — 5e93002b Deployed Aug 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants