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
@@ -40,6 +40,7 @@ export type WorkbenchDrawingAnnotation = {
};
type UseWorkbenchDrawingOptions = {
selectionEnabled?: boolean;
mapRef: RefObject<MapLibreMap | null>;
mapReady: boolean;
activeMode: WorkbenchDrawMode | null;
@@ -47,6 +48,7 @@ type UseWorkbenchDrawingOptions = {
};
export function useWorkbenchDrawing({
selectionEnabled = true,
mapRef,
mapReady,
activeMode,
@@ -134,7 +136,7 @@ export function useWorkbenchDrawing({
useEffect(() => {
const map = mapRef.current;
if (!mapReady || !map || activeMode) {
if (!mapReady || !map || activeMode || !selectionEnabled) {
return;
}
@@ -167,6 +169,9 @@ export function useWorkbenchDrawing({
});
return () => {
// The map owner may already have disposed this instance during project switching.
// eslint-disable-next-line react-hooks/exhaustive-deps -- Read the live owner ref to detect map disposal.
if (mapRef.current !== activeMap) return;
DRAWING_INTERACTIVE_LAYER_IDS.forEach((layerId) => {
if (activeMap.getLayer(layerId)) {
activeMap.off("click", layerId, handleDrawingClick);
@@ -175,7 +180,7 @@ export function useWorkbenchDrawing({
}
});
};
}, [activeMode, mapReady, mapRef]);
}, [activeMode, mapReady, mapRef, selectionEnabled]);
const updateDraft = useCallback(
(draft: DrawingDraftState | null) => {