fix(c2,arch-004): workspace visibleModuleKeys respects is_visible=false

This commit is contained in:
Agent Zero
2026-08-23 22:01:38 +02:00
parent 5e9be254e2
commit 4bce89aecb
+8 -2
View File
@@ -36,7 +36,7 @@ export interface WorkspaceContextState {
name?: string;
icon?: string;
role?: string;
modules: { module_key: string; menu_order: number; config: Record<string, any> }[];
modules: { module_key: string; menu_order: number; config: Record<string, any>; is_visible?: boolean }[];
widgets: WorkspaceWidgetConfig[];
error?: string;
}
@@ -102,7 +102,13 @@ export const useWorkspaceStore = create<WorkspaceStoreState>()(
visibleModuleKeys: () => {
const ctx = get().context;
return new Set(ctx?.modules?.map(m => m.module_key) || []);
// ARCH-004: respect is_visible=false from workspace module config.
// Modules without the flag stay visible (backward compatible).
return new Set(
(ctx?.modules ?? [])
.filter(m => m.is_visible !== false)
.map(m => m.module_key)
);
},
hasWorkspaces: () => get().myWorkspaces.length > 0,