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.
This commit is contained in:
@@ -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
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -86,7 +86,7 @@ export function MapZoom({
|
||||
<div
|
||||
role="group"
|
||||
aria-label="地图缩放"
|
||||
className={cn("pointer-events-auto flex w-12 flex-col gap-2", className)}
|
||||
className={cn("pointer-events-auto flex w-fit flex-col gap-2", className)}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
|
||||
@@ -27,12 +27,12 @@ describe("workbench floating panels", () => {
|
||||
expect(resolveMobileWorkbenchOverlayLayout(true)).toEqual({
|
||||
timelineBottom: 12,
|
||||
dockBottom: 68,
|
||||
mapControlBottom: 120
|
||||
mapControlBottom: 126
|
||||
});
|
||||
expect(resolveMobileWorkbenchOverlayLayout(false)).toEqual({
|
||||
timelineBottom: 12,
|
||||
dockBottom: 12,
|
||||
mapControlBottom: 64
|
||||
mapControlBottom: 70
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1624,7 +1624,7 @@ function MapWorkbenchContent({
|
||||
<MapToolbar
|
||||
items={toolbarItems}
|
||||
orientation="horizontal"
|
||||
className="h-11 min-w-0 flex-1 justify-center [&>div]:min-w-0 [&>div]:flex-1 [&>div>div]:hidden [&_button]:w-full"
|
||||
className="min-w-0 flex-1 justify-center [&>div]:min-w-0 [&>div]:flex-1 [&>div>div]:hidden [&_button]:w-full"
|
||||
/>
|
||||
) : null}
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user