Skip to content

Split the TUI god-files and gate repaints on change - #826

Merged
TheGreatAxios merged 20 commits into
mainfrom
cl-6791-tui-split
Sep 8, 2026
Merged

Split the TUI god-files and gate repaints on change#826
TheGreatAxios merged 20 commits into
mainfrom
cl-6791-tui-split

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Splits the three TUI god-files into layered single-concern modules: shell (12 modules), provider (11), runner (11); the 6,139-line shell file is gone and the largest remaining TUI module is 1,470 lines
  • Deletes hand-rolled code OpenTUI already ships: the list viewport and selection math (SelectRenderable), clipboard helper discovery and OSC 52 writing, overlay fixture fallbacks, and the dead tui barrel
  • Coalesces stream and tool row updates to one retext per renderer frame with flush-on-close seams, recomposes chrome only when its composed inputs change, and skips unchanged tool elapsed ticks
  • Adds a CI-enforced per-file line-budget ratchet, layered import-direction rules, and an import-graph test so the tree cannot silently re-tangle or regrow
  • Fixes the clipboard-failure crash, overlay selection reset on resize, and mid-sentence decision clipping found during review, each pinned by a regression test

Verification

  • bun run check passes with 6,288 tests and 0 failures, verified in two independent full-suite runs
  • bun run tui:smoke passes
  • Perf gates: N deltas in one frame produce one retext; ten idle stickyPoll ticks produce zero chrome recomposes; shape-stable row updates produce zero subtree rebuilds

Fixes CL-6791

@linear-code

linear-code Bot commented Sep 7, 2026

Copy link
Copy Markdown

CL-6791

Policing gates constrain how future changes look rather than whether
they work. The split stays documented; the suite verifies behavior only.
The split deleted src/tui/runner.ts while main removed the Codex
instructions refresh from it, so port that removal into the split
modules instead: drop the refresh block and the ready delivery option
from runner/session.ts and runner/state.ts, matching main's deletion
of src/auth/codex/instructions.ts.
Permission approval choices embedded each scope's hint inside the
label, and the fixed-height choice rows truncated those labels with
an ellipsis the operator could not expand. Labels are now the bare
action name and the scope hints paint as body messages above the
choice list, where the expand key reaches them. The unused choice
wrapping/marker helpers go with the behavior they served, the
provider setup's list height budget moves off the surface module to
break the choices-surface-oauth import cycle, and the overlay list
regains the viewport coverage lost in the wrapper move.
@TheGreatAxios
TheGreatAxios merged commit 00577f3 into main Sep 8, 2026
5 checks passed
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