fix(c2,arch-004): workspace visibleModuleKeys respects is_visible=false
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user