style: refine acrylic workbench surfaces

This commit is contained in:
2026-07-15 17:07:32 +08:00
parent 8978f2d167
commit 16ecb69d00
41 changed files with 838 additions and 606 deletions
+1 -29
View File
@@ -10,10 +10,7 @@ import {
simulationAnnotationLayers,
simulationSources
} from "../map/annotation-layers";
import {
fitNetworkBounds,
getResponsiveWorkbenchPadding
} from "../map/camera";
import { fitNetworkBounds } from "../map/camera";
import {
waterNetworkBusinessLayers,
waterNetworkHitLayers,
@@ -98,7 +95,6 @@ export function useWorkbenchMap({
const mapRef = useRef<MapLibreMap | null>(null);
const impactVisibleRef = useRef(impactVisible);
const layoutOpenRef = useRef({ leftPanelOpen, rightPanelOpen });
const appliedLayoutPaddingRef = useRef<{ leftPanelOpen: boolean; rightPanelOpen: boolean } | null>(null);
const [mapReady, setMapReady] = useState(false);
const [mapError, setMapError] = useState<string | null>(null);
const [sourceStatuses, setSourceStatuses] = useState<Record<string, WorkbenchSourceStatus>>({});
@@ -223,30 +219,6 @@ export function useWorkbenchMap({
selectedFeature
});
useEffect(() => {
const map = mapRef.current;
if (!mapReady || !map) {
return;
}
const previousLayout = appliedLayoutPaddingRef.current;
const currentLayout = { leftPanelOpen, rightPanelOpen };
appliedLayoutPaddingRef.current = currentLayout;
if (
!previousLayout ||
(previousLayout.leftPanelOpen === currentLayout.leftPanelOpen &&
previousLayout.rightPanelOpen === currentLayout.rightPanelOpen)
) {
return;
}
map.easeTo({
padding: getResponsiveWorkbenchPadding(map, leftPanelOpen, rightPanelOpen),
duration: 350
});
}, [leftPanelOpen, rightPanelOpen, mapReady]);
useSimulationLayerVisibility({
mapRef,
mapReady,