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.

refactor(webv2): drop redundant progress indicators

joshistoastcf62166bab28
diff --git a/invokeai/frontend/webv2/src/workbench/components/QueueProgressIndicator.tsx b/invokeai/frontend/webv2/src/workbench/components/QueueProgressIndicator.tsx
index f6366875db..9ad117e003 100644
--- a/invokeai/frontend/webv2/src/workbench/components/QueueProgressIndicator.tsx
+++ b/invokeai/frontend/webv2/src/workbench/components/QueueProgressIndicator.tsx
@@ -1,7 +1,7 @@
import type { QueueProgressBarState } from '@features/queue/contracts';
import type { ComponentProps } from 'react';
-import { Progress, ProgressCircle } from '@chakra-ui/react';
+import { ProgressCircle } from '@chakra-ui/react';
const getProgressValuePercent = (state: QueueProgressBarState): number | null =>
state.kind === 'determinate' ? state.value * 100 : state.value;
@@ -37,29 +37,3 @@ export const QueueCircularProgress = ({
</ProgressCircle.Root>
);
};
-
-export const QueueTabBackgroundProgress = ({
- state,
- ...props
-}: Omit<ComponentProps<typeof Progress.Root>, 'value'> & { state: QueueProgressBarState }) => {
- if (state.kind === 'idle') {
- return null;
- }
-
- return (
- <Progress.Root
- aria-label="Widget queue progress"
- h="full"
- inset="0"
- max={1}
- pointerEvents="none"
- position="absolute"
- value={state.value}
- {...props}
- >
- <Progress.Track bg="transparent" h="full" boxShadow="none">
- <Progress.Range bg="accent.subtle" />
- </Progress.Track>
- </Progress.Root>
- );
-};
diff --git a/invokeai/frontend/webv2/src/workbench/shell/CenterArea.tsx b/invokeai/frontend/webv2/src/workbench/shell/CenterArea.tsx
index e29ac16813..4445b367db 100644
--- a/invokeai/frontend/webv2/src/workbench/shell/CenterArea.tsx
+++ b/invokeai/frontend/webv2/src/workbench/shell/CenterArea.tsx
@@ -5,11 +5,7 @@ import type {
} from '@workbench/widgetRegionViewModel';
import { Box, Flex, HStack, Icon, Menu, Portal, Text } from '@chakra-ui/react';
-import { useModelLoads } from '@features/models';
-import { getProjectQueueIndicatorState, type QueueProgressBarState } from '@features/queue/contracts';
-import { useQueueItemProgress } from '@features/queue/react';
import { IconButton, MenuContent } from '@platform/ui';
-import { QueueTabBackgroundProgress } from '@workbench/components/QueueProgressIndicator';
import { useFocusRegionProps } from '@workbench/focusRegions';
import { WidgetIcon } from '@workbench/iconResolver';
import {
@@ -28,7 +24,7 @@ import {
isRequiredCenterView,
} from '@workbench/widgetRegionViewModel';
import { getWidgetById, getWidgetsForRegion } from '@workbench/widgetRegistry';
-import { useActiveProjectSelector, useWorkbenchCommands, useWorkbenchSelector } from '@workbench/WorkbenchContext';
+import { useActiveProjectSelector, useWorkbenchCommands } from '@workbench/WorkbenchContext';
import { CheckIcon, ChevronDownIcon, XIcon } from 'lucide-react';
import { Suspense, useCallback, useMemo, useRef, type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
@@ -44,10 +40,6 @@ export const CenterArea = () => {
const { t } = useTranslation();
const placementProject = useActiveProjectSelector(getWidgetPlacementProject, areWidgetPlacementProjectsEqual);
const centerRegion = useActiveProjectSelector((project) => project.widgetRegions.center);
- const invocation = useActiveProjectSelector((project) => project.invocation);
- const queueItems = useActiveProjectSelector((project) => project.queue.items);
- const backendConnectionStatus = useWorkbenchSelector((snapshot) => snapshot.backendConnection.status);
- const modelLoads = useModelLoads();
const { widgets } = useWorkbenchCommands();
const getWidgetLabel = useCallback(
(manifest: Parameters<typeof resolveWidgetLabel>[0]) => resolveWidgetLabel(manifest, t),
@@ -131,23 +123,6 @@ export const CenterArea = () => {
[centerWidgetMenuItems]
);
- const baseIndicatorState = getProjectQueueIndicatorState({
- isConnected: backendConnectionStatus === 'connected',
- loadingModelsCount: modelLoads.length,
- progress: null,
- queueItems,
- });
-
- const progress = useQueueItemProgress(baseIndicatorState.runningQueueItemId ?? '');
-
- const indicatorState = getProjectQueueIndicatorState({
- isConnected: backendConnectionStatus === 'connected',
- loadingModelsCount: modelLoads.length,
- progress,
- queueItems,
- });
- const showProgress = indicatorState.hasOpenQueueWork && activeItem?.typeId === invocation.sourceId;
-
return (
<Flex
as="section"
@@ -182,8 +157,6 @@ export const CenterArea = () => {
availableItems={availableCenterItems}
isCloseDisabled={isActiveViewRequired}
items={centerViewItems}
- progressState={indicatorState.progressState}
- showProgress={showProgress}
onClose={closeActiveCenterView}
onOpen={openCenterWidget}
onSelect={selectCenterView}
@@ -247,8 +220,6 @@ const CenterViewMenu = ({
onClose,
onOpen,
onSelect,
- progressState,
- showProgress,
}: {
activeItem?: CenterWidgetItem;
availableItems: WidgetEnableMenuItem[];
@@ -257,8 +228,6 @@ const CenterViewMenu = ({
onClose: () => void;
onOpen: (item: WidgetEnableMenuItem) => void;
onSelect: (instanceId: string) => void;
- progressState: QueueProgressBarState;
- showProgress: boolean;
}) => {
const { t } = useTranslation();
const label = activeItem?.label ?? t('widgets.centerViewEmpty');
@@ -287,7 +256,6 @@ const CenterViewMenu = ({
size="2xs"
variant="ghost"
>
- {showProgress ? <QueueTabBackgroundProgress state={progressState} zIndex="-1" /> : null}
<HStack gap="2" minW="0" position="relative" zIndex="1">
{activeItem ? <WidgetIcon icon={activeItem.widget.manifest.icon} boxSize="3.5" /> : null}
<Text fontSize="xs" fontWeight="700" truncate>
diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsx
index 2f0ee8941f..3bd62bf6ba 100644
--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsx
+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/QueueCluster.tsx
@@ -3,7 +3,7 @@ import type { QueueItem } from '@features/queue/contracts';
import type { QueueItemProgress } from '@features/queue/react';
import type { ReactNode } from 'react';
-import { Badge, Box, chakra, HStack, Icon, Menu, Portal, Progress, Stack, Text } from '@chakra-ui/react';
+import { Badge, chakra, HStack, Icon, Menu, Portal, Progress, Stack, Text } from '@chakra-ui/react';
import { useModelLoads } from '@features/models';
import {
getQueueItemExpectedImageCount,
@@ -80,19 +80,10 @@ export const QueueCluster = () => {
variant={tone === 'idle' ? 'outline' : 'subtle'}
onClick={handleOpenQueue}
>
- {tone === 'running' && progressValue !== null ? (
- <Box
- aria-hidden="true"
- bg="colorPalette.solid"
- bottom="0"
- left="0"
- opacity="0.35"
- position="absolute"
- top="0"
- transition="width var(--wb-motion-duration-fast) linear"
- width={`${Math.round(progressValue * 100)}%`}
- />
- ) : null}
+ {/* No background fill here any more: the top bar's progress rail is
+ twenty pixels below this button and says the same thing at
+ viewport width, where a 35%-opacity wash behind a number never
+ really did. The count and the tooltip are this control's job. */}
<Icon as={isPaused ? PauseIcon : ListOrderedIcon} position="relative" zIndex="1" />
<chakra.span fontVariantNumeric="tabular-nums" position="relative" textAlign="center" zIndex="1">
{remaining}
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewLiveReadout.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewLiveReadout.tsx
index c0ca9e0feb..d96ddd24dc 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewLiveReadout.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewLiveReadout.tsx
@@ -1,6 +1,5 @@
-import { Badge, Box, Text } from '@chakra-ui/react';
+import { Badge, Text } from '@chakra-ui/react';
import { useQueueItemProgress, type QueueItemProgress } from '@features/queue/react';
-import { useMemo, type CSSProperties } from 'react';
import { useTranslation } from 'react-i18next';
/**
@@ -24,33 +23,23 @@ const getStepMessage = (progress: QueueItemProgress | null, generatingLabel: str
return message;
};
-/** Badge + 2px hairline progress bar drawn over the fitted frame while live. */
+/**
+ * The live badge drawn over the fitted frame.
+ *
+ * No bar under it any more: the denoising image *is* the progress here — you can
+ * watch it resolve — and the top bar's rail already carries the quantified
+ * version at viewport width. A second hairline across the image only competed
+ * with the thing it was describing.
+ */
export const PreviewLiveOverlay = ({ queueItemId }: { queueItemId: string }) => {
const { t } = useTranslation();
const progress = useQueueItemProgress(queueItemId);
const percentage = progress?.percentage ?? null;
- const fillStyle = useMemo<CSSProperties>(
- () => ({ width: percentage === null ? '100%' : `${percentage * 100}%` }),
- [percentage]
- );
return (
- <>
- <Badge left="2" pointerEvents="none" position="absolute" size="xs" top="2" variant="solid">
- {percentage === null ? t('common.generating') : `${t('common.generating')} · ${formatPercent(percentage)}`}
- </Badge>
- <Box bottom="0" h="2px" left="0" pointerEvents="none" position="absolute" right="0">
- <Box
- bg="accent.solid"
- h="full"
- opacity={percentage === null ? 0.35 : 1}
- style={fillStyle}
- transitionDuration="var(--wb-motion-duration-fast)"
- transitionProperty="width"
- transitionTimingFunction="ease"
- />
- </Box>
- </>
+ <Badge left="2" pointerEvents="none" position="absolute" size="xs" top="2" variant="solid">
+ {percentage === null ? t('common.generating') : `${t('common.generating')} · ${formatPercent(percentage)}`}
+ </Badge>
);
};