Skip to content

feat(tui): next-3 round — attention layer, linear mode, diff fences - #40

Merged
jkyberneees merged 1 commit into
mainfrom
feat/next-3-features
Aug 29, 2026
Merged

feat(tui): next-3 round — attention layer, linear mode, diff fences#40
jkyberneees merged 1 commit into
mainfrom
feat/next-3-features

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

The three improvements ranked by the expert panel (NEXT_3_FEATURES.md), each implemented TDD-first with the README synced in the same commit.

1. Attention layer

  • Turn completion and pending approvals set the terminal window title (✓ done — <model> / ⚠ approval needed — <model>) and ring the bell; --bel=false mutes the bell, --notify adds OSC 9 desktop notifications.
  • One raw tea.Exec write per event — terminal states only, never per token. Wire-borne strings pass through sanitize/collapse so control bytes cannot inject terminal escapes.

2. --plain linear mode

  • No alt-screen: agent events print append-only to the terminal's native scrollback above a minimal input chrome. Text-prefix severity ([error], ⚠ approval, tools, prompts, ✓ done · N tools · Xs · N tok).
  • Streamed fragments suppressed; the reply lands whole when the turn ends. The accessible surface for screen readers — and the natural one for pipes (bodek --plain < task > run.log).
  • NO_COLOR now deterministically degrades the whole palette in every mode.

3. Diff-aware rendering

  • Fenced ```diff blocks tint inside prose without mis-styling the surrounding text (fence-first dispatch), fences without @@ hunk headers render as diffs (fence is authoritative), and the +N −M step chip counts fenced stats.

Test plan

  • make fmt clean · make vet clean · make lint 0 issues
  • make testgo test -race ./..., all packages green
  • New suites: attention_test.go (10 tests), plain_test.go (9), renderers_diff_test.go (6), cmd flag tests (3)

Three panel-ranked improvements, each TDD'd with the README synced:

- attention: turn completion and pending approvals set the terminal
  window title and ring the bell (--bel=false mutes); --notify adds
  OSC 9 desktop notifications. One raw tea.Exec write, terminal
  states only — never per token.
- --plain: linear mode without the alt-screen; agent events print
  append-only to the native scrollback above a minimal chrome, with
  text-prefix severity for screen readers and pipes. NO_COLOR now
  deterministically degrades the palette.
- diff fences: fenced ```diff blocks tint inside prose without
  mis-styling it, fences without @@ hunk headers render as diffs,
  and the +N −M step chip counts fenced stats.
@jkyberneees
jkyberneees merged commit 34b652f into main Aug 29, 2026
5 checks passed
@jkyberneees
jkyberneees deleted the feat/next-3-features branch August 29, 2026 09:44
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