Scrolling up in a streaming transcript is undone; follow-the-tail @live specs time out against the fixture #80

Closed
opened 2026-09-27 10:29:19 -04:00 by cmoriarty · 2 comments
Owner

The two @live specs in ui/e2e/follow-the-tail.spec.ts ("stays at the bottom while the content below it grows" and "but stops following the moment the operator scrolls up") time out in page.waitForSelector('[data-lines]') after 15 s in the full lane, with OSF_URL at the fixture backend (ui/dev/fakeosfd.py --status). Same on main at 850dbab and 588c234.

Cause

  1. The specs open /run/{id} for the first running run. A run waiting on a review gate opens on the review, not a transcript, so there is no [data-lines]. The fixture's add-auth always has a gate open, and a real run can too.
  2. sample() measured the first scrollable element on the page, which since the run rail arrived is the rail. The scroll-up spec passed while checking nothing.
  3. The fixture has no running step whose transcript is taller than its view and keeps growing.
  4. Real bug: measured on the transcript itself, scrolling up while an agent streams is undone within a frame. Following uses virtua's scrollToIndex, which re-aims at its target for 150 ms after every measurement, and the revealing row asks to follow every frame, so one is always pending. When the operator wheels up, the rows coming into view are measured and virtua puts the view back at the tail. The original spec, pointed at the transcript, reproduces it 5 of 5. virtua 0.52.7 behaves the same.

Fix

OpenSpec change transcript-follows-the-tail:

  • Following is a plain scroll to the bottom; landing on opening repeats it each frame until the height holds and stops when the operator scrolls away; the transcript's own scrolls don't clear the pin.
  • The specs open the running agent step with the longest transcript and measure [data-lines].
  • The fixture gets a tail-demo run whose transcript overflows and grows a line every quarter second.
The two `@live` specs in `ui/e2e/follow-the-tail.spec.ts` ("stays at the bottom while the content below it grows" and "but stops following the moment the operator scrolls up") time out in `page.waitForSelector('[data-lines]')` after 15 s in the full lane, with `OSF_URL` at the fixture backend (`ui/dev/fakeosfd.py --status`). Same on main at 850dbab and 588c234. ## Cause 1. The specs open `/run/{id}` for the first running run. A run waiting on a review gate opens on the review, not a transcript, so there is no `[data-lines]`. The fixture's add-auth always has a gate open, and a real run can too. 2. `sample()` measured the first scrollable element on the page, which since the run rail arrived is the rail. The scroll-up spec passed while checking nothing. 3. The fixture has no running step whose transcript is taller than its view and keeps growing. 4. **Real bug:** measured on the transcript itself, scrolling up while an agent streams is undone within a frame. Following uses virtua's `scrollToIndex`, which re-aims at its target for 150 ms after every measurement, and the revealing row asks to follow every frame, so one is always pending. When the operator wheels up, the rows coming into view are measured and virtua puts the view back at the tail. The original spec, pointed at the transcript, reproduces it 5 of 5. virtua 0.52.7 behaves the same. ## Fix OpenSpec change `transcript-follows-the-tail`: - Following is a plain scroll to the bottom; landing on opening repeats it each frame until the height holds and stops when the operator scrolls away; the transcript's own scrolls don't clear the pin. - The specs open the running agent step with the longest transcript and measure `[data-lines]`. - The fixture gets a `tail-demo` run whose transcript overflows and grows a line every quarter second.
Author
Owner

Shipped on branch claude/gifted-mestorf-47cad3 (not merged to main yet) as 6329496 (proposal), 0b4670c (fix) and 14a5b5d (archive), OpenSpec change 2026-09-27-transcript-follows-the-tail.

  • Transcript: following is a plain scroll to the bottom instead of virtua's scrollToIndex, so scrolling up while an agent streams stays up. Opening a transcript repeats that scroll each frame until the height holds and stops when the operator scrolls away. A scroll the transcript made itself no longer clears the pin; without that, a transcript opened ~1200px short of its bottom.
  • Specs: follow-the-tail.spec.ts opens the running agent step with the longest transcript, measures [data-lines], and checks the transcript opened at its bottom and that a scroll up left the tail. Each check fails on the old code, with following disabled, and with the own-scroll guard removed. Known gap: reverting only the per-frame follow path to scrollToIndex depends on timing and slips through.
  • Fixture: a tail-demo run whose transcript overflows and grows a line every quarter second.
  • agent-transcript spec gains "The transcript follows its tail until the operator scrolls away".

Verified with the fast lane and the full lane with OSF_URL at a --status fixture (92/92 browser, including both follow-the-tail specs, in 2 of 3 runs; the other had one timeout in delegation.spec.ts's subagents-panel spec with four workers, which passes 4/4 on its own with and without the change), and in a real browser with a mouse wheel.

Shipped on branch `claude/gifted-mestorf-47cad3` (not merged to main yet) as 6329496 (proposal), 0b4670c (fix) and 14a5b5d (archive), OpenSpec change `2026-09-27-transcript-follows-the-tail`. - **Transcript:** following is a plain scroll to the bottom instead of virtua's `scrollToIndex`, so scrolling up while an agent streams stays up. Opening a transcript repeats that scroll each frame until the height holds and stops when the operator scrolls away. A scroll the transcript made itself no longer clears the pin; without that, a transcript opened ~1200px short of its bottom. - **Specs:** `follow-the-tail.spec.ts` opens the running agent step with the longest transcript, measures `[data-lines]`, and checks the transcript opened at its bottom and that a scroll up left the tail. Each check fails on the old code, with following disabled, and with the own-scroll guard removed. Known gap: reverting only the per-frame follow path to `scrollToIndex` depends on timing and slips through. - **Fixture:** a `tail-demo` run whose transcript overflows and grows a line every quarter second. - `agent-transcript` spec gains "The transcript follows its tail until the operator scrolls away". Verified with the fast lane and the full lane with `OSF_URL` at a `--status` fixture (92/92 browser, including both follow-the-tail specs, in 2 of 3 runs; the other had one timeout in `delegation.spec.ts`'s subagents-panel spec with four workers, which passes 4/4 on its own with and without the change), and in a real browser with a mouse wheel.
Author
Owner

Merged to main in #81 (rebased, so the hashes changed): 23676f4 (proposal), 94ff32b (fix) and c9b2610 (archive). They replace 6329496, 0b4670c and 14a5b5d quoted above; the changes are identical.

Merged to main in #81 (rebased, so the hashes changed): 23676f4 (proposal), 94ff32b (fix) and c9b2610 (archive). They replace 6329496, 0b4670c and 14a5b5d quoted above; the changes are identical.
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#80
No description provided.