Skip to content

Commit d8aea0b

Browse files
committed
docs(tui): describe shell tails as frame-coalesced repaints
The host subscribes to feed appends and repaints on the next animation frame. Clocks run on a Timeline only while sticky chrome or a live lane needs them. Idle does not arm an interval.
1 parent 189d964 commit d8aea0b

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎docs/TUI-inline-eval.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ Nothing in the 0.6.4 types is an inline-mode renderable, an alternate inline sce
2929
- overlay selectors (empty-state fail-close, painted-id accept, shared list viewport)
3030
- the prompt kill ring
3131

32-
A raw scrollback log also has no place for the shell-output preview the host paints on a timer. Sticky polling exists because the preview is a zone in the fullscreen tree, not a line already committed to scrollback.
32+
A raw scrollback log also has no place for the shell-output preview the host repaints from feed appends, coalesced on one animation frame, or for sticky chrome clocks that run on a renderer Timeline only while needed. That paint exists because the preview is a zone in the fullscreen tree, not a line already committed to scrollback.
3333

3434
## What stays
3535

3636
- `src/tui/shell/layout.ts` applies terminal geometry: floors, prompt-row sync, landing split, relayout inputs.
3737
- `src/tui/geometry/zones.ts` defines the floors and the collapse order the layout refuses to violate.
3838
- `src/tui/shell/chrome.ts` `relayout` is the live entry that re-resolves the tree when visibility, prompt rows, or overlay mode change.
39-
- The `stickyPoll` interval in `src/tui/product-host.ts` keeps the shell-output preview and sticky chrome clocks painted. It is not scrollback.
39+
- Feed subscriptions and a renderer Timeline in `src/tui/product-host.ts` keep the shell-output preview and sticky chrome clocks painted. Idle does not arm an interval. Neither is scrollback.
4040

4141
## Deleted if inline mode were adopted
4242

4343
It is not adopted. If it were, the deletion this record refuses is:
4444

4545
- `shell/layout.ts`, the `geometry/zones.ts` floors, and `chrome.ts` relayout would be deleted or bypassed for a scrollback-only writer.
46-
- `stickyPoll` would go, because a raw scrollback commit has no sticky zone to repaint.
46+
- The host's shell-output subscription and Timeline would go, because a raw scrollback commit has no sticky zone to repaint.
4747

4848
Those files stay. Bypassing them for `writeToScrollback` would drop the floors, the single scroll lease, overlay selectors, and the prompt kill ring. None of that is implied by a scrollback snapshot.
4949

‎docs/TUI.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ plus up to three dim tail lines of the command's live output and — when the
116116
feed window holds more than three lines — the same dim `⋯ +N lines` elision
117117
marker as the settle preview, `N` counting lines within the live window (the
118118
feed keeps only the most recent 8 KiB). The output
119-
travels through a polled bounded feed (`src/session/shell-output-feed.ts`),
119+
travels through a bounded feed (`src/session/shell-output-feed.ts`),
120120
not a reactor event: the plugin appends chunks (capped at an 8 KiB tail per
121-
call, emitting at most once per 100 ms plus a final flush at settle), and
122-
the product host's sticky poll reads the feed snapshot every 200 ms and
123-
repaints the pending row frame-coalesced. Nothing from the feed is
124-
persisted. When the feed is not wired (tests, the demo shell), the row
125-
renders exactly as before — silent degradation.
121+
call, emitting at most once per 100 ms plus a final flush at settle). The
122+
product host subscribes to those appends and repaints the pending row from
123+
the feed snapshot, coalesced onto one animation frame. Nothing from the
124+
feed is persisted. When the feed is not wired (tests, the demo shell), the
125+
row renders exactly as before — silent degradation.
126126

127127
At settle the live tail is replaced by a preview of the full output: its
128128
last three lines plus a dim `⋯ +N lines` elision marker when more were
@@ -303,9 +303,9 @@ user follow-ups untouched.
303303
stack-only (`layoutMode: "stack"`, `railWidth: 0`); the zone max is
304304
`AGENTS_PANEL_MAX_VISIBLE + 1` (lanes plus a trailing `+N more`). Finished
305305
lanes (done / failed / cancelled / interrupted) linger for
306-
`AGENTS_PANEL_LINGER_MS` (4s) after `finishedAt`, then drop. Product-host sticky
307-
poll uses
308-
`agentsChromeNeedsSticky` so clocks and linger stay fresh; while sticky is
306+
`AGENTS_PANEL_LINGER_MS` (4s) after `finishedAt`, then drop. The product host
307+
arms a renderer Timeline only while sticky chrome or a live lane needs it
308+
(`agentsChromeNeedsSticky`); idle does not arm an interval. While sticky is
309309
needed it **does not** call `bridge.syncAgentProgress` — chrome owns the live
310310
clocks.
311311

@@ -1058,10 +1058,10 @@ terminal. It cannot observe:
10581058

10591059
- **Real paint.** Tests assert on the shell's in-memory row/rect state, not
10601060
on what a terminal emulator actually draws to a screen buffer.
1061-
- **The live shell tail's wall clock.** The feed itself is pure and the
1062-
cadence is injectable, so the live tail is headless-testable by driving a
1063-
fake feed and a fake clock through the same sync path the sticky poll
1064-
uses; what the harness cannot see is real-time emission timing.
1061+
- **The live shell tail's wall clock.** The feed itself is pure, so the
1062+
live tail is headless-testable by appending to a fake feed and repainting
1063+
through the host subscription on the next frame; what the harness cannot
1064+
see is real-time emission timing.
10651065
- **Modifier reporting.** Whether a real terminal can report Shift+Enter,
10661066
Alt+letter, or similar modifier combinations depends on the terminal
10671067
negotiating the kitty keyboard protocol (or an equivalent) with the actual

0 commit comments

Comments
 (0)