Skip to content

TUI Phase 7 — finish flash, richer markdown, block nav, click-to-fold#103

Closed
davidrhodus wants to merge 1 commit into
tui-phase6from
tui-phase7
Closed

TUI Phase 7 — finish flash, richer markdown, block nav, click-to-fold#103
davidrhodus wants to merge 1 commit into
tui-phase6from
tui-phase7

Conversation

@davidrhodus

Copy link
Copy Markdown
Contributor

Phase 7 — the last four grok-build TUI items, in one phase

Stacked on #102 (tui-phase6). This PR's base is tui-phase6, so the diff shows only Phase 7. Merge #102 first; GitHub will retarget this to main automatically.

Four viewing/affordance features:

7a — Finish flash

When a turn settles, the status line briefly glows in the outcome's color — green done, red failed, amber warning, neutral otherwise — fading back to muted over ~450ms. A new App.finished_at stamp (set on the working true→false transition) plus a pure flash_weight linear-decay helper. Idle ticks already redraw every ~120ms, so the fade animates smoothly.

7d — Richer markdown

  • Pipe tables: the |---|:--:| separator becomes a ruled ├─┼─┤ divider; data/header rows get muted cell separators.
  • Links: [label](url) renders the label underlined in the link color with the URL trailing dimmed; bare http(s)://… runs autolink (trailing sentence punctuation left outside).
  • Task lists: - [ ], - [x] (success-colored).

Rendering stays line-local to fit the streaming line-by-line commit path, so table columns align only as well as the source padded them — noted as a deliberate limitation (cross-row alignment would need buffering that fights the streaming architecture).

7b — Block navigation (Ctrl-B)

A cursor over tool-output blocks: ↑↓/jk move, Enter/Space fold or unfold one block independently of the global Ctrl-O, Esc/Ctrl-B exit. The selected block gets a marker line and the view follows the cursor. New per-block expanded override on the ToolOutput entry (moves with the entry through transcript capping — no fragile index set).

7c — Click-to-fold

A left click folds/unfolds the tool-output block under the pointer, mapped through geometry the render pass caches (inner rect, scroll offset, per-block wrapped-row spans). Mouse capture was already enabled for scroll-wheel support, so this is purely additive — no new text-selection regression.

Tests & gates

  • New unit tests: flash_weight decay; markdown links/autolinks, task lists, pipe tables (+ prose-with-a-pipe negative); block-nav key handling with independent per-block folding and cursor clamping; per-block expanded flatten; click→block coordinate mapping (+ out-of-area no-op). 164 hi-tui tests pass.
  • cargo fmt --all --check, full clippy gate (-D warnings), and the file-size ratchet all pass (bumped render.rs, app/render.rs, app/commands.rs, lib.rs, tests.rs).

Closes out the grok-build TUI adoption (Phases 1–6 handle theme, gutters, folding, panels, sticky headers, syntax highlighting, and the live accent wave).

…to-fold

Four viewing/affordance features closing out the grok-build TUI restyle:

- Finish flash (7a): when a turn settles, the status line briefly glows in the
  outcome color (green done / red failed / amber warning), fading over ~450ms.
  New App.finished_at stamp + a pure flash_weight decay helper.
- Richer markdown (7d): pipe tables (ruled `|---|` separator + muted `│` cells),
  inline [label](url) links and bare http(s) autolinks (underlined, URL trailing
  dimmed), and `- [ ]`/`- [x]` task-list checkboxes. Rendering stays line-local
  to fit the streaming commit path, so table columns align only as the source
  padded them.
- Block nav (7b, Ctrl-B): a cursor over tool-output blocks; ↑↓/jk move, Enter or
  Space folds/unfolds one block independently of the global Ctrl-O, and the view
  follows the cursor. New per-block `expanded` override on the ToolOutput entry.
- Click-to-fold (7c): a left click folds/unfolds the tool-output block under it,
  mapped through geometry the render pass caches. Mouse capture was already on
  for scroll, so this is purely additive.

Tests cover the wave/pulse/flash weights, the markdown constructs, block-nav key
handling + per-block flatten, and click→block mapping. Ratchet bumped for the
five grown files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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