fix(c2,arch-004): workspace visibleModuleKeys respects is_visible=false
This commit is contained in:
@@ -36,7 +36,7 @@ export interface WorkspaceContextState {
|
|||||||
name?: string;
|
name?: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
role?: 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[];
|
widgets: WorkspaceWidgetConfig[];
|
||||||
error?: string;
|
error?: string;
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,13 @@ export const useWorkspaceStore = create<WorkspaceStoreState>()(
|
|||||||
|
|
||||||
visibleModuleKeys: () => {
|
visibleModuleKeys: () => {
|
||||||
const ctx = get().context;
|
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,
|
hasWorkspaces: () => get().myWorkspaces.length > 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user