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(ui): apply post-review palette cleanups

joshistoast8da5ad066302
diff --git a/invokeai/frontend/webv2/public/locales/en-GB.json b/invokeai/frontend/webv2/public/locales/en-GB.json
index 481f298fee..ee1d8bb0ee 100644
--- a/invokeai/frontend/webv2/public/locales/en-GB.json
+++ b/invokeai/frontend/webv2/public/locales/en-GB.json
@@ -4,6 +4,7 @@
"buttonLabel": "Command palette",
"buttonTooltip": "Command palette ({{hotkey}})",
"inputLabel": "Search commands and settings",
+ "resultsLabel": "Command palette results",
"placeholders": {
"root": "Search commands, settings, and more…",
"scope": "Search {{label}}…",
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index b6c1148964..eb3bad22a7 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -4,6 +4,7 @@
"buttonLabel": "Command palette",
"buttonTooltip": "Command palette ({{hotkey}})",
"inputLabel": "Search commands and settings",
+ "resultsLabel": "Command palette results",
"placeholders": {
"root": "Search commands, settings, and more…",
"scope": "Search {{label}}…",
diff --git a/invokeai/frontend/webv2/src/architecture/dependencyPolicy.test.ts b/invokeai/frontend/webv2/src/architecture/dependencyPolicy.test.ts
index cd79c25071..74b63bcfdc 100644
--- a/invokeai/frontend/webv2/src/architecture/dependencyPolicy.test.ts
+++ b/invokeai/frontend/webv2/src/architecture/dependencyPolicy.test.ts
@@ -166,7 +166,7 @@ describe('feature public-interface registry', () => {
expect(checkDependency('workbench/palette/paletteProviders.ts', '@features/workflow/paletteSearch')).toEqual([]);
expect(checkDependency('workbench/palette/paletteProviders.ts', '@features/gallery/paletteSearch')).toEqual([]);
expect(checkDependency('workbench/palette/paletteProviders.ts', '@features/queue/queries')).toEqual([]);
- expect(checkDependency('workbench/palette/WorkbenchCommandPalette.tsx', '@features/queue/paletteSearch')).toEqual(
+ expect(checkDependency('workbench/palette/WorkbenchCommandPaletteDialog.tsx', '@features/queue/queries')).toEqual(
[]
);
expect(checkDependency('workbench/palette/WorkbenchCommandPalette.tsx', '@features/queue/reveal')).toEqual([]);
diff --git a/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts b/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts
index 807dc8a449..299f1928be 100644
--- a/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts
+++ b/invokeai/frontend/webv2/src/architecture/featureInterfaces.ts
@@ -10,7 +10,7 @@ export const FEATURE_PUBLIC_INTERFACES: Readonly<Record<string, readonly string[
identity: [],
models: ['react'],
nodes: [],
- queue: ['contracts', 'menu', 'paletteSearch', 'queries', 'react', 'reveal', 'utility', 'widget'],
+ queue: ['contracts', 'menu', 'queries', 'react', 'reveal', 'utility', 'widget'],
upscale: ['widget'],
workflow: ['contracts', 'graph', 'paletteSearch', 'preview', 'queries', 'react', 'utility', 'widget'],
};
diff --git a/invokeai/frontend/webv2/src/features/gallery/queries.ts b/invokeai/frontend/webv2/src/features/gallery/queries.ts
index 47277213a2..4f10c268a0 100644
--- a/invokeai/frontend/webv2/src/features/gallery/queries.ts
+++ b/invokeai/frontend/webv2/src/features/gallery/queries.ts
@@ -1,3 +1,2 @@
export { galleryBoardsOptions, galleryImagesOptions, galleryKeys } from './data/queries';
export type { GalleryBoardsQuery, GalleryImagesQuery } from './data/queries';
-export { ALL_READABLE_BOARDS_ID, listGalleryBoards, listGalleryImages } from './data/backend';
diff --git a/invokeai/frontend/webv2/src/features/queue/paletteSearch.ts b/invokeai/frontend/webv2/src/features/queue/paletteSearch.ts
deleted file mode 100644
index c8b1573af0..0000000000
--- a/invokeai/frontend/webv2/src/features/queue/paletteSearch.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import type { QueueQueryScope, QueueReadModel } from './core/types';
-
-import { queueBackend } from './data/httpRealtimeQueueBackend';
-
-/** Reads the bounded queue model used by deferred command-palette search. */
-export const loadPaletteQueueReadModel = async (scope: QueueQueryScope): Promise<QueueReadModel> => {
- const [status, current, next, idsResult] = await Promise.all([
- queueBackend.readStatus(scope),
- queueBackend.readCurrent(scope),
- queueBackend.readNext(scope),
- queueBackend.readItemIds('desc', scope),
- ]);
- const items = await queueBackend.readItemsById(idsResult.itemIds.slice(0, 50));
-
- return { current, items, next, scope, status };
-};
diff --git a/invokeai/frontend/webv2/src/features/workflow/paletteSearch.ts b/invokeai/frontend/webv2/src/features/workflow/paletteSearch.ts
index ac1de62574..828ee01232 100644
--- a/invokeai/frontend/webv2/src/features/workflow/paletteSearch.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/paletteSearch.ts
@@ -1,19 +1,4 @@
-import { apiFetchJson } from '@platform/transport/http';
-
-interface WorkflowLibraryListItemDTO {
- workflow_id: string;
- name: string;
- description: string;
- category: 'user' | 'default';
- tags?: string | null;
-}
-
-interface WorkflowLibraryPageDTO {
- items: WorkflowLibraryListItemDTO[];
- page: number;
- pages: number;
- total: number;
-}
+import { listLibraryWorkflows as listLibraryWorkflowsApi, type ListWorkflowsParams } from './data/api';
export interface WorkflowLibraryItem {
workflowId: string;
@@ -30,41 +15,20 @@ export interface WorkflowLibraryPage {
total: number;
}
-const mapItem = (item: WorkflowLibraryListItemDTO): WorkflowLibraryItem => ({
- category: item.category,
- description: item.description,
- name: item.name,
- tags: item.tags ?? undefined,
- workflowId: item.workflow_id,
-});
-
/** Cancellable workflow-library read used by deferred cross-feature search surfaces. */
-export const listLibraryWorkflows = async ({
- category,
- page,
- perPage = 20,
- query,
- signal,
-}: {
- category: 'user' | 'default';
- page: number;
- perPage?: number;
- query?: string;
- signal?: AbortSignal;
-}): Promise<WorkflowLibraryPage> => {
- const params = new URLSearchParams({
- direction: 'DESC',
- order_by: 'updated_at',
- page: String(page),
- per_page: String(perPage),
- });
-
- params.append('categories', category);
- if (query?.trim()) {
- params.set('query', query.trim());
- }
-
- const body = await apiFetchJson<WorkflowLibraryPageDTO>(`/api/v1/workflows/?${params.toString()}`, { signal });
-
- return { items: body.items.map(mapItem), page: body.page, pages: body.pages, total: body.total };
+export const listLibraryWorkflows = async (params: ListWorkflowsParams): Promise<WorkflowLibraryPage> => {
+ const body = await listLibraryWorkflowsApi(params);
+
+ return {
+ items: body.items.map((item) => ({
+ category: item.category,
+ description: item.description,
+ name: item.name,
+ tags: item.tags ?? undefined,
+ workflowId: item.workflow_id,
+ })),
+ page: body.page,
+ pages: body.pages,
+ total: body.total,
+ };
};
diff --git a/invokeai/frontend/webv2/src/platform/search/dateTokens.test.ts b/invokeai/frontend/webv2/src/platform/search/dateTokens.test.ts
index b8733089b3..d9c5aba0ba 100644
--- a/invokeai/frontend/webv2/src/platform/search/dateTokens.test.ts
+++ b/invokeai/frontend/webv2/src/platform/search/dateTokens.test.ts
@@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest';
import {
completeTrailingDateToken,
- formatDateRangeLabel,
formatIsoDate,
isPossibleDatePrefix,
isTimestampInRange,
@@ -18,7 +17,6 @@ describe('parseDateTokens', () => {
const parse = parseDateTokens('sunset boulevard', NOW);
expect(parse).toEqual({
- hasDateTokens: false,
invalidTokens: [],
range: undefined,
text: 'sunset boulevard',
@@ -30,7 +28,6 @@ describe('parseDateTokens', () => {
expect(parse.range).toEqual({ from: '2026-07-01', to: '2026-07-15' });
expect(parse.text).toBe('sunset boulevard');
- expect(parse.hasDateTokens).toBe(true);
expect(parse.invalidTokens).toEqual([]);
});
@@ -85,7 +82,6 @@ describe('parseDateTokens', () => {
expect(parse.range).toBeUndefined();
expect(parse.text).toBe('sunset from:lastweek');
- expect(parse.hasDateTokens).toBe(true);
expect(parse.invalidTokens).toEqual([{ key: 'from', raw: 'lastweek' }]);
});
@@ -107,7 +103,8 @@ describe('parseDateTokens', () => {
it('ignores tokens without a leading boundary', () => {
const parse = parseDateTokens('wherefrom:2026-07-01', NOW);
- expect(parse.hasDateTokens).toBe(false);
+ expect(parse.range).toBeUndefined();
+ expect(parse.invalidTokens).toEqual([]);
expect(parse.text).toBe('wherefrom:2026-07-01');
});
@@ -181,19 +178,11 @@ describe('isPossibleDatePrefix', () => {
});
});
-describe('formatIsoDate / formatDateRangeLabel', () => {
+describe('formatIsoDate', () => {
it('formats the calendar day itself regardless of timezone offset', () => {
// A UTC-based Date('2026-07-21') would render Jul 20 in negative offsets;
// parts-based construction must always yield the written day.
expect(formatIsoDate('2026-07-21', 'en-US')).toBe('Jul 21');
expect(formatIsoDate('2026-07-21', 'de-DE')).toBe('21. Juli');
});
-
- it('covers all four range shapes', () => {
- expect(formatDateRangeLabel({ from: '2026-07-14', to: '2026-07-21' }, 'en-US')).toBe('Jul 14 – Jul 21');
- expect(formatDateRangeLabel({ from: '2026-07-14' }, 'en-US')).toBe('From Jul 14');
- expect(formatDateRangeLabel({ to: '2026-07-21' }, 'en-US')).toBe('Through Jul 21');
- expect(formatDateRangeLabel({ from: '2026-07-21', to: '2026-07-21' }, 'en-US')).toBe('Jul 21');
- expect(formatDateRangeLabel({}, 'en-US')).toBe('');
- });
});
diff --git a/invokeai/frontend/webv2/src/platform/search/dateTokens.ts b/invokeai/frontend/webv2/src/platform/search/dateTokens.ts
index 71ce1f8d6b..f776c00be9 100644
--- a/invokeai/frontend/webv2/src/platform/search/dateTokens.ts
+++ b/invokeai/frontend/webv2/src/platform/search/dateTokens.ts
@@ -36,8 +36,6 @@ export interface DateTokenParse {
/** Resolved bounds; present only when at least one valid token resolved. */
range?: DateRange;
invalidTokens: readonly InvalidDateToken[];
- /** Any from:/to:/date: token present, valid or not. */
- hasDateTokens: boolean;
}
const TOKEN_PATTERN = /(^|\s)(from|to|date):(\S*)/gi;
@@ -103,11 +101,9 @@ export const parseDateTokens = (query: string, now: Date = new Date()): DateToke
let from: string | undefined;
let to: string | undefined;
let hasValidToken = false;
- let hasDateTokens = false;
const text = query
.replace(TOKEN_PATTERN, (match, boundary: string, rawKey: string, rawValue: string) => {
- hasDateTokens = true;
const key = rawKey.toLowerCase() as DateTokenKey;
const resolved = resolveDateValue(rawValue, now);
@@ -136,7 +132,6 @@ export const parseDateTokens = (query: string, now: Date = new Date()): DateToke
}
return {
- hasDateTokens,
invalidTokens,
range: hasValidToken ? { from, to } : undefined,
text,
@@ -269,26 +264,3 @@ export const formatIsoDate = (isoDate: string, locale?: string): string => {
return new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'short' }).format(local);
};
-
-/**
- * Human-readable label for an applied range, e.g. "From Jul 14",
- * "Through Jul 21", "Jul 14 – Jul 21", or "Jul 21" for a single day.
- * English-only; i18n surfaces compose their own labels from formatIsoDate.
- */
-export const formatDateRangeLabel = (range: DateRange, locale?: string): string => {
- if (range.from !== undefined && range.to !== undefined) {
- return range.from === range.to
- ? formatIsoDate(range.from, locale)
- : `${formatIsoDate(range.from, locale)} – ${formatIsoDate(range.to, locale)}`;
- }
-
- if (range.from !== undefined) {
- return `From ${formatIsoDate(range.from, locale)}`;
- }
-
- if (range.to !== undefined) {
- return `Through ${formatIsoDate(range.to, locale)}`;
- }
-
- return '';
-};
diff --git a/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsx b/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsx
index 21999d9e04..98bfe51e38 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsx
+++ b/invokeai/frontend/webv2/src/workbench/palette/CommandPaletteRows.tsx
@@ -5,6 +5,7 @@ import { useVirtualizer } from '@tanstack/react-virtual';
import { dropdownGroupLabel } from '@theme/recipes';
import { CheckIcon } from 'lucide-react';
import { useCallback, useImperativeHandle, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import type { PaletteEntry, PaletteRow } from './entries';
@@ -89,7 +90,7 @@ const EntryRow = ({
<Text fontSize="sm" truncate>
{renderTitle(entry.title, matchIndexes)}
</Text>
- {entry.subtitle === 'Current' ? (
+ {entry.isCurrent ? (
<Icon as={CheckIcon} boxSize="3.5" color="fg.muted" flexShrink={0} />
) : entry.subtitle ? (
<Text color="fg.subtle" flexShrink={0} fontSize="xs" maxW="45%" truncate>
@@ -258,6 +259,7 @@ export const CommandPaletteRows = ({
onActive: (rowId: string) => void;
onRun: (row: PaletteRow) => void;
}) => {
+ const { t } = useTranslation();
const [scrollElement, setScrollElement] = useState<HTMLDivElement | null>(null);
const estimateRowSize = useCallback(
(index: number) => (rows[index]?.kind === 'label' ? LABEL_ROW_HEIGHT_PX : ENTRY_ROW_HEIGHT_PX),
@@ -280,7 +282,7 @@ export const CommandPaletteRows = ({
return (
<ScrollArea.Root maxH="min(400px, 55dvh)" size="xs" variant="hover" w="full">
- <ScrollArea.Viewport ref={setScrollElement} aria-label="Command palette results" maxH="inherit" w="full">
+ <ScrollArea.Viewport ref={setScrollElement} aria-label={t('commandPalette.resultsLabel')} maxH="inherit" w="full">
<ScrollArea.Content id={RESULT_LIST_ID} aria-busy={isBusy} pb="1.5" role="listbox" w="full">
<Box h={`${virtualizer.getTotalSize()}px`} position="relative" w="full">
{virtualizer.getVirtualItems().map((virtualRow) => {
diff --git a/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx b/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx
index ba8682a4a4..2469bfa669 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx
+++ b/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx
@@ -1,3 +1,5 @@
+import type { WorkbenchPreferences } from '@workbench/settings/contracts';
+
import { useCapabilities } from '@features/identity';
import { useNavigate, useSearch } from '@tanstack/react-router';
import { openWorkbenchSettings } from '@workbench/settings/settingsDialogStore';
@@ -66,4 +68,3 @@ const LaunchpadCommandPaletteDialog = ({
};
export default LaunchpadCommandPaletteDialog;
-import type { WorkbenchPreferences } from '@workbench/settings/contracts';
diff --git a/invokeai/frontend/webv2/src/workbench/palette/PaletteButton.tsx b/invokeai/frontend/webv2/src/workbench/palette/PaletteButton.tsx
index 28b13bab79..b0efd236dc 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/PaletteButton.tsx
+++ b/invokeai/frontend/webv2/src/workbench/palette/PaletteButton.tsx
@@ -1,12 +1,13 @@
import { Icon } from '@chakra-ui/react';
import { IconButton } from '@platform/ui/Button';
import { Tooltip } from '@platform/ui/Tooltip';
+import { formatHotkeyForPlatform } from '@workbench/hotkeys/keys';
import { SearchIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { openCommandPalette } from './paletteStore';
-const hotkeyLabel = /mac/i.test(navigator.platform) ? 'cmd+k' : 'ctrl+k';
+const hotkeyLabel = formatHotkeyForPlatform('mod+k').join('+');
/** Pointer affordance for the palette; the kbd hint keeps mod+K discoverable. */
export const PaletteButton = () => {
diff --git a/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPalette.tsx b/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPalette.tsx
index 300c526037..b823e14990 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPalette.tsx
+++ b/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPalette.tsx
@@ -1,6 +1,5 @@
import type { WorkbenchPreferences } from '@workbench/settings/contracts';
-import { loadPaletteQueueReadModel } from '@features/queue/paletteSearch';
import { requestQueueItemReveal } from '@features/queue/reveal';
import { useMountEffect } from '@platform/react/useMountEffect';
import { firstPartyHotkeyCatalog } from '@workbench/hotkeys/catalog';
@@ -38,7 +37,6 @@ const OpenWorkbenchCommandPalette = ({ preferences }: { preferences: WorkbenchPr
modifierKeyLabel={formatHotkeyForPlatform('mod')[0]!}
openWidgetPlacement={openWidgetPlacement}
preferences={preferences}
- loadQueueReadModel={loadPaletteQueueReadModel}
requestQueueItemReveal={requestQueueItemReveal}
settingsEntryDeps={SETTINGS_ENTRY_DEPS as SettingsEntryDeps}
onClose={closeCommandPalette}
diff --git a/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPaletteDialog.tsx b/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPaletteDialog.tsx
index 19241ddffd..d1286f4b68 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPaletteDialog.tsx
+++ b/invokeai/frontend/webv2/src/workbench/palette/WorkbenchCommandPaletteDialog.tsx
@@ -1,4 +1,3 @@
-import type { QueueQueryScope, QueueReadModel } from '@features/queue/contracts';
import type { HotkeyDefinition } from '@workbench/hotkeys/types';
import type { WorkbenchPreferences } from '@workbench/settings/contracts';
import type { openWidgetPlacement as OpenWidgetPlacement } from '@workbench/widgetPlacementCommands';
@@ -7,6 +6,7 @@ import type { TFunction } from 'i18next';
import { getPromptHistoryRecallPatch } from '@features/generation/settings';
import { useModelsSnapshot } from '@features/models';
+import { getQueueQueryScope, getQueueReadModelOptions } from '@features/queue/queries';
import { queryClient } from '@platform/query/client';
import { openWorkbenchSettings } from '@workbench/settings/settingsDialogStore';
import { getProjectWidgetValues } from '@workbench/widgetState';
@@ -56,7 +56,6 @@ const WorkbenchCommandPaletteDialog = ({
catalog,
formatHotkey,
getWidgetsForRegion,
- loadQueueReadModel,
modifierKeyLabel,
onClose,
openWidgetPlacement,
@@ -67,7 +66,6 @@ const WorkbenchCommandPaletteDialog = ({
catalog: readonly HotkeyDefinition[];
formatHotkey: (hotkey: string) => string[];
getWidgetsForRegion: typeof GetWidgetsForRegion;
- loadQueueReadModel: (scope: QueueQueryScope) => Promise<QueueReadModel>;
modifierKeyLabel: string;
onClose: () => void;
openWidgetPlacement: typeof OpenWidgetPlacement;
@@ -133,8 +131,7 @@ const WorkbenchCommandPaletteDialog = ({
const extensionSearchProviders = useSyncExternalStore(searchStore.subscribe, searchStore.list, searchStore.list);
const promptRecallContextKey = `${getObjectIdentity(generateValues, 'generation')}:${getObjectIdentity(models, 'models')}`;
const queueScope = useMemo(
- () =>
- preferences.queueJobsScope === 'active-project' && projectId ? { originPrefix: `webv2:p:${projectId}:q:` } : {},
+ () => getQueueQueryScope({ projectId, queueJobsScope: preferences.queueJobsScope }),
[preferences.queueJobsScope, projectId]
);
const providers = useMemo<PaletteSearchProvider[]>(() => {
@@ -177,12 +174,7 @@ const WorkbenchCommandPaletteDialog = ({
}),
createQueueItemsProvider({
contextKey: queueScope.originPrefix ?? 'all-projects',
- loadQueue: () =>
- queryClient.fetchQuery({
- queryFn: () => loadQueueReadModel(queueScope),
- queryKey: ['queue', 'read-model', queueScope.originPrefix ?? 'all'],
- staleTime: 5_000,
- }),
+ loadQueue: () => queryClient.fetchQuery(getQueueReadModelOptions(queueScope)),
openQueueWidget: () => openWidget('queue'),
revealItem: requestQueueItemReveal,
t,
@@ -218,7 +210,6 @@ const WorkbenchCommandPaletteDialog = ({
promptHistory,
promptRecallContextKey,
queueScope,
- loadQueueReadModel,
requestQueueItemReveal,
t,
workbenchCommands,
diff --git a/invokeai/frontend/webv2/src/workbench/palette/entries.test.ts b/invokeai/frontend/webv2/src/workbench/palette/entries.test.ts
index 573b123605..1e1fc856c6 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/entries.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/palette/entries.test.ts
@@ -232,7 +232,13 @@ describe('buildStageEntries', () => {
onApplied
);
- expect(entries[0]).toMatchObject({ group: 'Theme', keepOpen: true, subtitle: 'Current', title: 'Alpha' });
+ expect(entries[0]).toMatchObject({
+ group: 'Theme',
+ isCurrent: true,
+ keepOpen: true,
+ subtitle: 'Current',
+ title: 'Alpha',
+ });
entries[0]?.run();
expect(apply).toHaveBeenCalled();
diff --git a/invokeai/frontend/webv2/src/workbench/palette/entries.ts b/invokeai/frontend/webv2/src/workbench/palette/entries.ts
index edbf9fdd6f..b56b239a7a 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/entries.ts
+++ b/invokeai/frontend/webv2/src/workbench/palette/entries.ts
@@ -42,6 +42,8 @@ export interface PaletteEntry {
groupLabel?: string;
/** Trailing muted text: a setting's current value, an entity's metadata. */
subtitle?: string;
+ /** Currently applied stage option; renders a check instead of the subtitle. */
+ isCurrent?: boolean;
/** Leading 28×28 thumbnail (image results). */
thumbnailUrl?: string;
/** Extra match terms, never rendered. */
@@ -245,21 +247,20 @@ export const buildCatalogCommandEntries = ({
.map((definition) => {
const widgetGroup = WIDGET_CATEGORY_GROUPS[definition.category];
const rawGroup = widgetGroup?.group ?? APP_COMMAND_GROUPS[definition.commandId] ?? 'App';
- const group = rawGroup;
const groupLabel = t(
`commandPalette.groups.${rawGroup.replaceAll(' ', '').replace(/^./, (char) => char.toLowerCase())}`,
{ defaultValue: rawGroup }
);
return {
- group,
+ group: rawGroup,
groupLabel,
id: definition.commandId,
isPersistentRecent: true,
keys: getEntryKeys(definition, customHotkeys, formatHotkey),
keywords: widgetGroup?.group,
run: () => execute(definition.commandId),
- showInEmptyState: group === 'Navigation',
+ showInEmptyState: rawGroup === 'Navigation',
title: t(`commandPalette.commands.${definition.commandId.replace('.', '_')}`, {
defaultValue: TITLE_OVERRIDES[definition.commandId] ?? definition.title,
}),
@@ -592,6 +593,7 @@ export const buildStageEntries = (stage: PaletteStage, onApplied: () => void, t?
stage.options.map((option) => ({
group: stage.title,
id: `${STAGE_ENTRY_ID_PREFIX}${option.id}`,
+ isCurrent: option.isCurrent,
isPersistentRecent: false,
keepOpen: true,
run: () => {
diff --git a/invokeai/frontend/webv2/src/workbench/palette/recents.ts b/invokeai/frontend/webv2/src/workbench/palette/recents.ts
index d36c94265a..52f9dfffd8 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/recents.ts
+++ b/invokeai/frontend/webv2/src/workbench/palette/recents.ts
@@ -6,6 +6,8 @@
* entry list at render time.
*/
+import type { PaletteEntry } from './entries';
+
const STORAGE_KEY = 'invokeai:v7:webv2:palette-recents';
const MAX_RECORDS = 40;
@@ -104,4 +106,3 @@ export const recordRecentEntry = (entry: Pick<PaletteEntry, 'id' | 'isPersistent
// Quota or private-mode failures are non-fatal; recents are a convenience.
}
};
-import type { PaletteEntry } from './entries';
diff --git a/invokeai/frontend/webv2/vite.config.mts b/invokeai/frontend/webv2/vite.config.mts
index 4e38006f45..fae0627dca 100644
--- a/invokeai/frontend/webv2/vite.config.mts
+++ b/invokeai/frontend/webv2/vite.config.mts
@@ -15,13 +15,15 @@ export default defineConfig({
rollupOptions: {
output: {
manualChunks(id) {
- // The palette's tiny global state is an external-store selector;
- // retain the established shared request instead of creating another.
- if (id.endsWith('/platform/state/selectors.ts') || id.endsWith('/workbench/palette/paletteStore.ts')) {
- return 'selectors';
- }
- if (id.endsWith('/platform/search/dateTokens.ts')) {
- return 'vendor';
+ // Tiny first-party modules imported by both the eager shell and lazy
+ // feature chunks (store selectors, the palette's open state, the
+ // date-token parser); one shared chunk instead of a file per module.
+ if (
+ id.endsWith('/platform/state/selectors.ts') ||
+ id.endsWith('/workbench/palette/paletteStore.ts') ||
+ id.endsWith('/platform/search/dateTokens.ts')
+ ) {
+ return 'shared';
}
if (!id.includes('/node_modules/')) {