fix(web): 修复中等宽度下聊天栏信息重叠 (#151)

Co-authored-by: Yaowei Zheng <hiyouga@buaa.edu.cn>
This commit is contained in:
Yiru DongandYaowei Zheng authored and GitHub committed 2026-08-07 17:19:03 +08:00
1 parent a6e54488b8
commit 9745773cb9
4 files changed
+34 -6

No files matched your search

+21
View File
@@ -67,6 +67,27 @@ test("chat + tool approval + stats/cost/copy + traces + files", async ({ page })
const headerElapsed = page.locator('div.hidden span[title="用时"]');
const elapsedBefore = await headerElapsed.textContent();
await expect(headerElapsed).not.toHaveText(elapsedBefore);
// Issue #150: at an approximately 2:1 browser size the pinned sidebar leaves the chat
// toolbar much narrower than the viewport breakpoint suggests. The running label used to
// stay expanded and the shrinkable stats row then painted its Token chip over that label.
// Keep the status dot and the live stats, but their rendered boxes must remain disjoint.
await page.setViewportSize({ width: 877, height: 438 });
await page.waitForTimeout(200);
const runningStatus = page.locator('span[title="运行中"]').filter({ hasText: "运行中" }).first();
const tokenTotal = page.locator('span[title="Token 累计(Token)"]');
const [runningBox, tokenBox] = await Promise.all([
runningStatus.boundingBox(),
tokenTotal.boundingBox(),
]);
expect(runningBox, "running status is rendered @877").not.toBeNull();
expect(tokenBox, "Token total is rendered @877").not.toBeNull();
const overlap =
Math.min(runningBox.x + runningBox.width, tokenBox.x + tokenBox.width) -
Math.max(runningBox.x, tokenBox.x);
expect(overlap, "running status and Token total do not overlap @877").toBeLessThanOrEqual(0);
await page.setViewportSize({ width: 1280, height: 720 });
await page.waitForTimeout(200);
// The user takes control of the running work group (toggle = userToggled), keeps it open, and
// opens the exec_command card to watch the arguments. Both must survive the end of the turn.
//