test(web): harden live thinking tail observation

This commit is contained in:
ZiyaZhang
2026-08-02 06:12:13 -07:00
parent 975b57b54a
commit 8f77ab467f
2 files changed
+6 -4

No files matched your search

+4 -3
View File
@@ -159,7 +159,8 @@ describe('web e2e: lifecycle & chrome (workspace flow / reload / dark mode)', ()
const settled = scaffold.whenTurnSettled()
await input.fill(PROMPT)
const observeTurn = async () => {
if (MODE !== 'record') await page.setViewportSize({ width: 640, height: 1000 })
const originalViewport = page.viewportSize() ?? { width: 1680, height: 1000 }
if (MODE !== 'record') await page.setViewportSize({ width: 480, height: 1000 })
try {
await input.press('Enter')
if (MODE !== 'record') {
@@ -167,11 +168,11 @@ describe('web e2e: lifecycle & chrome (workspace flow / reload / dark mode)', ()
await expect.poll(async () => await liveTail.evaluate(element => (
element.scrollWidth > element.clientWidth
&& element.scrollLeft >= element.scrollWidth - element.clientWidth - 1
)), { timeout: 10_000 }).toBe(true)
)), { timeout: 10_000, interval: 10 }).toBe(true)
}
return await settled
} finally {
if (MODE !== 'record') await page.setViewportSize({ width: 1680, height: 1000 })
if (MODE !== 'record') await page.setViewportSize(originalViewport)
}
}
const sessionId = await observeTurn()
@@ -5,7 +5,8 @@
// Enter / Space, icon→chevron hover preview). The collapsed row is always
// one line; every row with body, output, or a card material (terminal, diff,
// read, search, web) is expandable; the summary stays inline while open,
// except Think, whose body opens with the same first line and would repeat it.
// except Think, where the running collapsed row follows the latest line at its
// scroll end and the summary yields while open to avoid repeating the body.
// The expanded body — an IN/OUT gutter-labeled card (figma 1249:35657) for
// text input/output, the run_code program through CodeBlock, or a card
// primitive (TerminalBlock, DiffBlock, ReadBlock, SearchBlock, WebBlock) for a