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.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
style(webv2): standardize workbench chrome recipes
joshistoast5000102ef3db
diff --git a/invokeai/frontend/webv2/src/theme/recipes.ts b/invokeai/frontend/webv2/src/theme/recipes.tsindex e307580529..215868fc24 100644--- a/invokeai/frontend/webv2/src/theme/recipes.ts+++ b/invokeai/frontend/webv2/src/theme/recipes.ts@@ -1,4 +1,5 @@import { defineRecipe, defineSlotRecipe } from '@chakra-ui/react';+import { slotRecipes as chakraSlotRecipes } from '@chakra-ui/react/theme';/*** Reusable, theme-aware recipes for the workbench design system.@@ -7,8 +8,9 @@ import { defineRecipe, defineSlotRecipe } from '@chakra-ui/react';* the active theme. Two kinds live here:** 1. Overrides for Chakra's built-in component recipes (`tooltip`, `menu`,- * `dialog`) — registered in `system.ts` so every instance app-wide gets- * the workbench chrome with zero props at the call site.+ * `select`, `combobox`, `dialog`) — registered in `system.ts` so every+ * instance app-wide gets the workbench chrome with zero props at the call+ * site.* 2. Workbench-specific recipes (`panel`, `row`, `chip`, `fieldLabel`,* `themeCard`) — consumed via the wrappers in `workbench/components/ui`* with `useRecipe({ recipe })` / `useSlotRecipe({ recipe })`, which keeps@@ -40,14 +42,92 @@ export const tooltipSlotRecipe = defineSlotRecipe({},});+const dropdownContent = {+ bg: 'bg.muted',+ borderColor: 'border.emphasized',+ borderRadius: 'lg',+ borderWidth: '1px',+ boxShadow: 'lg',+ color: 'fg',+};++const dropdownItem = {+ _highlighted: { bg: 'bg.subtle' },+ _focusVisible: { outline: '2px solid', outlineColor: 'accent.solid', outlineOffset: '-2px' },+};++const dropdownGroupLabel = {+ color: 'fg.subtle',+ fontSize: '2xs',+ fontWeight: '600',+ letterSpacing: '0.02em',+ textTransform: 'uppercase',+};+/** Menu / context-menu chrome: popover surface with an emphasized stroke. */export const menuSlotRecipe = defineSlotRecipe({- slots: ['content'],+ ...chakraSlotRecipes.menu,base: {+ ...chakraSlotRecipes.menu.base,content: {- borderColor: 'border.emphasized',- borderRadius: 'lg',- borderWidth: '1px',+ ...chakraSlotRecipes.menu.base?.content,+ ...dropdownContent,+ },+ item: {+ ...chakraSlotRecipes.menu.base?.item,+ ...dropdownItem,+ },+ itemGroupLabel: {+ ...chakraSlotRecipes.menu.base?.itemGroupLabel,+ ...dropdownGroupLabel,+ },+ separator: {+ ...chakraSlotRecipes.menu.base?.separator,+ bg: 'border.subtle',+ },+ },+});++/** Select dropdown chrome: same surface and item treatment as menus. */+export const selectSlotRecipe = defineSlotRecipe({+ ...chakraSlotRecipes.select,+ base: {+ ...chakraSlotRecipes.select.base,+ content: {+ ...chakraSlotRecipes.select.base?.content,+ ...dropdownContent,+ },+ item: {+ ...chakraSlotRecipes.select.base?.item,+ ...dropdownItem,+ },+ itemGroupLabel: {+ ...chakraSlotRecipes.select.base?.itemGroupLabel,+ ...dropdownGroupLabel,+ },+ },+});++/** Combobox chrome: kept aligned with Select for future searchable fields. */+export const comboboxSlotRecipe = defineSlotRecipe({+ ...chakraSlotRecipes.combobox,+ base: {+ ...chakraSlotRecipes.combobox.base,+ content: {+ ...chakraSlotRecipes.combobox.base?.content,+ ...dropdownContent,+ },+ input: {+ ...chakraSlotRecipes.combobox.base?.input,+ _hover: { borderColor: 'border.emphasized' },+ },+ item: {+ ...chakraSlotRecipes.combobox.base?.item,+ ...dropdownItem,+ },+ itemGroupLabel: {+ ...chakraSlotRecipes.combobox.base?.itemGroupLabel,+ ...dropdownGroupLabel,},},});@@ -63,6 +143,20 @@ export const dialogSlotRecipe = defineSlotRecipe({},});+/** Slider marks: compact auxiliary labels for dense widget controls. */+export const sliderSlotRecipe = defineSlotRecipe({+ ...chakraSlotRecipes.slider,+ base: {+ ...chakraSlotRecipes.slider.base,+ markerLabel: {+ ...chakraSlotRecipes.slider.base?.markerLabel,+ color: 'fg.subtle',+ fontSize: '0.5rem',+ lineHeight: '1',+ },+ },+});+/* -------------------------------------------------------------------------- ** Workbench recipes (consumed through workbench/components/ui wrappers)* -------------------------------------------------------------------------- */diff --git a/invokeai/frontend/webv2/src/theme/system.ts b/invokeai/frontend/webv2/src/theme/system.tsindex e1d0aade03..2db12f586a 100644--- a/invokeai/frontend/webv2/src/theme/system.ts+++ b/invokeai/frontend/webv2/src/theme/system.ts@@ -1,6 +1,13 @@import { createSystem, defaultConfig, defineConfig } from '@chakra-ui/react';-import { dialogSlotRecipe, menuSlotRecipe, tooltipSlotRecipe } from './recipes';+import {+ comboboxSlotRecipe,+ dialogSlotRecipe,+ menuSlotRecipe,+ selectSlotRecipe,+ sliderSlotRecipe,+ tooltipSlotRecipe,+} from './recipes';import { DEFAULT_THEME, DEFAULT_THEME_ID, type NeutralStep, THEMES, type ThemeDefinition } from './themes';/**@@ -236,8 +243,11 @@ const config = defineConfig({// Chrome-level overrides for Chakra's built-in components, so popover and// dialog surfaces are consistent everywhere without per-instance props.slotRecipes: {+ combobox: comboboxSlotRecipe,dialog: dialogSlotRecipe,menu: menuSlotRecipe,+ select: selectSlotRecipe,+ slider: sliderSlotRecipe,tooltip: tooltipSlotRecipe,},},diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsxindex d6c28226d7..2111651dbe 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx@@ -1,4 +1,4 @@-import { Flex, Separator } from '@chakra-ui/react';+import { Box, Flex, Separator } from '@chakra-ui/react';import { AccountMenu } from '@workbench/auth/components/AccountMenu';import { ProjectTabs } from '@workbench/projects/components';@@ -20,10 +20,14 @@ export const TopBar = () => (flexShrink={0}gap="2"h="12"+ ps="0.5"pe="1.5"w="full">- <BrandMark />+ <Box h="12" w="12">+ <BrandMark />+ </Box>+ <Separator orientation="vertical" h={5} ms="-2" /><InvokeControl /><BatchCountField /><QueueInfo />diff --git a/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetBar.tsx b/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetBar.tsxindex 8b9615bca9..122396bed3 100644--- a/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetBar.tsx+++ b/invokeai/frontend/webv2/src/workbench/widget-frame/WidgetBar.tsx@@ -42,7 +42,7 @@ export const WidgetBar = ({ activeId, menuItems, onSelect, onToggle, railItems,direction="column"flexShrink={0}gap="1.5"- pt="2.5"+ pt="1.5"w="12">{railItems.map((item) => (@@ -70,6 +70,7 @@ const WidgetSlot = ({tooltipPlacement: 'left' | 'right';}) => {const tooltipLabel = item.failureMessage ? `${item.label}: ${item.failureMessage}` : item.label;+ const isDisabled = item.status === 'disabled';return (<Tooltip@@ -82,16 +83,21 @@ const WidgetSlot = ({<Rowactive={isActive ? 'accent' : 'none'}aria-label={item.label}- aria-disabled={item.status === 'disabled'}+ aria-disabled={isDisabled}aria-pressed={isActive}as="button"+ data-disabled={isDisabled ? '' : undefined}h="9"justifyContent="center"- pointerEvents={item.status === 'disabled' ? 'none' : 'auto'}rounded="md"+ tabIndex={isDisabled ? -1 : undefined}w="9"_disabled={{ opacity: 0.4 }}- onClick={() => onSelect(item.id)}+ onClick={() => {+ if (!isDisabled) {+ onSelect(item.id);+ }+ }}><WidgetIcon iconId={item.iconId} boxSize="5" /></Row>