Agent pane: tall Edit diffs draw over each other and the pane flickers while a step streams #552

Closed
opened 2026-11-15 18:30:39 -05:00 by cmoriarty · 3 comments
Owner

What happens

During a thorough run's openspec.propose, the agent pane drew rows over each other, and the screen started flickering hard. This was on production, 2026-11-15, with "show thinking" on.

  • Each Edit spec.md row shows its side-by-side diff in a box whose last line is cut through. The next row is drawn over that cut line, in the same place.
  • While the agent kept editing, the pane flickered without stopping.

This looks like a row's measured height disagreeing with its drawn height. The list lays out the next row at the measured height, the row then grows, and it is measured again, round and round. The step was writing many edits to one spec file, each a tall wrapped diff, while its live text streamed.

Related, all closed: braid#22 (a report overlapping the rows below), braid#210 (a jumpy transcript while streaming), braid#375 (rows landing above the thought that started them).

Fix

Find what changes an Edit row's height after it is measured: wrapping in the two diff columns, the diff loading after the row appears, or the live tail above it. Then give the row its final height before the list places the rows after it, so it is measured once.

Done when

A browser test streams a step that makes several tall Edit rows of a wrapped spec diff. No two rows overlap, and the list stops re-laying itself out once the stream is quiet.

## What happens During a thorough run's `openspec.propose`, the agent pane drew rows over each other, and the screen started flickering hard. This was on production, 2026-11-15, with "show thinking" on. - Each `Edit spec.md` row shows its side-by-side diff in a box whose last line is cut through. The next row is drawn over that cut line, in the same place. - While the agent kept editing, the pane flickered without stopping. This looks like a row's measured height disagreeing with its drawn height. The list lays out the next row at the measured height, the row then grows, and it is measured again, round and round. The step was writing many edits to one spec file, each a tall wrapped diff, while its live text streamed. Related, all closed: braid#22 (a report overlapping the rows below), braid#210 (a jumpy transcript while streaming), braid#375 (rows landing above the thought that started them). ## Fix Find what changes an `Edit` row's height after it is measured: wrapping in the two diff columns, the diff loading after the row appears, or the live tail above it. Then give the row its final height before the list places the rows after it, so it is measured once. ## Done when A browser test streams a step that makes several tall `Edit` rows of a wrapped spec diff. No two rows overlap, and the list stops re-laying itself out once the stream is quiet.
Author
Owner

It reproduces every time (the owner, 2026-11-15). On run 200, which was still running, open its openspec.propose step and scroll up to the Edit diffs: the pane starts to flicker.

So it is not only the live tail. Rows the list draws again as they scroll back into view are measured in a loop too, which points at the Edit row's own height, not at the streaming. The browser test in Done when should scroll back up through those rows, not only stream them.

**It reproduces every time** (the owner, 2026-11-15). On run 200, which was still running, open its `openspec.propose` step and scroll up to the `Edit` diffs: the pane starts to flicker. So it is not only the live tail. Rows the list draws again as they scroll back into view are measured in a loop too, which points at the `Edit` row's own height, not at the streaming. The browser test in Done when should scroll back up through those rows, not only stream them.
Author
Owner

Found: a diff switches between split and unified on every frame

Reproduced on run 200's openspec.propose in my own Chromium, scrolling up with the wheel. It needs two conditions: classic scrollbars, which macOS shows when a mouse is connected, and an agent pane whose diff box is just over 1000 px wide. At a 1472 px window the list changed on 29 or 30 of every 30 frames and never settled. At 1480 px, and at 2000 px, it settled at once. With the hidden scrollbars of a default headless browser it never happens.

One diff, frame by frame:

unified cw=1006 ow=1006 h=320 sh=320
split   cw=996  ow=1006 h=400 sh=457
unified cw=1006 ow=1006 h=320 sh=320
split   cw=996  ow=1006 h=400 sh=457

DiffBlock (ui/src/components/ToolBlocks.tsx) chooses split when its own clientWidth is at least SPLIT_MIN_WIDTH (1000), measured on the box that scrolls past BLOCK_MAX_HEIGHT (400):

  1. Split: a spec's long lines wrap in two narrow columns, so the content is 457 px. The box scrolls, and its scrollbar takes clientWidth to 996.
  2. Under 1000, so unified: the same lines wrap less, the content is 320 px, and the scrollbar goes. clientWidth is back to 1006.
  3. 1000 or more, so split again, and round it goes.

