From f0485ca86ecd8fb0830df58d187633e74124d973 Mon Sep 17 00:00:00 2001 From: Huarch Date: Mon, 27 Jul 2026 11:50:29 +0800 Subject: [PATCH] feat: refresh workbench visual layout --- package.json | 1 + playwright.config.ts | 3 + pnpm-lock.yaml | 8 + .../agent/components/agent-collapsed-rail.tsx | 4 +- .../agent/components/agent-command-panel.tsx | 57 +++- src/features/agent/index.ts | 1 + .../core/components/notice-presentation.tsx | 48 ++- .../mobile-workbench-sheet-layout.ts | 21 ++ .../components/mobile-workbench-sheet.test.ts | 17 ++ .../components/mobile-workbench-sheet.tsx | 221 ++++++++++++++ .../components/scheduled-condition-feed.tsx | 217 +++++++++++--- .../components/workbench-agent-panels.tsx | 129 +++------ .../components/workbench-top-bar.tsx | 95 +++--- .../workbench/hooks/use-agent-panel-resize.ts | 30 +- .../hooks/use-workbench-map-controller.ts | 36 ++- .../workbench/hooks/use-workbench-map.ts | 9 - .../workbench/layout/workbench-layout.test.ts | 65 ++++- .../workbench/layout/workbench-layout.ts | 47 ++- src/features/workbench/map-workbench-page.tsx | 207 +++++++++++-- src/features/workbench/map/camera.test.ts | 48 ++- src/features/workbench/map/camera.ts | 41 +-- src/features/workbench/map/sources.ts | 4 +- src/styles.css | 179 +++++++----- tests/browser/agent-panel-resize.e2e.ts | 12 +- tests/browser/mobile-workbench-sheet.e2e.ts | 104 +++++++ .../scheduled-condition-acrylic.e2e.ts | 65 +++++ .../workbench-panel-map-stability.e2e.ts | 34 +++ tests/browser/workbench-visual.e2e.ts | 274 ++++++++++++++++++ ...workbench-desktop-light-chromium-linux.png | Bin 0 -> 480892 bytes ...bench-desktop-satellite-chromium-linux.png | Bin 0 -> 439364 bytes ...-desktop-wide-max-agent-chromium-linux.png | Bin 0 -> 873795 bytes ...ench-mobile-agent-light-chromium-linux.png | Bin 0 -> 143177 bytes ...ile-condition-satellite-chromium-linux.png | Bin 0 -> 96929 bytes 33 files changed, 1624 insertions(+), 353 deletions(-) create mode 100644 src/features/workbench/components/mobile-workbench-sheet-layout.ts create mode 100644 src/features/workbench/components/mobile-workbench-sheet.test.ts create mode 100644 src/features/workbench/components/mobile-workbench-sheet.tsx create mode 100644 tests/browser/mobile-workbench-sheet.e2e.ts create mode 100644 tests/browser/workbench-panel-map-stability.e2e.ts create mode 100644 tests/browser/workbench-visual.e2e.ts create mode 100644 tests/browser/workbench-visual.e2e.ts-snapshots/workbench-desktop-light-chromium-linux.png create mode 100644 tests/browser/workbench-visual.e2e.ts-snapshots/workbench-desktop-satellite-chromium-linux.png create mode 100644 tests/browser/workbench-visual.e2e.ts-snapshots/workbench-desktop-wide-max-agent-chromium-linux.png create mode 100644 tests/browser/workbench-visual.e2e.ts-snapshots/workbench-mobile-agent-light-chromium-linux.png create mode 100644 tests/browser/workbench-visual.e2e.ts-snapshots/workbench-mobile-condition-satellite-chromium-linux.png diff --git a/package.json b/package.json index ab397d1..9a28d69 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@deck.gl/core": "^9.3.7", "@deck.gl/layers": "^9.3.7", "@deck.gl/mapbox": "^9.3.7", + "@fontsource-variable/noto-sans-sc": "5.3.0", "@radix-ui/react-accordion": "^1.2.14", "@radix-ui/react-collapsible": "^1.1.14", "@radix-ui/react-dialog": "^1.1.17", diff --git a/playwright.config.ts b/playwright.config.ts index 8f32457..b5d83bc 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,6 +10,9 @@ export default defineConfig({ reporter: "html", use: { baseURL, + locale: "zh-CN", + timezoneId: "Asia/Shanghai", + deviceScaleFactor: 1, trace: "on-first-retry" }, webServer: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f0fe7df..344dda0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@deck.gl/mapbox': specifier: ^9.3.7 version: 9.3.7(@deck.gl/core@9.3.7)(@luma.gl/core@9.3.6)(@math.gl/web-mercator@4.1.0) + '@fontsource-variable/noto-sans-sc': + specifier: 5.3.0 + version: 5.3.0 '@radix-ui/react-accordion': specifier: ^1.2.14 version: 1.2.17(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7) @@ -681,6 +684,9 @@ packages: '@floating-ui/utils@0.2.12': resolution: {integrity: sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==} + '@fontsource-variable/noto-sans-sc@5.3.0': + resolution: {integrity: sha512-lNar1dF7Ik/lHNPo/7JWG0TolXY29LtsqYgMvEysooZ5bsO9uH4shJmRrwyJ3PjyTPljhpMJEK0jDuLSU4vJ1w==} + '@humanfs/core@0.19.2': resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} engines: {node: '>=18.18.0'} @@ -4671,6 +4677,8 @@ snapshots: '@floating-ui/utils@0.2.12': {} + '@fontsource-variable/noto-sans-sc@5.3.0': {} + '@humanfs/core@0.19.2': dependencies: '@humanfs/types': 0.15.0 diff --git a/src/features/agent/components/agent-collapsed-rail.tsx b/src/features/agent/components/agent-collapsed-rail.tsx index 572da45..db3569c 100644 --- a/src/features/agent/components/agent-collapsed-rail.tsx +++ b/src/features/agent/components/agent-collapsed-rail.tsx @@ -1,7 +1,6 @@ import { ChevronRight } from "lucide-react"; import type { PersonaState } from "@/shared/ai-elements/persona"; import { cn } from "@/shared/ui/cn"; -import { MAP_MAJOR_PANEL_RADIUS_CLASS_NAME } from "@/features/map/core"; import { AgentPersona } from "./agent-persona"; type AgentCollapsedRailProps = { @@ -21,8 +20,7 @@ export function AgentCollapsedRail({