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(ui): tighten concept rows with a snug list density
Josh Corbettb3e33e3c1dbb
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/shared/ConceptRow.tsx b/invokeai/frontend/webv2/src/features/generation/ui/shared/ConceptRow.tsxindex a12e6cd78f..542cb7d05f 100644--- a/invokeai/frontend/webv2/src/features/generation/ui/shared/ConceptRow.tsx+++ b/invokeai/frontend/webv2/src/features/generation/ui/shared/ConceptRow.tsx@@ -3,7 +3,7 @@ import type { GenerateLora } from '@features/generation/core/types';import type { ListContextMenuAnchor } from '@platform/ui/list/ListItem';import type { MouseEvent, ReactNode } from 'react';-import { Avatar, Badge, Box, Icon, Menu, Portal } from '@chakra-ui/react';+import { Avatar, Badge, Box, Flex, Icon, Menu, Portal } from '@chakra-ui/react';import { DEFAULT_LORA_WEIGHT_CONFIG, getDefaultLoraWeight } from '@features/generation/core/settings';import { IconButton } from '@platform/ui/Button';import { ListItem } from '@platform/ui/list/ListItem';@@ -157,7 +157,7 @@ export const ConceptRow = memo(function ConceptRow({<Box aria-label={name} opacity={isCompatible ? 1 : 0.68} role="group"><ListItemactions={- <>+ <Flex gap={1}><GenerateToggleSwitchchecked={isActive}disabled={!isCompatible}@@ -179,7 +179,7 @@ export const ConceptRow = memo(function ConceptRow({<Trash2Icon /></IconButton></Tooltip>- </>+ </Flex>}badges={<>@@ -219,7 +219,7 @@ export const ConceptRow = memo(function ConceptRow({</GenerateFieldContextMenu></Box>}- density="comfortable"+ density="snug"leading={<Avatar.Rootbg="bg.muted"diff --git a/invokeai/frontend/webv2/src/platform/ui/list/List.tsx b/invokeai/frontend/webv2/src/platform/ui/list/List.tsxindex e4092eae1a..411e549772 100644--- a/invokeai/frontend/webv2/src/platform/ui/list/List.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/list/List.tsx@@ -14,7 +14,7 @@ import { IN_SLOT_DIVIDER_HIDING_CSS, ListDivider } from './ListDivider';import { LIST_ROW_GAP_PX as ROW_GAP_PX, LIST_ROW_INSET as INSET } from './listLayout';import { LIST_SECTION_HEADER_HEIGHT_PX, ListSectionHeader } from './ListSectionHeader';-const ITEM_HEIGHT_PX: Record<ListDensity, number> = { comfortable: 52, compact: 28, regular: 40 };+const ITEM_HEIGHT_PX: Record<ListDensity, number> = { comfortable: 52, compact: 28, regular: 40, snug: 48 };const OVERSCAN_ROWS = 8;const PRIMARY_SELECTOR = '[data-list-primary]';diff --git a/invokeai/frontend/webv2/src/platform/ui/list/ListItem.tsx b/invokeai/frontend/webv2/src/platform/ui/list/ListItem.tsxindex 2bd9545baa..6fff19217c 100644--- a/invokeai/frontend/webv2/src/platform/ui/list/ListItem.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/list/ListItem.tsx@@ -6,7 +6,7 @@ import { listItemSlotRecipe } from '@theme/recipes';import { useCallback, useMemo } from 'react';import { useTranslation } from 'react-i18next';-export type ListDensity = 'compact' | 'regular' | 'comfortable';+export type ListDensity = 'compact' | 'regular' | 'comfortable' | 'snug';export interface ListContextMenuAnchor {x: number;@@ -24,7 +24,7 @@ export interface ListItemProps {title: string;/** Identifiers keep their tail visible; prose keeps its start. */titleTruncate?: 'middle' | 'end';- /** Media or icon before the text; size it for the density (36px at comfortable). */+ /** Media or icon before the text; size it for the density (36px at comfortable and snug). */leading?: ReactNode;/** Inline after the title, e.g. a status badge; keep it short so the title keeps its room. */badges?: ReactNode;diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.tsindex b0d230b4e0..43866f910a 100644--- a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts+++ b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts@@ -1059,6 +1059,12 @@ export const listItemSlotRecipe = defineSlotRecipe({root: { minH: '13' },primary: { gap: '2.5', px: '2', py: '1.5' },},+ // Comfortable's media one step tighter, for rows whose detail line already adds height.+ snug: {+ root: { minH: '12' },+ primary: { gap: '2.5', px: '1.5', py: '1.5' },+ detail: { pb: '1.5', px: '1.5' },+ },},},defaultVariants: { active: 'none', density: 'regular' },