Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

refactor(webv2): remove layout actions widget

joshistoast48775eb27c9e
diff --git a/invokeai/frontend/webv2/src/workbench/types.ts b/invokeai/frontend/webv2/src/workbench/types.ts
index 4318f7a575..e04a82afd0 100644
--- a/invokeai/frontend/webv2/src/workbench/types.ts
+++ b/invokeai/frontend/webv2/src/workbench/types.ts
@@ -15,7 +15,6 @@ export type FirstPartyWidgetTypeId =
| 'gallery'
| 'generate'
| 'history-controls'
- | 'layout-actions'
| 'layers'
| 'notifications'
| 'preview'
diff --git a/invokeai/frontend/webv2/src/workbench/widgetPlacementCommands.test.ts b/invokeai/frontend/webv2/src/workbench/widgetPlacementCommands.test.ts
index ca657e2a2e..a2fd3582ad 100644
--- a/invokeai/frontend/webv2/src/workbench/widgetPlacementCommands.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/widgetPlacementCommands.test.ts
@@ -137,10 +137,10 @@ describe('widget placement commands', () => {
openWidgetPlacement({
dispatch,
getWidgetsForRegion: createRegistry({
- center: [createWidget({ centerPlacement: 'toolbar', id: 'layout-actions', labelText: 'Layout Actions' })],
+ center: [createWidget({ centerPlacement: 'toolbar', id: 'toolbar-tools', labelText: 'Toolbar Tools' })],
}),
options: { preferredRegions: ['center'] },
- typeId: 'layout-actions',
+ typeId: 'toolbar-tools',
})
).toEqual({ ok: false, reason: 'unavailable' });
expect(actions).toEqual([]);
diff --git a/invokeai/frontend/webv2/src/workbench/widgetRegionViewModel.test.ts b/invokeai/frontend/webv2/src/workbench/widgetRegionViewModel.test.ts
index c706d6d913..2870e8430c 100644
--- a/invokeai/frontend/webv2/src/workbench/widgetRegionViewModel.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/widgetRegionViewModel.test.ts
@@ -79,19 +79,19 @@ describe('widget region view model', () => {
it('identifies the last enabled center view as required', () => {
const viewModel = createWidgetRegionViewModel({
- instanceIds: ['canvas', 'layout-actions'],
+ instanceIds: ['canvas', 'toolbar-tools'],
region: 'center',
widgetInstances: {
canvas: createInstance('canvas', 'canvas'),
- 'layout-actions': createInstance('layout-actions', 'layout-actions'),
+ 'toolbar-tools': createInstance('toolbar-tools', 'toolbar-tools'),
},
widgets: [
createWidget({ centerPlacement: 'view', id: 'canvas', labelText: 'Canvas' }),
- createWidget({ centerPlacement: 'toolbar', id: 'layout-actions', labelText: 'Layout Actions' }),
+ createWidget({ centerPlacement: 'toolbar', id: 'toolbar-tools', labelText: 'Toolbar Tools' }),
],
});
const canvas = viewModel.placedItems.find((item) => item.id === 'canvas');
- const toolbar = viewModel.placedItems.find((item) => item.id === 'layout-actions');
+ const toolbar = viewModel.placedItems.find((item) => item.id === 'toolbar-tools');
expect(canvas).toBeDefined();
expect(toolbar).toBeDefined();
diff --git a/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts b/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts
index dc9224467d..37c7de0161 100644
--- a/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts
+++ b/invokeai/frontend/webv2/src/workbench/widgetRegistry.ts
@@ -14,7 +14,6 @@ import { diagnosticsWidgetManifest } from './widgets/diagnostics';
import { galleryWidgetManifest } from './widgets/gallery';
import { generateWidgetManifest } from './widgets/generate';
import { layersWidgetManifest } from './widgets/layers';
-import { layoutActionsWidgetManifest } from './widgets/layout-actions';
import { notificationsWidgetManifest } from './widgets/notifications';
import { previewWidgetManifest } from './widgets/preview';
import { projectWidgetManifest } from './widgets/project';
@@ -36,7 +35,6 @@ export const firstPartyWidgetManifests: WidgetManifest[] = [
notificationsWidgetManifest,
serverStatusWidgetManifest,
autosaveStatusWidgetManifest,
- layoutActionsWidgetManifest,
versionStatusWidgetManifest,
];
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutActionsWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutActionsWidgetView.tsx
deleted file mode 100644
index 8dc39e8b49..0000000000
--- a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutActionsWidgetView.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Text } from '@chakra-ui/react';
-
-export const LayoutActionsWidgetView = () => (
- <Text color="fg.subtle" fontSize="2xs">
- Reset restores the active preset. Recover reopens the shell regions.
- </Text>
-);
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutHeaderActions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutHeaderActions.tsx
deleted file mode 100644
index 2a4065f37a..0000000000
--- a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutHeaderActions.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { HStack } from '@chakra-ui/react';
-import { Button } from '@workbench/components/ui';
-import { useWorkbenchDispatch } from '@workbench/WorkbenchContext';
-
-export const LayoutHeaderActions = () => {
- const dispatch = useWorkbenchDispatch();
-
- return (
- <HStack gap="1">
- <Button
- color="fg.muted"
- fontSize="2xs"
- size="2xs"
- variant="ghost"
- _hover={{ color: 'fg' }}
- onClick={(event) => {
- event.stopPropagation();
- dispatch({ type: 'resetActiveLayout' });
- }}
- >
- Reset Layout
- </Button>
- <Button
- color="fg.muted"
- fontSize="2xs"
- size="2xs"
- variant="ghost"
- _hover={{ color: 'fg' }}
- onClick={(event) => {
- event.stopPropagation();
- dispatch({ type: 'recoverShellLayout' });
- }}
- >
- Recover Layout
- </Button>
- </HStack>
- );
-};
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/index.ts b/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/index.ts
deleted file mode 100644
index 74680d0d41..0000000000
--- a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/index.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { WidgetManifest } from '@workbench/types';
-
-import { PanelBottomIcon } from 'lucide-react';
-
-import { LayoutActionsWidgetView } from './LayoutActionsWidgetView';
-import { LayoutHeaderActions } from './LayoutHeaderActions';
-
-export const layoutActionsWidgetManifest: WidgetManifest = {
- allowMultiple: false,
- allowedRegions: ['bottom'],
- failurePolicy: { isolateRenderFailure: true, onRegistrationFailure: 'disable' },
- headerActions: LayoutHeaderActions,
- icon: PanelBottomIcon,
- id: 'layout-actions',
- label: 'Layout Actions',
- labelText: 'Layout Actions',
- version: 1,
- view: LayoutActionsWidgetView,
-};
diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.ts
index 6ce1ccbb25..0a05cfa223 100644
--- a/invokeai/frontend/webv2/src/workbench/workbenchState.ts
+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.ts
@@ -518,7 +518,6 @@ const createWidgetStates = (): WidgetStateMap => ({
diagnostics: { id: 'diagnostics', label: 'Diagnostics', values: {}, version: 1 },
gallery: { id: 'gallery', label: 'Gallery', values: {}, version: 1 },
generate: { graphId: 'generate-graph', id: 'generate', label: 'Generate', values: {}, version: 1 },
- 'layout-actions': { id: 'layout-actions', label: 'Layout Actions', values: {}, version: 1 },
layers: { id: 'layers', label: 'Layers', values: {}, version: 1 },
notifications: { id: 'notifications', label: 'Notifications', values: {}, version: 1 },
preview: { id: 'preview', label: 'Preview', values: {}, version: 1 },
@@ -560,7 +559,6 @@ const defaultWidgetInstanceTypes: Record<WidgetInstanceId, WidgetTypeId> = {
'gallery:bottom': 'gallery',
'gallery:center': 'gallery',
generate: 'generate',
- 'layout-actions': 'layout-actions',
layers: 'layers',
notifications: 'notifications',
preview: 'preview',
@@ -604,7 +602,6 @@ const createWidgetRegions = (): Record<WidgetRegion, WidgetRegionState> => ({
'gallery:bottom',
'notifications',
'autosave-status',
- 'layout-actions',
'version-status',
'workflow:bottom',
],