The row's height swings between 400 and 320 px with each switch, so the list moves every row below it on every frame. That is the text drawn over itself, and the flicker. It was never about streaming. Any such diff does it once the pane is the wrong width.

Fix

Choose the layout from a width the box's own scrollbar cannot change: offsetWidth (1006 throughout above), or the width of the row that holds the box. Giving the box scrollbar-gutter: stable would also hold clientWidth still, but it costs every diff a gutter.

Done when

A test drives the diff's layout choice at a width where the scrollbar would cross the switch, with content that overflows only when split, and the layout holds still. Browser journeys run with hidden scrollbars, so this needs a unit test of the width read, or a journey launched with scrollbars shown.

## Found: a diff switches between split and unified on every frame Reproduced on run 200's `openspec.propose` in my own Chromium, scrolling up with the wheel. It needs two conditions: **classic scrollbars**, which macOS shows when a mouse is connected, and **an agent pane whose diff box is just over 1000 px wide**. At a 1472 px window the list changed on 29 or 30 of every 30 frames and never settled. At 1480 px, and at 2000 px, it settled at once. With the hidden scrollbars of a default headless browser it never happens. One diff, frame by frame: ``` unified cw=1006 ow=1006 h=320 sh=320 split cw=996 ow=1006 h=400 sh=457 unified cw=1006 ow=1006 h=320 sh=320 split cw=996 ow=1006 h=400 sh=457 ``` `DiffBlock` (`ui/src/components/ToolBlocks.tsx`) chooses split when its own `clientWidth` is at least `SPLIT_MIN_WIDTH` (1000), measured on the box that scrolls past `BLOCK_MAX_HEIGHT` (400): 1. **Split:** a spec's long lines wrap in two narrow columns, so the content is 457 px. The box scrolls, and its scrollbar takes `clientWidth` to **996**. 2. **Under 1000, so unified:** the same lines wrap less, the content is 320 px, and the scrollbar goes. `clientWidth` is back to **1006**. 3. **1000 or more, so split again,** and round it goes. The row's height swings between 400 and 320 px with each switch, so the list moves every row below it on every frame. That is the text drawn over itself, and the flicker. It was never about streaming. Any such diff does it once the pane is the wrong width. ## Fix Choose the layout from a width the box's own scrollbar cannot change: `offsetWidth` (1006 throughout above), or the width of the row that holds the box. Giving the box `scrollbar-gutter: stable` would also hold `clientWidth` still, but it costs every diff a gutter. ## Done when A test drives the diff's layout choice at a width where the scrollbar would cross the switch, with content that overflows only when split, and the layout holds still. Browser journeys run with hidden scrollbars, so this needs a unit test of the width read, or a journey launched with scrollbars shown.
Author
Owner

Shipped in #555 (change console-diff-run-bar-count), live as ff34e7f since 17:06 UTC on 2026-11-18 (archived in #556).

A diff now chooses two columns or one from its box's offsetWidth, which its own scrollbar does not change. It lays itself out once at any width.

Evidence. The new journey ui/e2e/scrollbars.spec.ts starts Chromium with its scrollbars drawn and sizes the box to 1004 px, split and scrolling, where its scrollbar takes clientWidth to 994.

  • On main it counted 9 column changes in 10 frames. With the fix it counts 0.
  • In the local try at 1470 px, the same box held still for 30 frames.
**Shipped** in #555 (change `console-diff-run-bar-count`), live as ff34e7f since 17:06 UTC on 2026-11-18 (archived in #556). A diff now chooses two columns or one from its box's `offsetWidth`, which its own scrollbar does not change. It lays itself out once at any width. **Evidence.** The new journey `ui/e2e/scrollbars.spec.ts` starts Chromium with its scrollbars drawn and sizes the box to 1004 px, split and scrolling, where its scrollbar takes `clientWidth` to 994. - On main it counted 9 column changes in 10 frames. With the fix it counts 0. - In the local try at 1470 px, the same box held still for 30 frames.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#552
No description provided.