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): polish workbench queue and preview UI

joshistoast7d27fb1e383a
diff --git a/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx b/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx
index e72254af87..7e210d6acc 100644
--- a/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/InvokeControl.tsx
@@ -1,4 +1,4 @@
-import { Box, HStack, Icon, Menu, Portal, Text, VStack } from '@chakra-ui/react';
+import { Flex, Group, HStack, Icon, Menu, Portal, Text, VStack } from '@chakra-ui/react';
import { useEffect, useRef } from 'react';
import { PiCaretDownBold, PiCheckBold, PiLockSimpleFill, PiSparkleFill } from 'react-icons/pi';
@@ -11,6 +11,7 @@ import {
resultDestinations,
} from '../invocation';
import type { InvocationSourceId, ResultDestination } from '../types';
+import { Button, IconButton } from './ui/Button';
/**
* Fixed-width global Invoke control.
@@ -22,7 +23,7 @@ import type { InvocationSourceId, ResultDestination } from '../types';
* Controller menu (source / destination / lock), which is wired to project-owned
* state even though full invocation lands in Phase 4.
*/
-const CONTROL_WIDTH = '13.5rem';
+const CONTROL_WIDTH = '12rem';
export const InvokeControl = () => {
const { activeProject, dispatch } = useWorkbench();
@@ -64,68 +65,42 @@ export const InvokeControl = () => {
};
}, [dispatch]);
- return (
- <HStack flexShrink={0} gap="0" h="9" overflow="hidden" rounded="sm" shadow="sm" w={CONTROL_WIDTH}>
- <HStack
- aria-disabled={!isValid}
- aria-label={invokeLabel}
- as="button"
- bg={isValid ? 'accent.invoke' : 'bg.surface'}
- color={isValid ? 'accent.invokeFg' : 'fg.muted'}
- flex="1"
- gap="2"
- h="full"
- minW="0"
- px="3"
- transition="filter 0.12s ease"
- title={resolvedRoute.validationMessage}
- onClick={() => {
- if (!isValid) {
- return;
- }
-
- dispatch({
- backendSupportsCancellation: true,
- route: resolvedRoute,
- type: 'submitResolvedInvocationSnapshot',
- });
- }}
- _hover={isValid ? { filter: 'brightness(1.05)' } : undefined}
- _active={{ filter: 'brightness(0.96)' }}
- >
- <Icon as={PiSparkleFill} boxSize="4" flexShrink={0} />
- <VStack align="start" gap="0" minW="0">
- <Text fontSize="sm" fontWeight="700" lineHeight="1">
- Invoke
- </Text>
- <HStack gap="1" maxW="full">
- <Text fontSize="2xs" fontWeight="600" lineHeight="1.1" opacity="0.85" truncate>
- {routeLabel}
- </Text>
- {isLocked ? <Icon as={PiLockSimpleFill} boxSize="2.5" flexShrink={0} /> : null}
- </HStack>
- </VStack>
- </HStack>
+ const onInvoke = () => {
+ if (!isValid) {
+ return;
+ }
+
+ dispatch({
+ backendSupportsCancellation: true,
+ route: resolvedRouteRef.current,
+ type: 'submitResolvedInvocationSnapshot',
+ });
+ };
+ return (
+ <Flex>
<Menu.Root positioning={{ placement: 'bottom-start' }}>
- <Menu.Trigger asChild>
- <Box
- aria-label="Open invocation controller"
- as="button"
- bg="accent.invoke"
- borderLeftWidth="1px"
- borderColor="blackAlpha.300"
- color="accent.invokeFg"
- display="grid"
- h="full"
- placeItems="center"
- px="2"
- transition="filter 0.12s ease"
- _hover={{ filter: 'brightness(1.05)' }}
- >
- <Icon as={PiCaretDownBold} boxSize="3" />
- </Box>
- </Menu.Trigger>
+ <Group attached>
+ <Button size="sm" onClick={onInvoke} w={CONTROL_WIDTH} minW="0" justifyContent="start">
+ <Icon as={PiSparkleFill} boxSize="4" flexShrink={0} />
+ <VStack align="start" gap="0" minW="0">
+ <Text fontSize="sm" fontWeight="700" lineHeight="1">
+ Invoke
+ </Text>
+ <HStack gap="1" maxW="full">
+ <Text fontSize="2xs" fontWeight="600" lineHeight="1.1" opacity="0.85" truncate>
+ {routeLabel}
+ </Text>
+ {isLocked ? <Icon as={PiLockSimpleFill} boxSize="2.5" flexShrink={0} /> : null}
+ </HStack>
+ </VStack>
+ </Button>
+ <Menu.Trigger asChild>
+ <IconButton size="sm" minW="0" w="7">
+ <PiCaretDownBold />
+ </IconButton>
+ </Menu.Trigger>
+ </Group>
<Portal>
<Menu.Positioner>
<Menu.Content
@@ -211,6 +186,46 @@ export const InvokeControl = () => {
</Menu.Positioner>
</Portal>
</Menu.Root>
- </HStack>
+ </Flex>
+ // <HStack
+ // aria-disabled={!isValid}
+ // aria-label={invokeLabel}
+ // as="button"
+ // bg={isValid ? 'accent.invoke' : 'bg.surface'}
+ // color={isValid ? 'accent.invokeFg' : 'fg.muted'}
+ // flex="1"
+ // gap="2"
+ // h="full"
+ // minW="0"
+ // px="3"
+ // transition="filter 0.12s ease"
+ // title={resolvedRoute.validationMessage}
+ // onClick={() => {
+ // if (!isValid) {
+ // return;
+ // }
+
+ // dispatch({
+ // backendSupportsCancellation: true,
+ // route: resolvedRoute,
+ // type: 'submitResolvedInvocationSnapshot',
+ // });
+ // }}
+ // _hover={isValid ? { filter: 'brightness(1.05)' } : undefined}
+ // _active={{ filter: 'brightness(0.96)' }}
+ // >
+ // <Icon as={PiSparkleFill} boxSize="4" flexShrink={0} />
+ // <VStack align="start" gap="0" minW="0">
+ // <Text fontSize="sm" fontWeight="700" lineHeight="1">
+ // Invoke
+ // </Text>
+ // <HStack gap="1" maxW="full">
+ // <Text fontSize="2xs" fontWeight="600" lineHeight="1.1" opacity="0.85" truncate>
+ // {routeLabel}
+ // </Text>
+ // {isLocked ? <Icon as={PiLockSimpleFill} boxSize="2.5" flexShrink={0} /> : null}
+ // </HStack>
+ // </VStack>
+ // </HStack>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx b/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx
index 687b39e99a..0874c4e5f1 100644
--- a/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/TopBar.tsx
@@ -1,5 +1,13 @@
-import { Badge, Box, Flex, HStack, Icon, NumberInput, Text } from '@chakra-ui/react';
-import { PiCaretDownBold, PiCubeBold, PiListNumbersBold, PiUserCircleBold, PiXBold } from 'react-icons/pi';
+import { Badge, Box, Flex, Group, HStack, Icon, Menu, NumberInput, Portal, Text } from '@chakra-ui/react';
+import {
+ PiCaretDownBold,
+ PiCubeBold,
+ PiListNumbersBold,
+ PiPause,
+ PiPlay,
+ PiUserCircleBold,
+ PiXBold,
+} from 'react-icons/pi';
import { InvokeControl } from './InvokeControl';
import { LayoutPresetMenu } from './LayoutPresetMenu';
@@ -7,6 +15,8 @@ import { ProjectTabs } from './ProjectTabs';
import { SettingsButton } from './SettingsDialog';
import { IconButton } from './ui/Button';
import { useWorkbench } from '../WorkbenchContext';
+import { DEFAULT_THEME_ID, THEMES_BY_ID } from '../../theme/themes';
+import { Tooltip } from './ui/Tooltip';
/** Workbench top bar: brand, global Invoke command cluster, project tabs, layout + account controls. */
export const TopBar = () => (
@@ -19,7 +29,7 @@ export const TopBar = () => (
flexShrink={0}
gap="2"
h="12"
- px="3"
+ pe="3"
w="full"
>
<BrandMark />
@@ -50,23 +60,33 @@ export const TopBar = () => (
</Flex>
);
-/** Brand mark placeholder for the future workbench logo / app menu. */
-const BrandMark = () => (
- <Flex
- align="center"
- aria-label="Invoke"
- as="button"
- color="accent.invoke"
- flexShrink={0}
- h="7"
- justify="center"
- rounded="md"
- w="7"
- _hover={{ bg: 'bg.surface' }}
- >
- <Icon as={PiListNumbersBold} boxSize="5" transform="rotate(90deg)" />
- </Flex>
-);
+/** Compact legacy Invoke logo used as the workbench app-menu affordance. */
+const BrandMark = () => {
+ const { state } = useWorkbench();
+ const theme = THEMES_BY_ID[state.account.preferences.themeId] ?? THEMES_BY_ID[DEFAULT_THEME_ID];
+
+ return (
+ <Flex
+ align="center"
+ aria-label="Invoke"
+ as="button"
+ flexShrink={0}
+ h="full"
+ justify="center"
+ rounded="md"
+ aspectRatio="1/1"
+ me="-1"
+ >
+ <svg aria-hidden="true" fill="none" height="20" viewBox="0 0 44 44" width="20">
+ <path
+ d="M29.1951 10.6667H42V2H2V10.6667H14.8049L29.1951 33.3333H42V42H2V33.3333H14.8049"
+ stroke={theme.colors.accent}
+ strokeWidth="2.8"
+ />
+ </svg>
+ </Flex>
+ );
+};
const getBatchCount = (values: Record<string, unknown>): number => {
const batchCount = values.batchCount;
@@ -84,7 +104,7 @@ const BatchCountField = () => {
flexShrink={0}
max={64}
min={1}
- size="xs"
+ size="sm"
value={String(batchCount)}
w="14"
onValueChange={({ valueAsNumber }) => {
@@ -94,7 +114,7 @@ const BatchCountField = () => {
}}
>
<NumberInput.Control />
- <NumberInput.Input aria-label="Batch count" />
+ <NumberInput.Input paddingStart="4" aria-label="Batch count" />
</NumberInput.Root>
);
};
@@ -112,34 +132,100 @@ const QueueCluster = () => {
).length;
const totalCount = activeProject.queue.items.length;
+ const queueEndActions = [
+ {
+ label: 'Cancel Current Item',
+ icon: PiXBold,
+ onClick: () => void 0,
+ },
+ {
+ label: 'Cancel All Items',
+ icon: PiXBold,
+ onClick: () => void 0,
+ },
+ {
+ label: 'Cancel all except current item',
+ icon: PiXBold,
+ onClick: () => void 0,
+ },
+ ];
+
+ const queueProcessorActions = [
+ {
+ label: 'Resume Processor',
+ icon: PiPlay,
+ onClick: () => void 0,
+ },
+ {
+ label: 'Pause Processor',
+ icon: PiPause,
+ onClick: () => void 0,
+ },
+ {
+ label: 'Open Queue',
+ icon: PiListNumbersBold,
+ onClick: () => void 0,
+ },
+ ];
+
return (
<HStack flexShrink={0} gap="1">
- <Badge bg="accent.active" color="accent.activeFg" fontSize="2xs" fontWeight="700" gap="1" h="7" px="2">
- <Icon as={PiListNumbersBold} boxSize="3" />
+ <Badge variant="outline" h="9" borderColor="border.subtle" fontSize="xs" fontWeight="700" gap="1" px="2">
+ {/*<Icon as={PiListNumbersBold} boxSize="3" />*/}
+ <PiListNumbersBold />
{activeCount}/{totalCount}
</Badge>
- <IconButton
- aria-label="Cancel current batch"
- borderWidth="1px"
- borderColor="border.emphasis"
- color="fg.muted"
- size="xs"
- variant="ghost"
- _hover={{ color: 'fg.default' }}
- >
- <PiXBold />
- </IconButton>
- <IconButton
- aria-label="Queue options"
- borderWidth="1px"
- borderColor="border.emphasis"
- color="fg.muted"
- size="xs"
- variant="ghost"
- _hover={{ color: 'fg.default' }}
- >
- <PiCaretDownBold />
- </IconButton>
+ <Menu.Root>
+ <Group attached>
+ <Tooltip content="Cancel current item" showArrow>
+ <IconButton variant="outline" size="sm" roundedEnd="none">
+ <PiXBold />
+ </IconButton>
+ </Tooltip>
+ <Menu.Trigger>
+ <IconButton
+ variant="outline"
+ size="sm"
+ roundedStart="none"
+ borderStartWidth="0"
+ aspectRatio="unset"
+ minW="0"
+ w="6"
+ >
+ <PiCaretDownBold />
+ </IconButton>
+ </Menu.Trigger>
+ </Group>
+ <Portal>
+ <Menu.Positioner>
+ <Menu.Content>
+ <Menu.ItemGroup>
+ {queueEndActions.map((action, index) => (
+ <Menu.Item
+ key={index}
+ onClick={action.onClick}
+ value={action.label}
+ color="fg.error"
+ _hover={{ bg: 'bg.error', color: 'fg.error' }}
+ >
+ <Icon as={action.icon} boxSize="3" />
+ <span>{action.label}</span>
+ </Menu.Item>
+ ))}
+ </Menu.ItemGroup>
+ <Menu.Separator />
+ <Menu.ItemGroup>
+ {queueProcessorActions.map((action, index) => (
+ <Menu.Item key={index} onClick={action.onClick} value={action.label}>
+ <Icon as={action.icon} boxSize="3" />
+ <span>{action.label}</span>
+ </Menu.Item>
+ ))}
+ </Menu.ItemGroup>
+ </Menu.Content>
+ </Menu.Positioner>
+ </Portal>
+ </Menu.Root>
</HStack>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsx b/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsx
index 92c41793d9..113eb79571 100644
--- a/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/WidgetFrames.tsx
@@ -182,8 +182,27 @@ export const FieldPlaceholder = ({ label, h }: { label: string; h: string }) =>
</Stack>
);
-export const StatusWidgetChip = ({ icon, children }: { icon: IconType; children: ReactNode }) => (
- <HStack borderWidth="1px" borderColor="border.emphasis" gap="1.5" py="0.5" px="2" rounded="sm" flexShrink={0}>
+export const StatusWidgetChip = ({
+ borderColor = 'border.emphasis',
+ children,
+ color,
+ icon,
+}: {
+ borderColor?: string;
+ children: ReactNode;
+ color?: string;
+ icon: IconType;
+}) => (
+ <HStack
+ borderWidth="1px"
+ borderColor={borderColor}
+ color={color}
+ gap="1.5"
+ py="0.5"
+ px="2"
+ rounded="sm"
+ flexShrink={0}
+ >
<Icon as={icon} boxSize="3" />
<Text fontSize="2xs" fontWeight="500" whiteSpace="nowrap">
{children}
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryImageGrid.tsx b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryImageGrid.tsx
index a22900e57b..feb190580f 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryImageGrid.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryImageGrid.tsx
@@ -10,7 +10,7 @@ import type { GalleryThumbnailFit } from '../../gallery/settings';
import type { GalleryQueuePlaceholder } from './galleryStateView';
import { useGalleryWidget } from './GalleryWidgetContext';
-const GRID_GAP_PX = 8;
+const GRID_GAP_PX = 4;
const viewportWidthCache = new Map<'stacked' | 'wide', number>();
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryToolbar.tsx b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryToolbar.tsx
index bb018b5399..7ba5e994dc 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryToolbar.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/gallery/GalleryToolbar.tsx
@@ -1,8 +1,8 @@
-import { Box, HStack, Input, Menu, Portal, Slider, Spacer, Stack, Switch, Text } from '@chakra-ui/react';
+import { Box, HStack, Input, InputGroup, Menu, Portal, Slider, Spacer, Stack, Switch, Text } from '@chakra-ui/react';
import { useRef } from 'react';
-import { PiGearSixBold, PiUploadSimpleBold } from 'react-icons/pi';
+import { PiGearSixBold, PiMagnifyingGlassBold, PiUploadSimpleBold } from 'react-icons/pi';
-import { Button, IconButton } from '../../components/ui/Button';
+import { Button, CloseButton, IconButton } from '../../components/ui/Button';
import { isDateBoardId } from '../../gallery/api';
import { GalleryBoardSelect } from './GalleryBoardSelect';
import { useGalleryWidget } from './GalleryWidgetContext';
@@ -39,6 +39,9 @@ export const GalleryToolbar = ({ layout }: { layout: 'stacked' | 'wide' }) => {
<GallerySettingsMenu />
</HStack>
);
+ const searchClearButton = gallery.searchTerm ? (
+ <CloseButton size="2xs" aria-label="Clear search" onClick={() => actions.setSearchTerm('')} me="-2" />
+ ) : null;
return (
<Stack gap="2">
@@ -60,13 +63,15 @@ export const GalleryToolbar = ({ layout }: { layout: 'stacked' | 'wide' }) => {
</HStack>
</>
)}
- <Input
- aria-label="Search gallery images"
- placeholder="Search images"
- size="sm"
- value={gallery.searchTerm}
- onChange={(event) => actions.setSearchTerm(event.currentTarget.value)}
- />
+ <InputGroup startElement={<PiMagnifyingGlassBold />} endElement={searchClearButton}>
+ <Input
+ aria-label="Search gallery images"
+ placeholder="Search images"
+ size="xs"
+ value={gallery.searchTerm}
+ onChange={(event) => actions.setSearchTerm(event.currentTarget.value)}
+ />
+ </InputGroup>
</Stack>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewCompare.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewCompare.tsx
index da71517c0a..828c7a3291 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewCompare.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewCompare.tsx
@@ -18,6 +18,13 @@ const COMPARE_IMAGE_STYLE: CSSProperties = {
width: '100%',
};
+const previewGridCss = {
+ backgroundImage: 'radial-gradient(circle, currentColor 1px, transparent 1.5px)',
+ backgroundPosition: 'center',
+ backgroundRepeat: 'repeat',
+ backgroundSize: '14px 14px',
+} as const;
+
/**
* Two-image comparison: a draggable slider that reveals the compare image over
* the selected one, or a side-by-side split.
@@ -50,18 +57,29 @@ export const PreviewCompare = ({
return (
<Stack gap="3" h="full" minH="0" w="full">
- <Flex align="center" flex="1" justify="center" minH="0" w="full">
+ <Flex
+ align="center"
+ backgroundColor="bg.canvas"
+ borderWidth="1px"
+ borderColor="border.subtle"
+ color="canvas.dot"
+ css={previewGridCss}
+ flex="1"
+ justify="center"
+ minH="0"
+ overflow="hidden"
+ p="6"
+ rounded="lg"
+ w="full"
+ >
{mode === 'slider' ? (
<Box
ref={containerRef}
- bg="bg.panel"
- borderWidth="1px"
- borderColor="border.emphasis"
+ bg="transparent"
cursor="ew-resize"
h="full"
overflow="hidden"
position="relative"
- rounded="lg"
style={{ touchAction: 'none' }}
w="full"
onPointerDown={(event) => {
@@ -96,7 +114,7 @@ export const PreviewCompare = ({
>
<img alt={baseImage.imageName} draggable={false} src={baseImage.imageUrl} style={COMPARE_IMAGE_STYLE} />
<Box
- bg="bg.panel"
+ bg="transparent"
inset="0"
pointerEvents="none"
position="absolute"
@@ -152,17 +170,7 @@ export const PreviewCompare = ({
};
const CompareSidePane = ({ image, label }: { image: GeneratedImageContract; label: string }) => (
- <Box
- bg="bg.panel"
- borderWidth="1px"
- borderColor="border.emphasis"
- flex="1"
- h="full"
- minW="0"
- overflow="hidden"
- position="relative"
- rounded="lg"
- >
+ <Box bg="transparent" flex="1" h="full" minW="0" overflow="hidden" position="relative">
<img alt={image.imageName} draggable={false} src={image.imageUrl} style={COMPARE_IMAGE_STYLE} />
<Badge left="2" pointerEvents="none" position="absolute" size="xs" top="2" variant="solid">
{label}
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
index 7bc8eff07e..8f0086ed34 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
@@ -85,6 +85,13 @@ const getBoardName = (boards: GalleryBoard[], boardId: string): string =>
const shouldLoadBackendBoard = (image: PreviewImage): boolean => image.sourceQueueItemId === 'backend-gallery';
+const previewGridCss = {
+ backgroundImage: 'radial-gradient(circle, currentColor 1px, transparent 1.5px)',
+ backgroundPosition: 'center',
+ backgroundRepeat: 'repeat',
+ backgroundSize: '14px 14px',
+} as const;
+
export const PreviewWidgetView = ({ region }: WidgetViewProps) => {
const { activeProject, dispatch } = useWorkbench();
const galleryValues = activeProject.widgetStates.gallery.values;
@@ -323,10 +330,24 @@ const SelectedImagePreview = ({
}
}}
>
- <Flex align="center" flex="1" justify="center" minH="0" w="full">
+ <Flex
+ align="center"
+ backgroundColor="bg.canvas"
+ borderWidth="1px"
+ borderColor="border.subtle"
+ color="canvas.dot"
+ css={previewGridCss}
+ flex="1"
+ justify="center"
+ minH="0"
+ overflow="hidden"
+ p={isCompact ? '3' : '6'}
+ rounded="lg"
+ w="full"
+ >
<Box
aspectRatio={getImageAspectRatio(image)}
- bg="bg.panel"
+ bg="transparent"
borderWidth="1px"
borderColor="border.emphasis"
boxShadow="0 24px 80px rgba(0,0,0,0.42)"
@@ -407,8 +428,16 @@ const SelectedImagePreview = ({
);
const EmptyPreview = () => (
- <Flex align="center" h="full" justify="center" w="full">
- <Stack align="center" gap="2" maxW="18rem" textAlign="center">
+ <Flex
+ align="center"
+ backgroundColor="bg.canvas"
+ color="canvas.dot"
+ css={previewGridCss}
+ h="full"
+ justify="center"
+ w="full"
+ >
+ <Stack align="center" color="fg.default" gap="2" maxW="18rem" textAlign="center">
<Text fontSize="sm" fontWeight="800">
No gallery selection
</Text>
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx
index 91b605af96..45a1f1f9c7 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/queue/QueueWidgetView.tsx
@@ -1,6 +1,7 @@
-import { Badge, Stack, Text, HStack } from '@chakra-ui/react';
+import { Badge, Progress, Stack, Text, HStack } from '@chakra-ui/react';
import { PiListNumbersBold } from 'react-icons/pi';
+import { useQueueItemProgress } from '../../backend/progressStore';
import { StatusWidgetChip } from '../../components/WidgetFrames';
import { Button } from '../../components/ui/Button';
import type { WidgetViewProps } from '../../types';
@@ -24,6 +25,34 @@ export const QueueWidgetView = ({ presentation, region }: WidgetViewProps) => {
return <QueueContents />;
};
+const QueueItemLiveProgress = ({ queueItemId }: { queueItemId: string }) => {
+ const progress = useQueueItemProgress(queueItemId);
+
+ if (!progress) {
+ return null;
+ }
+
+ return (
+ <Stack gap="1">
+ <Progress.Root
+ aria-label={progress.message || 'Generation progress'}
+ max={1}
+ size="xs"
+ value={progress.percentage}
+ >
+ <Progress.Track>
+ <Progress.Range />
+ </Progress.Track>
+ </Progress.Root>
+ {progress.message ? (
+ <Text color="fg.subtle" fontSize="2xs">
+ {progress.message}
+ </Text>
+ ) : null}
+ </Stack>
+ );
+};
+
const QueueContents = () => {
const { dispatch, state } = useWorkbench();
const queueRows = state.projects.flatMap((project) =>
@@ -70,6 +99,7 @@ const QueueContents = () => {
<Text color="fg.subtle" fontSize="2xs">
{promptSummary}
</Text>
+ {item.status === 'running' ? <QueueItemLiveProgress queueItemId={item.id} /> : null}
<HStack justify="space-between">
<Text color={item.status === 'failed' ? 'red.300' : 'fg.subtle'} fontSize="2xs">
{item.id}
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/server-status/ServerStatusWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/server-status/ServerStatusWidgetView.tsx
index 1a703862c3..5d03432dd8 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/server-status/ServerStatusWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/server-status/ServerStatusWidgetView.tsx
@@ -1,10 +1,21 @@
import { Stack, Text } from '@chakra-ui/react';
-import { PiPlugsConnectedBold } from 'react-icons/pi';
+import { PiPlugsConnectedBold, PiXCircleBold } from 'react-icons/pi';
import { StatusWidgetChip } from '../../components/WidgetFrames';
import type { WidgetViewProps } from '../../types';
+import { useWorkbench } from '../../WorkbenchContext';
export const ServerStatusWidgetView = ({ presentation }: WidgetViewProps) => {
+ const { state } = useWorkbench();
+ const { backendConnection } = state;
+ const isConnected = backendConnection.status === 'connected';
+ const isDisconnected = backendConnection.status === 'disconnected';
+ const label = isConnected
+ ? 'Connected to Server'
+ : isDisconnected
+ ? 'Disconnected from Server'
+ : 'Connecting to Server';
+
if (presentation === 'tooltip') {
return (
<Stack gap="2">
@@ -12,11 +23,20 @@ export const ServerStatusWidgetView = ({ presentation }: WidgetViewProps) => {
Server Status
</Text>
<Text color="fg.subtle" fontSize="2xs">
- Connected to Server. Detailed socket and API health will render here once backend status data is connected.
+ {label}
+ {backendConnection.error ? `: ${backendConnection.error}` : ''}
</Text>
</Stack>
);
}
- return <StatusWidgetChip icon={PiPlugsConnectedBold}>Connected to Server</StatusWidgetChip>;
+ if (isDisconnected) {
+ return (
+ <StatusWidgetChip borderColor="fg.error" color="fg.error" icon={PiXCircleBold}>
+ {label}
+ </StatusWidgetChip>
+ );
+ }
+
+ return <StatusWidgetChip icon={PiPlugsConnectedBold}>{label}</StatusWidgetChip>;
};