Skip to content

feat(ui): render the chat pane as a Rich transcript (AppUI)#7

Merged
lavindeep merged 1 commit into
ui-reworkfrom
feat/ui-pane-render
Jun 27, 2026
Merged

feat(ui): render the chat pane as a Rich transcript (AppUI)#7
lavindeep merged 1 commit into
ui-reworkfrom
feat/ui-pane-render

Conversation

@lavindeep

Copy link
Copy Markdown
Owner

Branch 3/9 of the UI v2 full-screen TUI rework.

What

AppUI — the RuntimeUI implementation that routes model responses, tool calls, command output, and plan progress into the full-screen pane as a Rich→ANSI transcript, replacing branch 2's plain-text pane.

  • Transcript = a list of Rich renderables (source of truth) rendered to one ANSI string at the live terminal width, cached until content or width changes — resize re-wraps cleanly, streaming is cheap to invalidate.
  • Pane control is now FormattedTextControl(ANSI(ui.render)), wrap_lines=False (Rich wraps at the shared width).
  • build_app gains an optional ui seam so branch 4's worker can inject + drive the same AppUI.

Mirrors the terminal UI exactly — all display guards preserved

  • Secret redaction (redact_structure) + workspace-relative path resolution (workspace_display) in the tool-call summary.
  • Control/ANSI sanitization at every sink — including the model-response sink (matching ResponseStream; caught by review and fixed red-first).
  • Approvals raise until the focus-swap lands (branch 7) — never a silent default. Thinking indicator + post-turn stats stay no-ops (branches 4/5).

Scope (later branches)

No worker thread, no model wiring (AppUI never calls get_app()/invalidate()), no transcript windowing/cap, no thinking indicator, no approval focus-swap. terminal.py and the non-TTY path untouched.

Verification

  • Phase gate green: ruff + mypy --strict clean, 1314 passed.
  • 28 AppUI tests (every content method, all three security guards, ordering, resize re-render, cache, approvals-raise) — security tests proven red-first.
  • Skeptical independent review caught the model-response sanitization gap; fixed + red-first test added.
  • DESIGN.md §31.12 in the same commit.

Add AppUI, the RuntimeUI implementation that routes content into the
full-screen pane. It holds a list of Rich renderables as the transcript
source of truth and renders them to a single ANSI string at the live
terminal width, caching the result until the content or width changes —
so a resize re-wraps cleanly and streaming stays cheap to invalidate.

The pane control in app.py becomes a FormattedTextControl over
ANSI(ui.render), with wrap_lines off because Rich already wraps at the
shared width. build_app gains an optional ui seam so the worker (a later
branch) can inject and drive the same AppUI.

Content methods mirror the terminal UI exactly, preserving every display
guard: secret redaction and workspace-relative path resolution in the
tool-call summary, and control/ANSI sanitization at every sink — the
model-response sink included, matching ResponseStream. Approvals raise
until the focus-swap lands; the thinking indicator and post-turn stats
stay no-ops for now.

DESIGN.md section 31.12 covers the pane render and the AppUI seam.
@lavindeep lavindeep merged commit a24d154 into ui-rework Jun 27, 2026
2 checks passed
@lavindeep lavindeep deleted the feat/ui-pane-render branch June 27, 2026 23:18
lavindeep added a commit that referenced this pull request Jul 2, 2026
feat(ui): render the chat pane as a Rich transcript (AppUI)
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.

1 participant