feat: refine workbench visuals and map controls

Unify the Agent history extension with the header acrylic surface, preserve the full conversation body, and consolidate shared control and status styling.

Restore map flow and SCADA controller behavior, remove obsolete rendering paths, and extend regression coverage. Button press coverage now releases outside the target so state assertions cannot accidentally toggle the control.
This commit is contained in:
2026-07-28 16:39:36 +08:00
parent ade88b4fbf
commit f4318a9b9c
96 changed files with 5480 additions and 1875 deletions
+28 -2
View File
@@ -1,4 +1,4 @@
import { expect, test } from "playwright/test";
import { expect, test } from "@playwright/test";
test("top bar uses compact controls on narrow mobile viewports", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
@@ -10,7 +10,33 @@ test("top bar uses compact controls on narrow mobile viewports", async ({ page }
);
await expect(page.getByRole("button", { name: "切换模拟方案" })).toBeHidden();
await expect(page.getByRole("button", { name: "切换地图 Dev Panel" })).toBeHidden();
await expect(page.getByRole("button", { name: /查看异常处置面板/ })).toBeVisible();
const alertButton = page.getByRole("button", { name: /查看异常处置面板/ });
const userButton = page.getByRole("button", { name: "打开用户菜单" });
await expect(alertButton).toBeVisible();
await expect(userButton).toBeVisible();
const [alertBox, userBox] = await Promise.all([
alertButton.boundingBox(),
userButton.boundingBox()
]);
expect(alertBox).not.toBeNull();
expect(userBox).not.toBeNull();
expect(alertBox?.width).toBe(40);
expect(alertBox?.height).toBe(40);
expect(userBox?.width).toBe(alertBox?.width);
expect(userBox?.height).toBe(alertBox?.height);
const [alertStyles, userStyles] = await Promise.all([
alertButton.evaluate((element) => {
const styles = getComputedStyle(element);
return { backgroundColor: styles.backgroundColor, borderRadius: styles.borderRadius };
}),
userButton.evaluate((element) => {
const styles = getComputedStyle(element);
return { backgroundColor: styles.backgroundColor, borderRadius: styles.borderRadius };
})
]);
expect(alertStyles).toEqual(userStyles);
});
test("top bar keeps text horizontal at the desktop breakpoint", async ({ page }) => {