From 74bf7c64c4867be6e083f138f58bddb72b2d1a27 Mon Sep 17 00:00:00 2001 From: Huarch Date: Mon, 2 Nov 2026 15:35:11 +0800 Subject: [PATCH] fix: align map control hover spacing Let control surfaces size to their 40px buttons, padding and borders. Reserve the resulting 50px mobile dock height to keep the map controls clear. The initial alignment check covered only horizontal spacing and missed the mobile height constraint. Check all four outer edges at desktop and mobile widths, plus the dock gap, to prevent recurrence. --- src/features/map/core/components/toolbar.tsx | 2 +- src/features/map/core/components/zoom.tsx | 2 +- .../workbench/layout/workbench-layout.test.ts | 4 +- .../workbench/layout/workbench-layout.ts | 2 +- src/features/workbench/map-workbench-page.tsx | 2 +- tests/browser/map-control-alignment.e2e.ts | 56 +++++++++++++++++++ 6 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 tests/browser/map-control-alignment.e2e.ts diff --git a/src/features/map/core/components/toolbar.tsx b/src/features/map/core/components/toolbar.tsx index 1ec3da1..ae7b8e9 100644 --- a/src/features/map/core/components/toolbar.tsx +++ b/src/features/map/core/components/toolbar.tsx @@ -47,7 +47,7 @@ export function MapToolbar({ "pointer-events-auto p-1", MAP_CONTROL_RADIUS_CLASS_NAME, MAP_CONTROL_SURFACE_CLASS_NAME, - isVertical ? "flex w-12 flex-col" : "inline-flex", + isVertical ? "flex w-fit flex-col" : "inline-flex", className )} > diff --git a/src/features/map/core/components/zoom.tsx b/src/features/map/core/components/zoom.tsx index 8f0b15d..210afb1 100644 --- a/src/features/map/core/components/zoom.tsx +++ b/src/features/map/core/components/zoom.tsx @@ -86,7 +86,7 @@ export function MapZoom({
{ expect(resolveMobileWorkbenchOverlayLayout(true)).toEqual({ timelineBottom: 12, dockBottom: 68, - mapControlBottom: 120 + mapControlBottom: 126 }); expect(resolveMobileWorkbenchOverlayLayout(false)).toEqual({ timelineBottom: 12, dockBottom: 12, - mapControlBottom: 64 + mapControlBottom: 70 }); }); diff --git a/src/features/workbench/layout/workbench-layout.ts b/src/features/workbench/layout/workbench-layout.ts index 750dc21..2e57b89 100644 --- a/src/features/workbench/layout/workbench-layout.ts +++ b/src/features/workbench/layout/workbench-layout.ts @@ -32,7 +32,7 @@ export const WORKBENCH_LAYOUT = { mobileOverlay: { edgeInset: 12, gap: 8, - dockHeight: 44, + dockHeight: 50, // 40px buttons + 4px padding and 1px border on each side. timelineSummaryHeight: 48 } } as const; diff --git a/src/features/workbench/map-workbench-page.tsx b/src/features/workbench/map-workbench-page.tsx index a3a4d5f..d922564 100644 --- a/src/features/workbench/map-workbench-page.tsx +++ b/src/features/workbench/map-workbench-page.tsx @@ -1624,7 +1624,7 @@ function MapWorkbenchContent({ ) : null}