feat: add project-aware agent workspace
Generic Container CI/CD / test-build-publish (push) Successful in 2m9s
Frontend CI/CD / build-test-publish-and-deploy (push) Successful in 2m39s

This commit is contained in:
2026-10-22 18:52:18 +08:00
parent c6a0e74e72
commit 2d8506fea0
191 changed files with 12373 additions and 3556 deletions
@@ -58,6 +58,7 @@ export function isPointOccludedByCityBuilding(map: CityOcclusionMap, point: Poin
}
type UseMapInteractionsOptions = {
enabled?: boolean;
availableSourceIds: readonly WaterNetworkSourceId[];
mapRef: RefObject<MapLibreMap | null>;
mapReady: boolean;
@@ -66,6 +67,7 @@ type UseMapInteractionsOptions = {
};
export function useMapInteractions({
enabled = true,
availableSourceIds,
mapRef,
mapReady,
@@ -74,7 +76,7 @@ export function useMapInteractions({
}: UseMapInteractionsOptions) {
useEffect(() => {
const map = mapRef.current;
if (!mapReady || !map) return;
if (!mapReady || !map || !enabled) return;
let hoveredFeature: FeatureReference | null = null;
@@ -127,12 +129,15 @@ export function useMapInteractions({
map.on("click", hitLayerIds, handleClick);
return () => {
// eslint-disable-next-line react-hooks/exhaustive-deps -- Read the live owner ref to detect map disposal.
if (mapRef.current !== map) return;
clearHoveredFeature();
map.getCanvas().style.cursor = "";
map.off("mousemove", hitLayerIds, handleMouseMove);
map.off("mouseleave", hitLayerIds, handleMouseLeave);
map.off("click", hitLayerIds, handleClick);
};
}, [availableSourceIds, mapRef, mapReady, onSelectFeature, selectedFeature]);
}, [availableSourceIds, mapRef, mapReady, onSelectFeature, selectedFeature, enabled]);
useEffect(() => {
const map = mapRef.current;
@@ -142,7 +147,8 @@ export function useMapInteractions({
setMapFeatureInteractionState(map, next, { selected: true, hovered: false });
}
return () => {
if (next && map.getSource(next.source)) {
// eslint-disable-next-line react-hooks/exhaustive-deps -- Read the live owner ref to detect map disposal.
if (mapRef.current === map && next && map.getSource(next.source)) {
clearMapFeatureInteractionState(map, next, "selected");
}
};