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 history controls widget

joshistoast60abc3b8a302
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/history-controls/HistoryControlsWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/history-controls/HistoryControlsWidgetView.tsx
deleted file mode 100644
index 1e2be43b7c..0000000000
--- a/invokeai/frontend/webv2/src/workbench/widgets/history-controls/HistoryControlsWidgetView.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { HStack } from '@chakra-ui/react';
-import { IconButton } from '@workbench/components/ui';
-import { useActiveProjectSelector, useWorkbenchDispatch } from '@workbench/WorkbenchContext';
-import { Redo2Icon, Undo2Icon } from 'lucide-react';
-
-export const HistoryControlsWidgetView = () => {
- const canUndo = useActiveProjectSelector((project) => project.undoRedo.past.length > 0);
- const canRedo = useActiveProjectSelector((project) => project.undoRedo.future.length > 0);
- const dispatch = useWorkbenchDispatch();
-
- return (
- <HStack align="stretch" gap="1" h="full">
- <IconButton
- aria-label="Undo"
- aspectRatio="1 / 1"
- disabled={!canUndo}
- h="full"
- minH="0"
- minW="0"
- variant="ghost"
- onClick={(event) => {
- event.stopPropagation();
- dispatch({ type: 'undoProjectChange' });
- }}
- >
- <Undo2Icon />
- </IconButton>
- <IconButton
- aria-label="Redo"
- aspectRatio="1 / 1"
- disabled={!canRedo}
- h="full"
- minH="0"
- minW="0"
- variant="ghost"
- onClick={(event) => {
- event.stopPropagation();
- dispatch({ type: 'redoProjectChange' });
- }}
- >
- <Redo2Icon />
- </IconButton>
- </HStack>
- );
-};
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/history-controls/index.ts b/invokeai/frontend/webv2/src/workbench/widgets/history-controls/index.ts
deleted file mode 100644
index 4cdf228129..0000000000
--- a/invokeai/frontend/webv2/src/workbench/widgets/history-controls/index.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { WidgetManifest } from '@workbench/types';
-
-import { Undo2Icon } from 'lucide-react';
-
-import { HistoryControlsWidgetView } from './HistoryControlsWidgetView';
-
-export const historyControlsWidgetManifest: WidgetManifest = {
- allowMultiple: false,
- allowedRegions: ['bottom'],
- centerPlacement: 'toolbar',
- failurePolicy: { isolateRenderFailure: true, onRegistrationFailure: 'disable' },
- icon: Undo2Icon,
- id: 'history-controls',
- label: 'History Controls',
- labelText: 'History Controls',
- version: 1,
- view: HistoryControlsWidgetView,
-};