Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions webviews/test/transcript-upward-anchor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,24 @@ await requireBrowserLane("transcript-upward-anchor.test.ts", async () => {
await page.evaluate(() => (window as unknown as { __seedFoldStream(): void }).__seedFoldStream());
const card = page.locator('[data-row-id="gap-incoming"]');
await card.waitFor();
// Fonts settle before the card is placed, so its rows keep their measured height.
await page.evaluate(() => document.fonts.ready);
await card.evaluate((node) => node.scrollIntoView({ block: "start" }));
// Off the very bottom: the card sits in the last turns, so scrolling it to the top lands at
// the physical end, and there opening a line pushes the text above it up (#32644, Leo
// 2026-11-02: "YOU EXPAND UP WHILE YOUR SCCROLL IS AT THE VERY BOTTOM ... JUST THAT CASE").
// This trace is about a fold that keeps its place while the reply streams, so start at least
// 48px up. Whether scrollIntoView lands on the end depended on timing (base runs read 128 to
// 136 compared frames), so the start is pinned here: never further down than end - 48, and
// never further down than where scrollIntoView put the card, so the card stays in view.
const fromEnd = await page.locator(".acpmux-scroll").evaluate(async (node) => {
node.scrollTop = Math.max(0, Math.min(node.scrollTop, node.scrollHeight - node.clientHeight - 48));
node.dispatchEvent(new Event("scroll"));
await window.cmuxPaintFrame();
await window.cmuxPaintFrame();
return node.scrollHeight - node.clientHeight - node.scrollTop;
});
expect(fromEnd).toBeGreaterThan(8);
const result = await page.evaluate(traceUpwardAnchors, {
steps: Array.from({ length: 112 }, () => 0),
foldStream: true,
Expand Down
Loading