test(web): cover kept replies and the replies setting

Settings goldens gain the Replies After Collapse row; folded-Turn aria
goldens for plan review, goal turns, and turn-tail actions include their
intermediate replies. The folded layout checks measure the intermediate
reply that now follows the Turn control at the 12px reply gap.
This commit is contained in:
imccyu committed 2026-10-18 23:01:23 +08:00
1 parent 94ebbf124e
commit 8598307c1e
11 files changed
+51 -3

No files matched your search

+12 -1
View File
@@ -54,7 +54,18 @@ it.each(['turn-tail-actions', 'goal-multi-turn-actions', 'present'] as const)(
const { top, bottom } = seat.getBoundingClientRect()
return { top, bottom }
})
expect(answerBounds.top).toBe(await process.evaluate(element => element.getBoundingClientRect().bottom) + 16)
const processBottom = await process.evaluate(element => element.getBoundingClientRect().bottom)
if (scenario === 'present') {
expect(answerBounds.top).toBe(processBottom + 16)
} else {
// Every reply stays visible: the intermediate reply follows the folded control at the 12px reply gap.
const leadTop = await page.getByText('Reading the workspace now.', { exact: true }).evaluate((element) => {
const seat = element.closest('[data-chat-flow-kind="assistant-step"]')
if (seat === null) throw new Error('intermediate reply has no Chat seat')
return seat.getBoundingClientRect().top
})
expect(leadTop).toBe(processBottom + 12)
}
if (scenario === 'present') {
const geometry = await page.locator('[data-presented-files-row]').evaluate((grid) => {
const root = grid.parentElement
@@ -24,6 +24,8 @@
- button "标准"
- text: 工作步骤收起时机 选择何时自动收起工作步骤
- button "回答结束后"
- text: 收起后显示的回复 工作步骤收起后,保留哪些助手回复
- button "全部回复"
- text: 显示代码工作视图 开启后,显示轨迹、本轮代码差异,可选择完整的 Agent 预设切换
- switch "显示代码工作视图" [checked]
- text: 快捷键
@@ -24,6 +24,8 @@
- button "Standard"
- text: When to Collapse Work Details Choose when to automatically collapse work details
- button "On completion"
- text: Replies After Collapse Choose which assistant replies stay visible when work details collapse
- button "All replies"
- text: Show coding view Shows trajectory, code diffs, and all Agent presets
- switch "Show coding view" [checked]
- text: Keyboard shortcuts
@@ -24,6 +24,8 @@
- button "Detailed"
- text: When to Collapse Work Details Choose when to automatically collapse work details
- button "On completion"
- text: Replies After Collapse Choose which assistant replies stay visible when work details collapse
- button "All replies"
- text: Show coding view Shows trajectory, code diffs, and all Agent presets
- switch "Show coding view"
- text: Keyboard shortcuts
@@ -24,6 +24,8 @@
- button "Detailed"
- text: When to Collapse Work Details Choose when to automatically collapse work details
- button "On completion"
- text: Replies After Collapse Choose which assistant replies stay visible when work details collapse
- button "All replies"
- text: Show coding view Shows trajectory, code diffs, and all Agent presets
- switch "Show coding view"
- text: Keyboard shortcuts
@@ -24,6 +24,8 @@
- button "详细"
- text: 工作步骤收起时机 选择何时自动收起工作步骤
- button "回答结束后"
- text: 收起后显示的回复 工作步骤收起后,保留哪些助手回复
- button "全部回复"
- text: 显示代码工作视图 开启后,显示轨迹、本轮代码差异,可选择完整的 Agent 预设切换
- switch "显示代码工作视图"
- text: 快捷键
+3 -2
View File
@@ -249,9 +249,10 @@ describe('web e2e: assistant IconActions wait for the turn to end', () => {
expect(await process.evaluate(element => getComputedStyle(element).borderBottomWidth)).toBe('1px')
const processBottom = await process.evaluate(element =>
element.closest<HTMLElement>('[data-chat-flow-kind="turn-process"]')?.getBoundingClientRect().bottom)
const answerTop = await page.getByText('DONE', { exact: true }).evaluate(element =>
// Every reply stays visible: the intermediate reply follows the folded control at the 12px reply gap.
const leadTop = await page.getByText('Reading the workspace now.', { exact: true }).evaluate(element =>
element.closest<HTMLElement>('[data-chat-flow-kind="assistant-step"]')?.getBoundingClientRect().top)
expect(answerTop).toBe((processBottom ?? 0) + 16)
expect(leadTop).toBe((processBottom ?? 0) + 12)
await process.focus()
const completed = await captureStableAria(page, '[class*="centerCol"]', scaffold!.workspaceCwd)
await compareOrRefreshGolden(COMPLETED_EXPECTED, completed, MODE)
@@ -40,6 +40,26 @@
- time: {{clock}}
- status: Completed
- button "Completed in {{duration}}"
- paragraph:
- strong: Turn 2 / 2
- text: — 随机选中的包:
- code: packages/llm/token-meter
- text: 📦
- text: Code block
- button "Wrap lines" [pressed]
- button "Copy"
- code: token-meter ├── README.md ├── package.json ├── src │ └── index.ts └── tests └── token-meter.spec.ts
- text: Code block
- button "Wrap lines" [pressed]
- button "Copy"
- code: "token-meter/ ├── README.md # 包说明文档 ├── package.json # 包元数据与依赖声明 ├── src/ │ └── index.ts # 入口,导出公共 API(token 计量逻辑) └── tests/ └── token-meter.spec.ts # 单元测试"
- paragraph:
- text: 两个 turn 都完成了(turn 1:
- code: session-reference
- text: ,turn 2:
- code: token-meter
- text: )。这一轮到此结束。
- paragraph: 两个 turn 均已完成,目标达成,标记 goal 为完成。
- paragraph: 两个 turn 都完成了 ✅
- paragraph:
- strong: 总结:
@@ -9,6 +9,10 @@
- button "Copy"
- status: Completed
- button "Completed in {{duration}}"
- paragraph:
- text: Since the user has explicitly asked me not to read or write any files and to go straight to planning, I'll proceed with
- code: exit_plan_mode
- text: .
- paragraph: DONE
- 'button "Open plan: Add `--greeting` flag to CLI"': "Add `--greeting` flag to CLI Plan · Markdown Open"
- button "Copy"
@@ -10,6 +10,7 @@
- button "Copy"
- status: Completed
- button "Completed in {{duration}}"
- paragraph: Reading the workspace now.
- paragraph: DONE
- button "Copy"
- button "Good response"
@@ -10,6 +10,7 @@
- button "Copy"
- status: Completed
- button "Completed in {{duration}}"
- paragraph: Reading the workspace now.
- paragraph: DONE
- button "Copy"
- button "Good response"