Advance M8-M11 parity workflows
This commit is contained in:
@@ -40,6 +40,7 @@ export interface WebWorkspaceState {
|
||||
workspaces: Record<WorkspaceId, WorkspaceIR>;
|
||||
context: UIContextIR;
|
||||
operatorSearchOpen: boolean;
|
||||
openMenu: string | null;
|
||||
sidebarVisible: boolean;
|
||||
}
|
||||
|
||||
@@ -48,6 +49,7 @@ export type UICommand =
|
||||
| { type: "setMode"; mode: BlenderMode }
|
||||
| { type: "setActiveArea"; areaId: string }
|
||||
| { type: "toggleOperatorSearch"; open?: boolean }
|
||||
| { type: "toggleMenu"; menu?: string }
|
||||
| { type: "toggleSidebar"; visible?: boolean };
|
||||
|
||||
function regions(): RegionIR[] {
|
||||
@@ -92,6 +94,7 @@ export function createDefaultWebWorkspaceState(): WebWorkspaceState {
|
||||
revision: 0,
|
||||
},
|
||||
operatorSearchOpen: false,
|
||||
openMenu: null,
|
||||
sidebarVisible: true,
|
||||
};
|
||||
}
|
||||
@@ -122,7 +125,9 @@ export function reduceUICommand(state: WebWorkspaceState, command: UICommand): W
|
||||
};
|
||||
}
|
||||
case "toggleOperatorSearch":
|
||||
return { ...state, operatorSearchOpen: command.open ?? !state.operatorSearchOpen };
|
||||
return { ...state, operatorSearchOpen: command.open ?? !state.operatorSearchOpen, openMenu: command.open === false ? state.openMenu : null };
|
||||
case "toggleMenu":
|
||||
return { ...state, openMenu: state.openMenu === command.menu ? null : command.menu ?? null, operatorSearchOpen: null === command.menu ? state.operatorSearchOpen : false };
|
||||
case "toggleSidebar":
|
||||
return { ...state, sidebarVisible: command.visible ?? !state.sidebarVisible };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user