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
feat(theme): pair input-family sizes with buttons and speed up hover motion
Josh Corbetta639d844e933
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/GallerySearchField.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/GallerySearchField.tsxindex e826cbfa30..3376befbfa 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/GallerySearchField.tsx+++ b/invokeai/frontend/webv2/src/features/gallery/ui/GallerySearchField.tsx@@ -149,7 +149,7 @@ export const GallerySearchField = ({caretColor="fg"color="transparent"fontSize="xs"- h="8"+ h="7"minW="0"px="0"_placeholder={PLACEHOLDER_PROPS}diff --git a/invokeai/frontend/webv2/src/platform/ui/InputShell.tsx b/invokeai/frontend/webv2/src/platform/ui/InputShell.tsxindex d82c8a6734..b222fa66e7 100644--- a/invokeai/frontend/webv2/src/platform/ui/InputShell.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/InputShell.tsx@@ -29,7 +29,7 @@ export const InputShell = ({ children, endElement, ref, startElement, ...boxPropcss={inputShellInteraction}display="flex"gap="1.5"- h="8"+ h="7"minW="0"px="2"textStyle="xs"diff --git a/invokeai/frontend/webv2/src/platform/ui/SegmentTabs.tsx b/invokeai/frontend/webv2/src/platform/ui/SegmentTabs.tsxindex bee6fbd5a5..bf61155869 100644--- a/invokeai/frontend/webv2/src/platform/ui/SegmentTabs.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/SegmentTabs.tsx@@ -153,6 +153,7 @@ const SegmentTabButton = <T extends string>({role="tab"rounded="control"tabIndex={isSelected ? 0 : -1}+ transition="background var(--wb-motion-duration-fast), color var(--wb-motion-duration-fast)"type="button"_hover={isShown ? undefined : TAB_HOVER_PROPS}onClick={select}diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.tsindex 76b8cec876..d5cd0164c1 100644--- a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts+++ b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts@@ -132,10 +132,12 @@ export const tabsSlotRecipe = defineSlotRecipe({...chakraSlotRecipes.tabs.variants?.variant?.subtle,trigger: {...chakraSlotRecipes.tabs.variants?.variant?.subtle?.trigger,- // `bg.muted` disappears against muted-family chrome (the topbar- // preset strip); one surface step up reads everywhere.+ // The buttons' corner and translucent accent-leaning hover (see+ // `SegmentTabs`): solid subtle fills vanish against muted chrome.+ // Selected stays the stock accent fill — nav sidebars rely on it.+ borderRadius: 'control',_hover: {- '&:not([data-selected])': { bg: 'bg.emphasized/60' },+ '&:not([data-selected])': { bg: 'gray.hoverTint/10', color: 'fg' },},},},@@ -178,6 +180,8 @@ export const buttonRecipe = defineRecipe({base: {...chakraRecipes.button.base,borderRadius: 'control',+ // Chakra's `moderate` hover fade reads as lag on a busy workbench.+ transitionDuration: 'faster',},variants: {...chakraRecipes.button.variants,@@ -352,6 +356,14 @@ export const inputRecipe = defineRecipe({...chakraRecipes.input,variants: {...chakraRecipes.input.variants,+ // The same one-notch drop as the button scale, so same-named sizes share a+ // row height (select/combobox/numberInput repeat it for their vars).+ size: {+ ...chakraRecipes.input.variants?.size,+ xs: { ...chakraRecipes.input.variants?.size?.xs, '--input-height': 'sizes.7' },+ sm: { ...chakraRecipes.input.variants?.size?.sm, '--input-height': 'sizes.8' },+ md: { ...chakraRecipes.input.variants?.size?.md, '--input-height': 'sizes.9' },+ },variant: {...chakraRecipes.input.variants?.variant,outline: { ...chakraRecipes.input.variants?.variant?.outline, ...formControlNoFocusRing },@@ -384,6 +396,21 @@ export const numberInputSlotRecipe = defineSlotRecipe({...chakraSlotRecipes.numberInput,variants: {...chakraSlotRecipes.numberInput.variants,+ size: {+ ...chakraSlotRecipes.numberInput.variants?.size,+ xs: {+ ...chakraSlotRecipes.numberInput.variants?.size?.xs,+ input: { ...chakraSlotRecipes.numberInput.variants?.size?.xs?.input, '--input-height': 'sizes.7' },+ },+ sm: {+ ...chakraSlotRecipes.numberInput.variants?.size?.sm,+ input: { ...chakraSlotRecipes.numberInput.variants?.size?.sm?.input, '--input-height': 'sizes.8' },+ },+ md: {+ ...chakraSlotRecipes.numberInput.variants?.size?.md,+ input: { ...chakraSlotRecipes.numberInput.variants?.size?.md?.input, '--input-height': 'sizes.9' },+ },+ },variant: {...chakraSlotRecipes.numberInput.variants?.variant,outline: {@@ -421,6 +448,7 @@ export const dropdownContent = {};export const dropdownItem = {+ borderRadius: 'l2',_highlighted: { bg: 'bg.emphasized' },_hover: { bg: 'bg.emphasized' },_focusVisible: {@@ -475,6 +503,21 @@ export const selectSlotRecipe = defineSlotRecipe({// anchored to Chakra's own map, which the spread-with-override loses.variants: {...chakraSlotRecipes.select.variants,+ size: {+ ...chakraSlotRecipes.select.variants?.size,+ xs: {+ ...chakraSlotRecipes.select.variants?.size?.xs,+ root: { ...chakraSlotRecipes.select.variants?.size?.xs?.root, '--select-trigger-height': 'sizes.7' },+ },+ sm: {+ ...chakraSlotRecipes.select.variants?.size?.sm,+ root: { ...chakraSlotRecipes.select.variants?.size?.sm?.root, '--select-trigger-height': 'sizes.8' },+ },+ md: {+ ...chakraSlotRecipes.select.variants?.size?.md,+ root: { ...chakraSlotRecipes.select.variants?.size?.md?.root, '--select-trigger-height': 'sizes.9' },+ },+ },variant: {...chakraSlotRecipes.select.variants?.variant,outline: {@@ -493,7 +536,7 @@ export const selectSlotRecipe = defineSlotRecipe({},},},- } as typeof chakraSlotRecipes.select.variants,+ } as unknown as typeof chakraSlotRecipes.select.variants,base: {...chakraSlotRecipes.select.base,trigger: {@@ -520,6 +563,21 @@ export const comboboxSlotRecipe = defineSlotRecipe({...chakraSlotRecipes.combobox,variants: {...chakraSlotRecipes.combobox.variants,+ size: {+ ...chakraSlotRecipes.combobox.variants?.size,+ xs: {+ ...chakraSlotRecipes.combobox.variants?.size?.xs,+ root: { ...chakraSlotRecipes.combobox.variants?.size?.xs?.root, '--combobox-input-height': 'sizes.7' },+ },+ sm: {+ ...chakraSlotRecipes.combobox.variants?.size?.sm,+ root: { ...chakraSlotRecipes.combobox.variants?.size?.sm?.root, '--combobox-input-height': 'sizes.8' },+ },+ md: {+ ...chakraSlotRecipes.combobox.variants?.size?.md,+ root: { ...chakraSlotRecipes.combobox.variants?.size?.md?.root, '--combobox-input-height': 'sizes.9' },+ },+ },variant: {...chakraSlotRecipes.combobox.variants?.variant,outline: {diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/AppMenu.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/AppMenu.tsxindex 8cacc6d83b..83d7faf5f9 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/AppMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/AppMenu.tsx@@ -57,7 +57,7 @@ export const AppMenu = () => {return (<Menu.Root positioning={MENU_POSITIONING}><Menu.Trigger asChild>- <IconButton aria-label={t('topbar.appMenu.open')} className="group" pe="1.5" size="xs" variant="ghost">+ <IconButton aria-label={t('topbar.appMenu.open')} className="group" pe="1.5" size="sm" variant="ghost"><AppMenuGlyph /></IconButton></Menu.Trigger>diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsxindex 58b2eeeff2..91ec7e189c 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/InvokeButton.tsx@@ -104,7 +104,7 @@ export const InvokeButton = ({ state }: { state: InvocationState }) => {cursor={canInvoke ? undefined : 'not-allowed'}flexShrink={0}opacity={canInvoke ? undefined : 0.55}- size="xs"+ size="sm"onBlur={handleBlur}onClick={canInvoke ? handleClick : undefined}onFocus={handleFocus}diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsxindex 8c887e1c77..95028d99d5 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/IterationsField.tsx@@ -7,10 +7,6 @@ import { useTranslation } from 'react-i18next';import { getBatchCount } from './useInvocationState';-// Chakra's xs input is one notch taller than the app's xs button; the attached-// Invoke capsule needs both on the shared 28px box.-const INPUT_HEIGHT_VARS = { '--input-height': 'sizes.7' };-/*** How many times the current graph runs per Invoke.*@@ -50,11 +46,10 @@ export const IterationsField = () => {<Tooltip content={t('topbar.iterations.tooltip', { count: batchCount })} showArrow><NumberInput.RootallowMouseWheel- css={INPUT_HEIGHT_VARS}flexShrink={0}min={MIN_BATCH_COUNT}rounded="control"- size="xs"+ size="sm"value={String(batchCount)}w="14"onValueChange={handleValueChange}diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/LayoutPresetStrip.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/LayoutPresetStrip.tsxindex e048fb0bb5..f2409d078b 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/LayoutPresetStrip.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/LayoutPresetStrip.tsx@@ -223,7 +223,7 @@ export const LayoutPresetStrip = () => {<Tooltip content={t('topbar.presets.saveAsTooltip')} showArrow><IconButtonaria-label={t('topbar.presets.saveAsTooltip')}- size="xs"+ size="sm"variant="ghost"onClick={openSaveAsDialog}>@@ -374,6 +374,7 @@ const PresetTab = ({style={dndStyle}touchAction="pan-x"value={preset.id}+ _selected={PRESET_TAB_SELECTED_PROPS}onClick={handleClick}onContextMenu={handleContextMenu}onFocus={handlePreload}@@ -408,6 +409,10 @@ const PresetTab = ({const MENU_AFFORDANCE_HOVER_PROPS = { bg: 'bg.emphasized', color: 'fg' } as const;+// The strip sits on topbar chrome the accent.subtle fill blends into; the+// SegmentTabs translucent shown-tab fill reads there (nav sidebars keep stock).+const PRESET_TAB_SELECTED_PROPS = { bg: 'gray.hoverTint/15', color: 'fg' } as const;+const DriftDot = () => <Box aria-hidden="true" bg="accent.solid" boxSize="1.5" flexShrink={0} rounded="full" />;const PresetMenu = ({diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/ProjectSwitcher.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/ProjectSwitcher.tsxindex 35701a915e..ca3a233f86 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/ProjectSwitcher.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/ProjectSwitcher.tsx@@ -167,7 +167,7 @@ export const ProjectSwitcher = () => {<Menu.Trigger asChild><Buttonaria-label={t('topbar.projectSwitcher.trigger', { name: activeProjectName })}- size="xs"+ size="sm"variant="ghost"><MiddleTruncate css={HIDE_BELOW_PROJECT_NAME_WIDTH} fontWeight="500" minW="0" text={activeProjectName} />diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsxindex ae1e770391..1151b94591 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsx@@ -108,7 +108,7 @@ export const QueueCluster = () => {fontVariantNumeric="tabular-nums"overflow="hidden"position="relative"- size="xs"+ size="sm"px={2}variant={tone === 'idle' ? 'outline' : 'subtle'}onClick={handleOpenQueue}@@ -136,7 +136,7 @@ export const QueueCluster = () => {<IconButtonaria-label={isCancelAllArmed && cancelAll ? cancelAll.label : cancelCurrent.label}color="fg.error"- size="xs"+ size="sm"variant="outline"onClick={handleCancelClick}onPointerEnter={handleCancelPointerEnter}@@ -155,7 +155,7 @@ export const QueueCluster = () => {<IconButtonaria-label={t('topbar.queue.actions')}color="fg.subtle"- size="xs"+ size="sm"minW="0"w="6"variant="outline"diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.browser.test.tsxindex 5c3e7069ed..27e09e0f1d 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.browser.test.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.browser.test.tsx@@ -77,7 +77,7 @@ const renderControl = async (state: InvocationState) => {root?.render(<ChakraProvider value={system}><Group attached>- <Button data-routing-height-reference="" size="xs">+ <Button data-routing-height-reference="" size="sm">Invoke</Button><RoutingControl state={state} />@@ -130,7 +130,7 @@ describe('RoutingControl', () => {const sourceBounds = sourceIcon!.getBoundingClientRect();const destinationBounds = destinationIcon!.getBoundingClientRect();expect(buttonBounds.width).toBe(36);- expect(buttonBounds.height).toBe(28);+ expect(buttonBounds.height).toBe(32);expect(buttonBounds.height).toBe(heightReference!.getBoundingClientRect().height);expect(destinationBounds.left - sourceBounds.left).toBeGreaterThanOrEqual(8);expect(destinationBounds.top - sourceBounds.top).toBeGreaterThanOrEqual(8);@@ -141,7 +141,7 @@ describe('RoutingControl', () => {root?.render(<ChakraProvider value={system}><Group attached>- <Button data-routing-height-reference="" size="xs">+ <Button data-routing-height-reference="" size="sm">Invoke</Button><RoutingControl state={LOCKED_STATE} />diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.tsxindex 9afa8ecc25..6148ed6726 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/RoutingControl.tsx@@ -44,10 +44,10 @@ export const RoutingControl = ({ state }: { state: InvocationState }) => {[`data-routing-${type}-icon`]: '',icon: getWidgetById(type === 'source' ? sourceTypeId : invocation.destination)?.manifest.icon,position: 'absolute',- top: type === 'source' ? '2px' : undefined,- left: type === 'source' ? '2px' : undefined,- bottom: type === 'destination' ? '2px' : undefined,- right: type === 'destination' ? '2px' : undefined,+ top: type === 'source' ? '4px' : undefined,+ left: type === 'source' ? '4px' : undefined,+ bottom: type === 'destination' ? '4px' : undefined,+ right: type === 'destination' ? '4px' : undefined,});return (@@ -63,7 +63,7 @@ export const RoutingControl = ({ state }: { state: InvocationState }) => {overflow="visible"p="0"position="relative"- size="xs"+ size="sm"variant="outline"w="34px"display="grid"@@ -87,10 +87,10 @@ export const RoutingControl = ({ state }: { state: InvocationState }) => {borderWidth="1px"boxSize="3.5"data-routing-source-icon=""- left="2px"+ left="4px"position="absolute"rounded="xs"- top="2px"+ top="4px"/>)}<WidgetIcon {...getWidgetIconProps('destination')} />diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsxindex 707ef3906c..b4332d2aea 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/SamOptions.tsx@@ -302,7 +302,6 @@ export const SamPromptBody = ({autoComplete="off"disabled={disabled}flexShrink={0}- h="8"placeholder={t('widgets.layers.selectObject.promptGuidance')}size="xs"value={prompt}diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/FormControls.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/FormControls.tsxindex 5a3f4b9ff4..e40008e1ef 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/FormControls.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-presentation/FormControls.tsx@@ -29,8 +29,8 @@ interface FormNumberFieldProps {}const AFFIX_PROPS = { color: 'fg.muted', fontSize: '2xs', lineHeight: '1' } as const;-// InputGroup pads the input by `--input-height` (32px at size xs) minus the offset; the text must clear the affix.-const INPUT_HEIGHT_PX = 32;+// InputGroup pads the input by `--input-height` (28px at size xs) minus the offset; the text must clear the affix.+const INPUT_HEIGHT_PX = 28;const AFFIX_CHAR_PX = 6;const AFFIX_GUTTER_PX = 8;const affixOffset = (chars: number): string => `${INPUT_HEIGHT_PX - AFFIX_GUTTER_PX - chars * AFFIX_CHAR_PX}px`;