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.

feat(webv2): add themed workbench control wrappers

joshistoast1e40906d5481
diff --git a/invokeai/frontend/webv2/src/theme/recipes.ts b/invokeai/frontend/webv2/src/theme/recipes.ts
index 2a558c643b..531a34f0d3 100644
--- a/invokeai/frontend/webv2/src/theme/recipes.ts
+++ b/invokeai/frontend/webv2/src/theme/recipes.ts
@@ -76,3 +76,23 @@ export const fieldLabelRecipe = defineRecipe({
textTransform: 'uppercase',
},
});
+
+/** Shared tooltip chrome for workbench controls. */
+export const workbenchTooltipRecipe = defineSlotRecipe({
+ slots: ['content', 'arrow', 'arrowTip'],
+ base: {
+ content: {
+ bg: 'bg.surfaceRaised',
+ borderColor: 'border.emphasis',
+ borderWidth: '1px',
+ boxShadow: 'lg',
+ color: 'fg.default',
+ },
+ arrow: {
+ '--arrow-background': 'colors.bg.surfaceRaised',
+ },
+ arrowTip: {
+ borderColor: 'border.emphasis',
+ },
+ },
+});
diff --git a/invokeai/frontend/webv2/src/theme/system.ts b/invokeai/frontend/webv2/src/theme/system.ts
index aa78ea10df..cce1ee3cd5 100644
--- a/invokeai/frontend/webv2/src/theme/system.ts
+++ b/invokeai/frontend/webv2/src/theme/system.ts
@@ -77,22 +77,24 @@ const colorSlotByToken: Record<string, keyof ThemeColors> = {
'border.muted': 'line',
'border.emphasized': 'lineStrong',
'fg.error': 'danger',
- // Chakra's default recipes style controls through colorPalette.* even when
- // callers don't pass a colorPalette prop. Point that virtual palette at the
- // active workbench theme so Button/Input/Switch/etc. don't fall back to gray.
- 'colorPalette.fg': 'fg',
- 'colorPalette.subtle': 'surfaceRaised',
- 'colorPalette.muted': 'panel',
- 'colorPalette.emphasized': 'lineStrong',
- 'colorPalette.border': 'lineStrong',
- 'colorPalette.solid': 'accent',
- 'colorPalette.contrast': 'accentFg',
- 'colorPalette.focusRing': 'active',
};
-const semanticColors = Object.fromEntries(
- Object.entries(colorSlotByToken).map(([token, slot]) => [token, colorToken(slot)])
-);
+const semanticColors = {
+ ...Object.fromEntries(Object.entries(colorSlotByToken).map(([token, slot]) => [token, colorToken(slot)])),
+ // A real Chakra color palette used via colorPalette="theme". Chakra resolves
+ // recipe tokens like colorPalette.subtle through this nested palette, not
+ // through flat semantic-token names such as "colorPalette.subtle".
+ theme: {
+ border: colorToken('lineStrong'),
+ contrast: colorToken('accentFg'),
+ emphasized: colorToken('lineStrong'),
+ fg: colorToken('fg'),
+ focusRing: colorToken('active'),
+ muted: colorToken('panel'),
+ solid: colorToken('accent'),
+ subtle: colorToken('paletteSubtle'),
+ },
+};
const themeConditions = Object.fromEntries(
NON_DEFAULT_THEMES.map((theme) => [conditionName(theme.id), `[data-theme=${theme.id}]`])
diff --git a/invokeai/frontend/webv2/src/theme/themes.ts b/invokeai/frontend/webv2/src/theme/themes.ts
index 96f2dce493..f00c2e0bfc 100644
--- a/invokeai/frontend/webv2/src/theme/themes.ts
+++ b/invokeai/frontend/webv2/src/theme/themes.ts
@@ -50,6 +50,8 @@ export interface ThemeColors {
activeFg: string;
/** Destructive / error foreground. */
danger: string;
+ /** Chakra virtual color-palette subtle surface for component variant fills. */
+ paletteSubtle: string;
}
export interface ThemeDefinition {
@@ -85,6 +87,7 @@ const dark: ThemeColors = {
active: '#59cfff',
activeFg: '#081218',
danger: '#ff6b6b',
+ paletteSubtle: '#181918',
};
const light: ThemeColors = {
@@ -108,6 +111,7 @@ const light: ThemeColors = {
active: '#2563eb',
activeFg: '#ffffff',
danger: '#c33d3d',
+ paletteSubtle: '#f8faf5',
};
const forest: ThemeColors = {
@@ -131,6 +135,7 @@ const forest: ThemeColors = {
active: '#3fb6a0',
activeFg: '#04140f',
danger: '#e8775a',
+ paletteSubtle: '#1c3019',
};
const mono: ThemeColors = {
@@ -154,6 +159,7 @@ const mono: ThemeColors = {
active: '#9a9a9a',
activeFg: '#121212',
danger: '#d68a8a',
+ paletteSubtle: '#1b1b1b',
};
const ultradark: ThemeColors = {
@@ -177,6 +183,7 @@ const ultradark: ThemeColors = {
active: '#59cfff',
activeFg: '#05121a',
danger: '#ff6b6b',
+ paletteSubtle: '#0a0a0a',
};
/**
diff --git a/invokeai/frontend/webv2/src/workbench/components/CenterArea.tsx b/invokeai/frontend/webv2/src/workbench/components/CenterArea.tsx
index ffced93126..47cd180854 100644
--- a/invokeai/frontend/webv2/src/workbench/components/CenterArea.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/CenterArea.tsx
@@ -1,4 +1,4 @@
-import { Box, Flex, HStack, Icon, Menu, Portal, Tabs, Text } from '@chakra-ui/react';
+import { Box, Flex, HStack, Icon, Menu, Portal, Text } from '@chakra-ui/react';
import { PiCheckBold, PiDotsThreeBold } from 'react-icons/pi';
import { WidgetIcon } from '../iconResolver';
@@ -7,6 +7,8 @@ import type { RegisteredWidget, WidgetId } from '../types';
import { getWidgetsForRegion } from '../widgetRegistry';
import { useFocusRegionProps } from '../focusRegions';
import { WidgetRenderer } from './WidgetRenderer';
+import { IconButton } from './ui/Button';
+import { Tabs } from './ui/Tabs';
interface CenterWidgetItem {
id: WidgetId;
@@ -45,14 +47,13 @@ export const CenterArea = () => {
<HStack bg="bg.surfaceRaised" borderBottomWidth="1px" borderColor="border.subtle" h="10" px="1.5">
<Tabs.Root
value={activeCenterViewId}
- variant="line"
h="full"
w="full"
onValueChange={(event) =>
dispatch({ region: 'center', type: 'selectRegionWidget', widgetId: event.value as CenterWidgetItem['id'] })
}
>
- <Tabs.List gap="1">
+ <Tabs.List>
{centerViewItems.map((item) => (
<Tabs.Trigger key={item.id} value={item.id} disabled={item.status === 'disabled'} fontSize="xs" px="3">
<WidgetIcon iconId={item.widget.manifest.icon} boxSize="3.5" />
@@ -108,71 +109,62 @@ const CenterWidgetMenu = ({
enabledViewCount: number;
items: CenterWidgetItem[];
onToggle: (centerWidgetId: CenterWidgetItem['id']) => void;
-}) => (
- <Menu.Root positioning={{ placement: 'bottom-end' }}>
- <Menu.Trigger asChild>
- <Flex
- align="center"
- aria-label="Center widget menu"
- as="button"
- color="fg.default"
- h="7"
- justify="center"
- rounded="md"
- transition="background 0.12s ease, color 0.12s ease"
- w="7"
- _hover={{ bg: 'bg.surface' }}
- >
- <Icon as={PiDotsThreeBold} boxSize="4" />
- </Flex>
- </Menu.Trigger>
- <Portal>
- <Menu.Positioner>
- <Menu.Content
- bg="bg.surfaceRaised"
- borderWidth="1px"
- borderColor="border.emphasis"
- color="fg.default"
- minW="12rem"
- rounded="lg"
- shadow="lg"
- >
- <Menu.ItemGroup>
- <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">
- Center Widgets
- </Menu.ItemGroupLabel>
- {items.map((item) => {
- const isView = item.widget.manifest.centerPlacement !== 'toolbar';
- const isRequiredView = isView && item.isEnabled && enabledViewCount === 1;
+}) => {
+ return (
+ <Menu.Root positioning={{ placement: 'bottom-end' }}>
+ <Menu.Trigger asChild>
+ <IconButton aria-label="Center widget menu" size="xs" variant="ghost">
+ <Icon as={PiDotsThreeBold} boxSize="4" />
+ </IconButton>
+ </Menu.Trigger>
+ <Portal>
+ <Menu.Positioner>
+ <Menu.Content
+ bg="bg.surfaceRaised"
+ borderWidth="1px"
+ borderColor="border.emphasis"
+ color="fg.default"
+ minW="12rem"
+ rounded="lg"
+ shadow="lg"
+ >
+ <Menu.ItemGroup>
+ <Menu.ItemGroupLabel color="fg.subtle" fontSize="2xs" textTransform="uppercase">
+ Center Widgets
+ </Menu.ItemGroupLabel>
+ {items.map((item) => {
+ const isView = item.widget.manifest.centerPlacement !== 'toolbar';
+ const isRequiredView = isView && item.isEnabled && enabledViewCount === 1;
- return (
- <Menu.Item
- key={item.id}
- role="menuitemcheckbox"
- aria-checked={item.isEnabled}
- value={item.id}
- closeOnSelect={false}
- disabled={item.status === 'disabled' || isRequiredView}
- _disabled={{ opacity: 0.4 }}
- onClick={() => onToggle(item.id)}
- >
- <Icon as={PiCheckBold} boxSize="3" opacity={item.isEnabled ? 1 : 0} />
- <WidgetIcon iconId={item.widget.manifest.icon} boxSize="3.5" />
- <Menu.ItemText>{item.label}</Menu.ItemText>
- {isRequiredView ? (
- <Text color="fg.subtle" fontSize="2xs" ms="auto">
- Required
- </Text>
- ) : null}
- </Menu.Item>
- );
- })}
- </Menu.ItemGroup>
- </Menu.Content>
- </Menu.Positioner>
- </Portal>
- </Menu.Root>
-);
+ return (
+ <Menu.Item
+ key={item.id}
+ role="menuitemcheckbox"
+ aria-checked={item.isEnabled}
+ value={item.id}
+ closeOnSelect={false}
+ disabled={item.status === 'disabled' || isRequiredView}
+ _disabled={{ opacity: 0.4 }}
+ onClick={() => onToggle(item.id)}
+ >
+ <Icon as={PiCheckBold} boxSize="3" opacity={item.isEnabled ? 1 : 0} />
+ <WidgetIcon iconId={item.widget.manifest.icon} boxSize="3.5" />
+ <Menu.ItemText>{item.label}</Menu.ItemText>
+ {isRequiredView ? (
+ <Text color="fg.subtle" fontSize="2xs" ms="auto">
+ Required
+ </Text>
+ ) : null}
+ </Menu.Item>
+ );
+ })}
+ </Menu.ItemGroup>
+ </Menu.Content>
+ </Menu.Positioner>
+ </Portal>
+ </Menu.Root>
+ );
+};
const FallbackCenterView = ({ label }: { label: string }) => (
<Flex align="center" h="full" justify="center" w="full">
diff --git a/invokeai/frontend/webv2/src/workbench/components/GraphPreviewDialog.tsx b/invokeai/frontend/webv2/src/workbench/components/GraphPreviewDialog.tsx
index 40fb3f35a3..5204466715 100644
--- a/invokeai/frontend/webv2/src/workbench/components/GraphPreviewDialog.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/GraphPreviewDialog.tsx
@@ -1,8 +1,9 @@
-import { Button, Code, Dialog, Portal, ScrollArea, Stack, Text } from '@chakra-ui/react';
+import { Code, Dialog, Portal, ScrollArea, Stack, Text } from '@chakra-ui/react';
import { formatRoute, isInvocationRouteValid, resolveInvocationRoute } from '../invocation';
import type { GraphContract, GraphId, InvocationSourceId } from '../types';
import { useWorkbench } from '../WorkbenchContext';
+import { Button } from './ui/Button';
interface GraphPreviewDialogProps {
graph: GraphContract | null;
diff --git a/invokeai/frontend/webv2/src/workbench/components/GraphSurfaceActions.tsx b/invokeai/frontend/webv2/src/workbench/components/GraphSurfaceActions.tsx
index f709315886..ac7fac318c 100644
--- a/invokeai/frontend/webv2/src/workbench/components/GraphSurfaceActions.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/GraphSurfaceActions.tsx
@@ -1,10 +1,11 @@
-import { Icon, IconButton, Menu, Portal, Text } from '@chakra-ui/react';
+import { Icon, Menu, Portal, Text } from '@chakra-ui/react';
import { useState } from 'react';
import { PiDotsThreeBold, PiGraphBold, PiTargetBold } from 'react-icons/pi';
import { useWorkbench } from '../WorkbenchContext';
import type { GraphBearingSurfaceContract, GraphContract, WidgetId } from '../types';
import { GraphPreviewDialog } from './GraphPreviewDialog';
+import { IconButton } from './ui/Button';
interface GraphSurfaceActionsProps {
surface: GraphBearingSurfaceContract;
diff --git a/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx b/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx
index d744ffe63a..e72254af87 100644
--- a/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx
@@ -1,6 +1,6 @@
import { Box, HStack, Icon, Menu, Portal, Text, VStack } from '@chakra-ui/react';
import { useEffect, useRef } from 'react';
-import { PiCaretDownBold, PiCheckBold, PiLockSimpleFill, PiLightningFill } from 'react-icons/pi';
+import { PiCaretDownBold, PiCheckBold, PiLockSimpleFill, PiSparkleFill } from 'react-icons/pi';
import { useWorkbench } from '../WorkbenchContext';
import {
@@ -65,7 +65,7 @@ export const InvokeControl = () => {
}, [dispatch]);
return (
- <HStack flexShrink={0} gap="0" h="7" overflow="hidden" rounded="xs" shadow="sm" w={CONTROL_WIDTH}>
+ <HStack flexShrink={0} gap="0" h="9" overflow="hidden" rounded="sm" shadow="sm" w={CONTROL_WIDTH}>
<HStack
aria-disabled={!isValid}
aria-label={invokeLabel}
@@ -93,9 +93,9 @@ export const InvokeControl = () => {
_hover={isValid ? { filter: 'brightness(1.05)' } : undefined}
_active={{ filter: 'brightness(0.96)' }}
>
- <Icon as={PiLightningFill} boxSize="4" flexShrink={0} />
+ <Icon as={PiSparkleFill} boxSize="4" flexShrink={0} />
<VStack align="start" gap="0" minW="0">
- <Text fontSize="sm" fontWeight="800" lineHeight="1.1">
+ <Text fontSize="sm" fontWeight="700" lineHeight="1">
Invoke
</Text>
<HStack gap="1" maxW="full">
diff --git a/invokeai/frontend/webv2/src/workbench/components/LayoutPresetMenu.tsx b/invokeai/frontend/webv2/src/workbench/components/LayoutPresetMenu.tsx
index f00cf26468..0a001ea849 100644
--- a/invokeai/frontend/webv2/src/workbench/components/LayoutPresetMenu.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/LayoutPresetMenu.tsx
@@ -1,9 +1,10 @@
-import { Button, Icon, Menu, Portal, Stack, Text } from '@chakra-ui/react';
+import { Icon, Menu, Portal, Stack, Text } from '@chakra-ui/react';
import { PiCaretDownBold, PiCheckBold } from 'react-icons/pi';
import { useWorkbench } from '../WorkbenchContext';
import { getLayoutPreset, layoutPresets } from '../layoutPresets';
import type { LayoutPresetId } from '../types';
+import { Button } from './ui/Button';
/**
* Global layout preset registry surfaced as a menu.
diff --git a/invokeai/frontend/webv2/src/workbench/components/ProjectTabs.tsx b/invokeai/frontend/webv2/src/workbench/components/ProjectTabs.tsx
index b2d3ec53bb..63b33d0d1a 100644
--- a/invokeai/frontend/webv2/src/workbench/components/ProjectTabs.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/ProjectTabs.tsx
@@ -1,4 +1,5 @@
-import { Badge, CloseButton, IconButton, ScrollArea, Tabs } from '@chakra-ui/react';
+import { CloseButton, IconButton } from './ui/Button';
+import { Tabs } from './ui/Tabs';
import { PiPlusBold } from 'react-icons/pi';
import { Tooltip } from './ui/Tooltip';
@@ -19,56 +20,49 @@ export const ProjectTabs = () => {
};
return (
- <ScrollArea.Root flex="1" minW="0" size="xs" variant="hover">
- <ScrollArea.Viewport h="full" w="full">
- <Tabs.Root minW="max-content" variant="outline" value={activeProject.id}>
- <Tabs.List flex="1 1 auto" h="full">
- {state.projects.map((project) => (
- <Tabs.Trigger
- key={project.id}
- value={project.id}
- onClick={() => onSwitchProject(project.id)}
- fontSize="xs"
- >
- {project.name}
- {/*{project.id !== activeProject.id && project.queue.items.some((item) => item.resultImages?.length) ? (
+ <Tabs.Root minW="max-content" variant="subtle" value={activeProject.id} h="full" w="full">
+ <Tabs.List flex="1 1 auto" h="full" py="1">
+ {state.projects.map((project) => (
+ <Tabs.Trigger
+ key={project.id}
+ value={project.id}
+ onClick={() => onSwitchProject(project.id)}
+ fontSize="xs"
+ h="full"
+ >
+ {project.name}
+ {/*{project.id !== activeProject.id && project.queue.items.some((item) => item.resultImages?.length) ? (
<Badge colorPalette="blue" size="xs">
Results
</Badge>
) : null}*/}
- {state.projects.length > 1 && (
- <CloseButton
- size="2xs"
- as="span"
- role="button"
- onClick={(event) => {
- event.stopPropagation();
- dispatch({ projectId: project.id, type: 'closeProject' });
- }}
- />
- )}
- </Tabs.Trigger>
- ))}
- <Tooltip content="Create new project">
- <IconButton
- aria-label="Create new project"
- color="fg.muted"
- flexShrink={0}
- size="xs"
- variant="ghost"
- alignSelf="center"
- ms="2"
- onClick={() => dispatch({ type: 'createProject' })}
- >
- <PiPlusBold />
- </IconButton>
- </Tooltip>
- </Tabs.List>
- </Tabs.Root>
- </ScrollArea.Viewport>
- <ScrollArea.Scrollbar orientation="horizontal">
- <ScrollArea.Thumb />
- </ScrollArea.Scrollbar>
- </ScrollArea.Root>
+ {state.projects.length > 1 && (
+ <CloseButton
+ size="2xs"
+ as="span"
+ role="button"
+ onClick={(event) => {
+ event.stopPropagation();
+ dispatch({ projectId: project.id, type: 'closeProject' });
+ }}
+ />
+ )}
+ </Tabs.Trigger>
+ ))}
+ <Tooltip content="Create new project">
+ <IconButton
+ aria-label="Create new project"
+ flexShrink={0}
+ size="xs"
+ variant="ghost"
+ alignSelf="center"
+ ms="2"
+ onClick={() => dispatch({ type: 'createProject' })}
+ >
+ <PiPlusBold />
+ </IconButton>
+ </Tooltip>
+ </Tabs.List>
+ </Tabs.Root>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/components/StatusBar.tsx b/invokeai/frontend/webv2/src/workbench/components/StatusBar.tsx
index 1c90d90b71..79433d9d2d 100644
--- a/invokeai/frontend/webv2/src/workbench/components/StatusBar.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/StatusBar.tsx
@@ -1,4 +1,4 @@
-import { Box, Flex, Icon, Menu, Portal, Text, Tooltip } from '@chakra-ui/react';
+import { Box, Flex, Icon, Menu, Portal, Text } from '@chakra-ui/react';
import { PiCheckBold, PiDotsThreeBold } from 'react-icons/pi';
import { WidgetIcon } from '../iconResolver';
@@ -6,6 +6,7 @@ import type { RegisteredWidget, WidgetId } from '../types';
import { getWidgetsForRegion } from '../widgetRegistry';
import { useWorkbench } from '../WorkbenchContext';
import { WidgetRenderer } from './WidgetRenderer';
+import { Tooltip } from './ui/Tooltip';
interface BottomWidgetItem {
failureMessage?: string;
@@ -112,30 +113,26 @@ const CompactBottomWidget = ({
if (item.isExpandable) {
return (
- <Tooltip.Root openDelay={250} closeDelay={80} positioning={{ placement: 'top-start' }}>
- <Tooltip.Trigger asChild>{content}</Tooltip.Trigger>
- <Portal>
- <Tooltip.Positioner>
- <Tooltip.Content bg="bg.surfaceRaised" borderWidth="1px" borderColor="border.emphasis" color="fg.default">
- {item.failureMessage ? `${item.label}: ${item.failureMessage}` : item.label}
- </Tooltip.Content>
- </Tooltip.Positioner>
- </Portal>
- </Tooltip.Root>
+ <Tooltip
+ closeDelay={80}
+ content={item.failureMessage ? `${item.label}: ${item.failureMessage}` : item.label}
+ openDelay={250}
+ positioning={{ placement: 'top-start' }}
+ >
+ {content}
+ </Tooltip>
);
}
return (
- <Tooltip.Root openDelay={250} closeDelay={80} positioning={{ placement: 'top-start' }}>
- <Tooltip.Trigger asChild>{content}</Tooltip.Trigger>
- <Portal>
- <Tooltip.Positioner>
- <Tooltip.Content bg="bg.surfaceRaised" borderWidth="1px" borderColor="border.emphasis" color="fg.default">
- <WidgetRenderer widget={item.widget} presentation="tooltip" region="bottom" />
- </Tooltip.Content>
- </Tooltip.Positioner>
- </Portal>
- </Tooltip.Root>
+ <Tooltip
+ closeDelay={80}
+ content={<WidgetRenderer widget={item.widget} presentation="tooltip" region="bottom" />}
+ openDelay={250}
+ positioning={{ placement: 'top-start' }}
+ >
+ {content}
+ </Tooltip>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx b/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx
index 1c48aaaa11..687b39e99a 100644
--- a/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx
@@ -1,10 +1,11 @@
-import { Badge, Box, Flex, HStack, Icon, IconButton, NumberInput, Text } from '@chakra-ui/react';
+import { Badge, Box, Flex, HStack, Icon, NumberInput, Text } from '@chakra-ui/react';
import { PiCaretDownBold, PiCubeBold, PiListNumbersBold, PiUserCircleBold, PiXBold } from 'react-icons/pi';
import { InvokeControl } from './InvokeControl';
import { LayoutPresetMenu } from './LayoutPresetMenu';
import { ProjectTabs } from './ProjectTabs';
import { SettingsButton } from './SettingsDialog';
+import { IconButton } from './ui/Button';
import { useWorkbench } from '../WorkbenchContext';
/** Workbench top bar: brand, global Invoke command cluster, project tabs, layout + account controls. */
@@ -17,13 +18,13 @@ export const TopBar = () => (
borderColor="border.subtle"
flexShrink={0}
gap="2"
- h="10"
+ h="12"
px="3"
w="full"
>
<BrandMark />
- <BatchCountField />
<InvokeControl />
+ <BatchCountField />
<QueueCluster />
<Box w="1px" h="5" bg="border.subtle" mx="1" flexShrink={0} />
<ProjectTabs />
@@ -85,7 +86,7 @@ const BatchCountField = () => {
min={1}
size="xs"
value={String(batchCount)}
- w="16"
+ w="14"
onValueChange={({ valueAsNumber }) => {
if (Number.isFinite(valueAsNumber)) {
dispatch({ batchCount: valueAsNumber, type: 'setGenerateBatchCount' });
diff --git a/invokeai/frontend/webv2/src/workbench/components/WidgetBar.tsx b/invokeai/frontend/webv2/src/workbench/components/WidgetBar.tsx
index 8bef0cd72c..cef511a364 100644
--- a/invokeai/frontend/webv2/src/workbench/components/WidgetBar.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/WidgetBar.tsx
@@ -1,8 +1,9 @@
-import { Flex, Icon, Menu, Portal, Text, Tooltip } from '@chakra-ui/react';
+import { Flex, Icon, Menu, Portal, Text } from '@chakra-ui/react';
import { PiCheckBold, PiDotsThreeBold } from 'react-icons/pi';
import { WidgetIcon } from '../iconResolver';
import type { RegisteredWidget, WidgetIconId, WidgetId, WidgetRegion } from '../types';
+import { Tooltip } from './ui/Tooltip';
export interface WidgetBarItem {
id: WidgetId;
@@ -71,37 +72,28 @@ const WidgetSlot = ({
const tooltipLabel = item.failureMessage ? `${item.label}: ${item.failureMessage}` : item.label;
return (
- <Tooltip.Root openDelay={250} closeDelay={80} positioning={{ placement: tooltipPlacement }}>
- <Tooltip.Trigger asChild>
- <Flex
- align="center"
- aria-label={item.label}
- aria-disabled={item.status === 'disabled'}
- aria-pressed={isActive}
- as="button"
- bg={isActive ? 'accent.widget' : 'transparent'}
- color={isActive ? 'accent.widgetFg' : 'fg.default'}
- h="9"
- justify="center"
- rounded="md"
- opacity={item.status === 'disabled' ? 0.4 : 1}
- pointerEvents={item.status === 'disabled' ? 'none' : 'auto'}
- transition="background 0.12s ease, color 0.12s ease"
- w="9"
- _hover={{ bg: isActive ? 'accent.widget' : 'bg.surfaceRaised' }}
- onClick={() => onSelect(item.id)}
- >
- <WidgetIcon iconId={item.iconId} boxSize="5" />
- </Flex>
- </Tooltip.Trigger>
- <Portal>
- <Tooltip.Positioner>
- <Tooltip.Content bg="bg.surfaceRaised" borderWidth="1px" borderColor="border.emphasis" color="fg.default">
- {tooltipLabel}
- </Tooltip.Content>
- </Tooltip.Positioner>
- </Portal>
- </Tooltip.Root>
+ <Tooltip closeDelay={80} content={tooltipLabel} openDelay={250} positioning={{ placement: tooltipPlacement }}>
+ <Flex
+ align="center"
+ aria-label={item.label}
+ aria-disabled={item.status === 'disabled'}
+ aria-pressed={isActive}
+ as="button"
+ bg={isActive ? 'accent.widget' : 'transparent'}
+ color={isActive ? 'accent.widgetFg' : 'fg.default'}
+ h="9"
+ justify="center"
+ rounded="md"
+ opacity={item.status === 'disabled' ? 0.4 : 1}
+ pointerEvents={item.status === 'disabled' ? 'none' : 'auto'}
+ transition="background 0.12s ease, color 0.12s ease"
+ w="9"
+ _hover={{ bg: isActive ? 'accent.widget' : 'bg.surfaceRaised' }}
+ onClick={() => onSelect(item.id)}
+ >
+ <WidgetIcon iconId={item.iconId} boxSize="5" />
+ </Flex>
+ </Tooltip>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/components/WidgetFailureBoundary.tsx b/invokeai/frontend/webv2/src/workbench/components/WidgetFailureBoundary.tsx
index 0250949965..ec080d4559 100644
--- a/invokeai/frontend/webv2/src/workbench/components/WidgetFailureBoundary.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/WidgetFailureBoundary.tsx
@@ -1,7 +1,8 @@
-import { Button, Code, ScrollArea, Stack, Text } from '@chakra-ui/react';
+import { Code, ScrollArea, Stack, Text } from '@chakra-ui/react';
import { Component, type ErrorInfo, type ReactNode } from 'react';
import type { WidgetId } from '../types';
+import { Button } from './ui/Button';
interface WidgetFailureBoundaryProps {
widgetId: WidgetId;
diff --git a/invokeai/frontend/webv2/src/workbench/components/ui/Button.tsx b/invokeai/frontend/webv2/src/workbench/components/ui/Button.tsx
new file mode 100644
index 0000000000..303d0ad378
--- /dev/null
+++ b/invokeai/frontend/webv2/src/workbench/components/ui/Button.tsx
@@ -0,0 +1,16 @@
+import {
+ Button as ChakraButton,
+ CloseButton as ChakraCloseButton,
+ IconButton as ChakraIconButton,
+} from '@chakra-ui/react';
+import type { ComponentProps } from 'react';
+
+type ButtonProps = ComponentProps<typeof ChakraButton>;
+type IconButtonProps = ComponentProps<typeof ChakraIconButton>;
+type CloseButtonProps = ComponentProps<typeof ChakraCloseButton>;
+
+export const Button = (props: ButtonProps) => <ChakraButton colorPalette="theme" {...props} />;
+
+export const IconButton = (props: IconButtonProps) => <ChakraIconButton colorPalette="theme" {...props} />;
+
+export const CloseButton = (props: CloseButtonProps) => <ChakraCloseButton colorPalette="theme" {...props} />;
diff --git a/invokeai/frontend/webv2/src/workbench/components/ui/Tabs.tsx b/invokeai/frontend/webv2/src/workbench/components/ui/Tabs.tsx
new file mode 100644
index 0000000000..e5a36c8d66
--- /dev/null
+++ b/invokeai/frontend/webv2/src/workbench/components/ui/Tabs.tsx
@@ -0,0 +1,11 @@
+import { Tabs as ChakraTabs } from '@chakra-ui/react';
+import type { ComponentProps } from 'react';
+
+type TabsRootProps = ComponentProps<typeof ChakraTabs.Root>;
+
+const Root = (props: TabsRootProps) => <ChakraTabs.Root colorPalette="theme" {...props} />;
+
+export const Tabs = {
+ ...ChakraTabs,
+ Root,
+};
diff --git a/invokeai/frontend/webv2/src/workbench/components/ui/Tooltip.tsx b/invokeai/frontend/webv2/src/workbench/components/ui/Tooltip.tsx
index 44d402977d..56513c1d0d 100644
--- a/invokeai/frontend/webv2/src/workbench/components/ui/Tooltip.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/ui/Tooltip.tsx
@@ -1,6 +1,8 @@
-import { Tooltip as ChakraTooltip, Portal } from '@chakra-ui/react';
+import { Tooltip as ChakraTooltip, Portal, useSlotRecipe } from '@chakra-ui/react';
import * as React from 'react';
+import { workbenchTooltipRecipe } from '../../../theme/recipes';
+
export interface TooltipProps extends ChakraTooltip.RootProps {
showArrow?: boolean;
portalled?: boolean;
@@ -12,6 +14,9 @@ export interface TooltipProps extends ChakraTooltip.RootProps {
export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(props, ref) {
const { showArrow, children, disabled, portalled = true, content, contentProps, portalRef, ...rest } = props;
+ const recipe = useSlotRecipe({ recipe: workbenchTooltipRecipe });
+ const styles = recipe();
+ const { css: contentCss, ...restContentProps } = contentProps ?? {};
if (disabled) {
return children;
@@ -22,10 +27,10 @@ export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(function T
<ChakraTooltip.Trigger asChild>{children}</ChakraTooltip.Trigger>
<Portal disabled={!portalled} container={portalRef}>
<ChakraTooltip.Positioner>
- <ChakraTooltip.Content ref={ref} {...contentProps}>
+ <ChakraTooltip.Content ref={ref} css={[styles.content, contentCss]} {...restContentProps}>
{showArrow && (
- <ChakraTooltip.Arrow>
- <ChakraTooltip.ArrowTip />
+ <ChakraTooltip.Arrow css={styles.arrow}>
+ <ChakraTooltip.ArrowTip css={styles.arrowTip} />
</ChakraTooltip.Arrow>
)}
{content}
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasStagingControls.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasStagingControls.tsx
index f7117428d3..a13a19e59c 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasStagingControls.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/CanvasStagingControls.tsx
@@ -1,4 +1,4 @@
-import { Box, Button, HStack, IconButton, ScrollArea, Stack, Text } from '@chakra-ui/react';
+import { Box, HStack, ScrollArea, Stack, Text } from '@chakra-ui/react';
import {
PiCaretLeftBold,
PiCaretLineDownBold,
@@ -9,6 +9,7 @@ import {
} from 'react-icons/pi';
import type { CanvasStagingCandidateContract, GeneratedImageContract } from '../../types';
+import { Button, IconButton } from '../../components/ui/Button';
const THUMBNAIL_STRIP_HEIGHT = '5.5rem';
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsHeaderActions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsHeaderActions.tsx
index 987816dbc4..403cafbe00 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsHeaderActions.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsHeaderActions.tsx
@@ -1,6 +1,7 @@
-import { Badge, Button } from '@chakra-ui/react';
+import { Badge } from '@chakra-ui/react';
import { PiBugBold } from 'react-icons/pi';
+import { Button } from '../../components/ui/Button';
import { useWorkbench } from '../../WorkbenchContext';
export const DiagnosticsHeaderActions = () => {
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsWidgetView.tsx
index a89223ec66..e95a1f5dae 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/diagnostics/DiagnosticsWidgetView.tsx
@@ -1,9 +1,10 @@
-import { Button, HStack, Stack, Text } from '@chakra-ui/react';
+import { HStack, Stack, Text } from '@chakra-ui/react';
import { PiBugBold, PiClipboardTextBold } from 'react-icons/pi';
import { StatusWidgetChip } from '../../components/WidgetFrames';
import type { WidgetViewProps } from '../../types';
import { useWorkbench } from '../../WorkbenchContext';
+import { Button } from '../../components/ui/Button';
export const DiagnosticsWidgetView = ({ presentation, region }: WidgetViewProps) => {
const { state } = useWorkbench();
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/generate/GenerateSettingsForm.tsx b/invokeai/frontend/webv2/src/workbench/widgets/generate/GenerateSettingsForm.tsx
index d5f83da63f..4db7a78f81 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/generate/GenerateSettingsForm.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/generate/GenerateSettingsForm.tsx
@@ -1,6 +1,7 @@
-import { Button, HStack, Input, NativeSelect, Stack, Text, Textarea } from '@chakra-ui/react';
+import { HStack, Input, NativeSelect, Stack, Text, Textarea } from '@chakra-ui/react';
import type { ChangeEvent } from 'react';
+import { Button } from '../../components/ui/Button';
import { Field } from '../../components/ui/Field';
import { getSettingsWithModelDefaults } from '../../generation/graph';
import type { GenerateSettings, MainModelConfig } from '../../generation/types';
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/history-controls/HistoryControlsWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/history-controls/HistoryControlsWidgetView.tsx
index f01a760144..754d8dfb30 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/history-controls/HistoryControlsWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/history-controls/HistoryControlsWidgetView.tsx
@@ -1,6 +1,7 @@
-import { HStack, IconButton } from '@chakra-ui/react';
+import { HStack } from '@chakra-ui/react';
import { PiArrowClockwiseBold, PiArrowCounterClockwiseBold } from 'react-icons/pi';
+import { IconButton } from '../../components/ui/Button';
import { useWorkbench } from '../../WorkbenchContext';
export const HistoryControlsWidgetView = () => {
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersHeaderActions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersHeaderActions.tsx
index 9b05682735..a1083209ae 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersHeaderActions.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersHeaderActions.tsx
@@ -1,6 +1,7 @@
-import { IconButton } from '@chakra-ui/react';
import { PiDotsThreeBold } from 'react-icons/pi';
+import { IconButton } from '../../components/ui/Button';
+
export const LayersHeaderActions = () => (
<IconButton aria-label="Layer options" color="fg.muted" size="2xs" variant="ghost">
<PiDotsThreeBold />
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutHeaderActions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutHeaderActions.tsx
index b907747229..b5940fce6e 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutHeaderActions.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layout-actions/LayoutHeaderActions.tsx
@@ -1,5 +1,6 @@
-import { Button, HStack } from '@chakra-ui/react';
+import { HStack } from '@chakra-ui/react';
+import { Button } from '../../components/ui/Button';
import { useWorkbench } from '../../WorkbenchContext';
export const LayoutHeaderActions = () => {
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/notifications/NotificationsHeaderActions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/notifications/NotificationsHeaderActions.tsx
index d494b33a29..ce94421895 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/notifications/NotificationsHeaderActions.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/notifications/NotificationsHeaderActions.tsx
@@ -1,5 +1,6 @@
-import { Button, HStack } from '@chakra-ui/react';
+import { HStack } from '@chakra-ui/react';
+import { Button } from '../../components/ui/Button';
import { useWorkbench } from '../../WorkbenchContext';
export const NotificationsHeaderActions = () => {
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx
index 61139bc066..91b605af96 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx
@@ -1,7 +1,8 @@
-import { Badge, Button, Stack, Text, HStack } from '@chakra-ui/react';
+import { Badge, Stack, Text, HStack } from '@chakra-ui/react';
import { PiListNumbersBold } from 'react-icons/pi';
import { StatusWidgetChip } from '../../components/WidgetFrames';
+import { Button } from '../../components/ui/Button';
import type { WidgetViewProps } from '../../types';
import { useWorkbench } from '../../WorkbenchContext';
import { getDestinationLabel, getSourceLabel } from '../../invocation';