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): add a Preferences page to the Launchpad

Josh Corbett3c21e84889ee
diff --git a/invokeai/frontend/webv2/performance/architecture-baseline.json b/invokeai/frontend/webv2/performance/architecture-baseline.json
index 5e50dc24ff..78a0f8d93f 100644
--- a/invokeai/frontend/webv2/performance/architecture-baseline.json
+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json
@@ -2,15 +2,15 @@
"build": {
"launchpad": {
"baseline": {
- "brotliBytes": 901357,
+ "brotliBytes": 893510,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 900242,
+ "gzipBytes": 892809,
"imageRawBytes": 156376,
- "initialRawBytes": 2144207,
- "largestAssetRawBytes": 778953,
+ "initialRawBytes": 2118301,
+ "largestAssetRawBytes": 749035,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 92610,
+ "ownedRawBytes": 93111,
"requestCount": 36,
"scriptRequestCount": 20,
"sourceOwners": [
@@ -320,10 +320,11 @@
"source:src/workbench/projects/session.ts",
"source:src/workbench/projects/syncStore.ts",
"source:src/workbench/projects/useProjectFileActions.ts",
- "source:src/workbench/settings/SettingsButton.tsx",
"source:src/workbench/settings/SettingsDialogHost.tsx",
"source:src/workbench/settings/dialogResource.ts",
+ "source:src/workbench/settings/launchpad.tsx",
"source:src/workbench/settings/settingsDialogStore.ts",
+ "source:src/workbench/settings/settingsSearchShortcut.ts",
"source:src/workbench/settings/store.ts"
]
},
@@ -333,17 +334,17 @@
},
"editor": {
"baseline": {
- "brotliBytes": 1251847,
+ "brotliBytes": 1242105,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 1245199,
+ "gzipBytes": 1236729,
"imageRawBytes": 156376,
- "initialRawBytes": 3225507,
- "largestAssetRawBytes": 778953,
+ "initialRawBytes": 3202228,
+ "largestAssetRawBytes": 749035,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 144687,
- "requestCount": 84,
- "scriptRequestCount": 68,
+ "ownedRawBytes": 144143,
+ "requestCount": 77,
+ "scriptRequestCount": 61,
"sourceOwners": [
"package:@ark-ui/react",
"package:@chakra-ui/react",
@@ -947,14 +948,15 @@
"source:src/workbench/queue-integration/queueRunRestoration.ts",
"source:src/workbench/queue-integration/useActiveQueueProgress.ts",
"source:src/workbench/queue-integration/useQueueRecoveryProjectIds.ts",
- "source:src/workbench/settings/SettingsButton.tsx",
"source:src/workbench/settings/SettingsDialogHost.tsx",
"source:src/workbench/settings/WidgetSettingsButton.tsx",
"source:src/workbench/settings/applicationContributions.ts",
"source:src/workbench/settings/catalog.ts",
"source:src/workbench/settings/clearWorkspaceData.ts",
"source:src/workbench/settings/dialogResource.ts",
+ "source:src/workbench/settings/launchpad.tsx",
"source:src/workbench/settings/settingsDialogStore.ts",
+ "source:src/workbench/settings/settingsSearchShortcut.ts",
"source:src/workbench/settings/store.ts",
"source:src/workbench/shell/BottomPanel.tsx",
"source:src/workbench/shell/CenterArea.tsx",
@@ -1063,7 +1065,7 @@
"source": "src/app/WorkbenchApp.tsx"
}
},
- "capturedAt": "2026-09-28",
+ "capturedAt": "2026-09-29",
"developmentInvalidation": {
"platformUiBarrel": {
"specifier": "@platform/ui",
diff --git a/invokeai/frontend/webv2/performance/browser-baseline.json b/invokeai/frontend/webv2/performance/browser-baseline.json
index 23f17ab572..95723202ce 100644
--- a/invokeai/frontend/webv2/performance/browser-baseline.json
+++ b/invokeai/frontend/webv2/performance/browser-baseline.json
@@ -732,10 +732,11 @@
"source:src/workbench/projects/session.ts",
"source:src/workbench/projects/syncStore.ts",
"source:src/workbench/projects/useProjectFileActions.ts",
- "source:src/workbench/settings/SettingsButton.tsx",
"source:src/workbench/settings/SettingsDialogHost.tsx",
"source:src/workbench/settings/dialogResource.ts",
+ "source:src/workbench/settings/launchpad.tsx",
"source:src/workbench/settings/settingsDialogStore.ts",
+ "source:src/workbench/settings/settingsSearchShortcut.ts",
"source:src/workbench/settings/store.ts"
],
"editor-minimal-static": [
@@ -1648,14 +1649,15 @@
"source:src/workbench/queue-integration/queueRunRestoration.ts",
"source:src/workbench/queue-integration/useActiveQueueProgress.ts",
"source:src/workbench/queue-integration/useQueueRecoveryProjectIds.ts",
- "source:src/workbench/settings/SettingsButton.tsx",
"source:src/workbench/settings/SettingsDialogHost.tsx",
"source:src/workbench/settings/WidgetSettingsButton.tsx",
"source:src/workbench/settings/applicationContributions.ts",
"source:src/workbench/settings/catalog.ts",
"source:src/workbench/settings/clearWorkspaceData.ts",
"source:src/workbench/settings/dialogResource.ts",
+ "source:src/workbench/settings/launchpad.tsx",
"source:src/workbench/settings/settingsDialogStore.ts",
+ "source:src/workbench/settings/settingsSearchShortcut.ts",
"source:src/workbench/settings/store.ts",
"source:src/workbench/shell/BottomPanel.tsx",
"source:src/workbench/shell/CenterArea.tsx",
@@ -2726,14 +2728,15 @@
"source:src/workbench/queue-integration/useLocalRecallSnapshot.ts",
"source:src/workbench/queue-integration/useQueueItemRecall.ts",
"source:src/workbench/queue-integration/useQueueRecoveryProjectIds.ts",
- "source:src/workbench/settings/SettingsButton.tsx",
"source:src/workbench/settings/SettingsDialogHost.tsx",
"source:src/workbench/settings/WidgetSettingsButton.tsx",
"source:src/workbench/settings/applicationContributions.ts",
"source:src/workbench/settings/catalog.ts",
"source:src/workbench/settings/clearWorkspaceData.ts",
"source:src/workbench/settings/dialogResource.ts",
+ "source:src/workbench/settings/launchpad.tsx",
"source:src/workbench/settings/settingsDialogStore.ts",
+ "source:src/workbench/settings/settingsSearchShortcut.ts",
"source:src/workbench/settings/store.ts",
"source:src/workbench/shell/BottomPanel.tsx",
"source:src/workbench/shell/CenterArea.tsx",
@@ -4000,14 +4003,15 @@
"source:src/workbench/queue-integration/queueRunRestoration.ts",
"source:src/workbench/queue-integration/useActiveQueueProgress.ts",
"source:src/workbench/queue-integration/useQueueRecoveryProjectIds.ts",
- "source:src/workbench/settings/SettingsButton.tsx",
"source:src/workbench/settings/SettingsDialogHost.tsx",
"source:src/workbench/settings/WidgetSettingsButton.tsx",
"source:src/workbench/settings/applicationContributions.ts",
"source:src/workbench/settings/catalog.ts",
"source:src/workbench/settings/clearWorkspaceData.ts",
"source:src/workbench/settings/dialogResource.ts",
+ "source:src/workbench/settings/launchpad.tsx",
"source:src/workbench/settings/settingsDialogStore.ts",
+ "source:src/workbench/settings/settingsSearchShortcut.ts",
"source:src/workbench/settings/store.ts",
"source:src/workbench/shell/BottomPanel.tsx",
"source:src/workbench/shell/CenterArea.tsx",
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index ee5f62c2ed..085d84e39f 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -1707,7 +1707,8 @@
"nodes": "Nodes",
"projects": "Projects",
"users": "Users",
- "fonts": "Fonts"
+ "fonts": "Fonts",
+ "preferences": "Preferences"
},
"sectionsLabel": "Launchpad sections"
},
diff --git a/invokeai/frontend/webv2/scripts/run-accessibility-journeys.mjs b/invokeai/frontend/webv2/scripts/run-accessibility-journeys.mjs
index e1061f33bd..6cf82b09cc 100644
--- a/invokeai/frontend/webv2/scripts/run-accessibility-journeys.mjs
+++ b/invokeai/frontend/webv2/scripts/run-accessibility-journeys.mjs
@@ -163,15 +163,18 @@ const surfaces = [
ready: waitForProjects,
},
{
- id: 'launchpad-settings-intermediates-representative',
+ id: 'launchpad-preferences-intermediates-representative',
path: '/#/projects',
ready: async (page) => {
- await page.getByRole('button', { exact: true, name: 'Settings' }).click();
- const dialog = page.getByRole('dialog', { name: /^Settings:/ });
- await dialog
- .getByRole('navigation', { exact: true, name: 'Settings' })
- .getByRole('button', { name: 'Intermediates' })
+ await page
+ .getByRole('navigation', { exact: true, name: 'Launchpad sections' })
+ .getByRole('link', { exact: true, name: 'Preferences' })
+ .click();
+ await page
+ .getByRole('list', { exact: true, name: 'Settings section' })
+ .getByRole('button', { exact: true, name: 'Intermediates' })
.click();
+ await page.getByRole('heading', { exact: true, level: 2, name: 'Intermediates' }).waitFor();
await page.getByRole('textbox', { exact: true, name: 'Search projects' }).waitFor();
await page.getByRole('checkbox', { exact: true, name: 'Select Fixture Project 001' }).waitFor();
},
diff --git a/invokeai/frontend/webv2/src/app/router.tsx b/invokeai/frontend/webv2/src/app/router.tsx
index e0db2864b4..e8cd821554 100644
--- a/invokeai/frontend/webv2/src/app/router.tsx
+++ b/invokeai/frontend/webv2/src/app/router.tsx
@@ -156,6 +156,22 @@ const fontsHomeRoute = createRoute({
path: 'fonts',
});
+const validatePreferencesSearch = (search: Record<string, unknown>): { setting?: string } => ({
+ setting: typeof search.setting === 'string' && search.setting.length > 0 ? search.setting : undefined,
+});
+
+const preferencesHomeRoute = createRoute({
+ ...launchpadRouteOptions,
+ path: 'preferences',
+ validateSearch: validatePreferencesSearch,
+});
+
+const preferencesSectionRoute = createRoute({
+ ...launchpadRouteOptions,
+ path: 'preferences/$section',
+ validateSearch: validatePreferencesSearch,
+});
+
const workbenchRoute = createRoute({
beforeLoad: async ({ cause, search }) => {
// Preload the editor during the session peek; the module loader deduplicates the lazy-route import.
@@ -236,6 +252,8 @@ export const router = createRouter({
nodesHomeRoute,
usersHomeRoute,
fontsHomeRoute,
+ preferencesHomeRoute,
+ preferencesSectionRoute,
workbenchRoute,
]),
loginRoute,
diff --git a/invokeai/frontend/webv2/src/features/intermediates/data/focus.ts b/invokeai/frontend/webv2/src/features/intermediates/data/focus.ts
index 45354e55dd..afd4ded384 100644
--- a/invokeai/frontend/webv2/src/features/intermediates/data/focus.ts
+++ b/invokeai/frontend/webv2/src/features/intermediates/data/focus.ts
@@ -16,22 +16,28 @@ export interface IntermediatesFocus {
ownerLabel?: string;
}
-const focusStore = createExternalStore<{ focus: IntermediatesFocus | null }>({ focus: null });
+/** `request` counts requests, so a manager that is already showing can restart on a new one. */
+const focusStore = createExternalStore<{ focus: IntermediatesFocus | null; request: number }>({
+ focus: null,
+ request: 0,
+});
registerAccountOwnedResource({
- clear: () => focusStore.setSnapshot({ focus: null }),
+ clear: () => focusStore.setSnapshot({ focus: null, request: 0 }),
name: 'intermediates-focus',
});
export const requestIntermediatesFocus = (focus: IntermediatesFocus): void => {
- focusStore.setSnapshot({ focus });
+ focusStore.setSnapshot({ focus, request: focusStore.getSnapshot().request + 1 });
};
+export const useIntermediatesFocusRequest = (): number => focusStore.useSelector((snapshot) => snapshot.request);
+
export const peekIntermediatesFocus = (): IntermediatesFocus | null => focusStore.getSnapshot().focus;
/** Clears `focus` unless a newer request has replaced it. */
export const consumeIntermediatesFocus = (focus: IntermediatesFocus | null): void => {
if (focus !== null && focusStore.getSnapshot().focus === focus) {
- focusStore.setSnapshot({ focus: null });
+ focusStore.patchSnapshot({ focus: null });
}
};
diff --git a/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesManager.browser.test.tsx b/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesManager.browser.test.tsx
index 931603b554..02e7bebd4b 100644
--- a/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesManager.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesManager.browser.test.tsx
@@ -259,6 +259,8 @@ const openForceDialogReadyToConfirm = async (
return dialog;
};
+const INTERMEDIATES_FIELD = { id: 'intermediatesManager', kind: 'custom', label: '', scope: 'none' } as const;
+
describe('IntermediatesManager', () => {
beforeEach(() => {
dependencies.getIntermediatesSummary
@@ -882,6 +884,35 @@ describe('IntermediatesManager', () => {
expect(host.contains(document.activeElement)).toBe(true);
});
+ it('starts over on a new entry point request while its settings section is already showing', async () => {
+ host = document.createElement('div');
+ host.style.height = '640px';
+ host.style.display = 'flex';
+ host.style.flexDirection = 'column';
+ document.body.append(host);
+ root = createRoot(host);
+ queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } });
+ const { requestIntermediatesFocus } = await import('@features/intermediates/data/focus');
+ const { IntermediatesSettingsField } = await import('./IntermediatesSettingsField');
+ requestIntermediatesFocus({ projectId: 'p1' });
+ await act(() => {
+ root.render(
+ <ChakraProvider value={system}>
+ <QueryClientProvider client={queryClient}>
+ <IntermediatesSettingsField field={INTERMEDIATES_FIELD} surface="dialog" />
+ </QueryClientProvider>
+ </ChakraProvider>
+ );
+ });
+ await vi.waitFor(() => expect(checkbox('intermediates.list.selectRow(name=Portraits)').checked).toBe(true));
+ expect(checkbox('intermediates.list.selectRow(name=Landscapes)').checked).toBe(false);
+
+ // The Launchpad keeps the Preferences page mounted, so a later request arrives while the manager is showing.
+ await act(() => requestIntermediatesFocus({ projectId: 'p2' }));
+ await vi.waitFor(() => expect(checkbox('intermediates.list.selectRow(name=Landscapes)').checked).toBe(true));
+ expect(checkbox('intermediates.list.selectRow(name=Portraits)').checked).toBe(false);
+ });
+
it('asks the server once under StrictMode, follows the running operation and consumes the entry point intent on commit', async () => {
const { peekIntermediatesFocus } = await import('@features/intermediates/data/focus');
const running = { ...operationOf('running'), operationId: 'op-running' };
diff --git a/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesSettingsField.tsx b/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesSettingsField.tsx
index 6c4b25687a..c46b30d85f 100644
--- a/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesSettingsField.tsx
+++ b/invokeai/frontend/webv2/src/features/intermediates/ui/IntermediatesSettingsField.tsx
@@ -2,6 +2,7 @@ import type { SettingFieldProps } from '@platform/ui/settings/contracts';
import { Box } from '@chakra-ui/react';
import { useAuthSession, useCapabilities } from '@features/identity';
+import { useIntermediatesFocusRequest } from '@features/intermediates/data/focus';
import { IntermediatesManager } from './IntermediatesManager';
@@ -10,10 +11,13 @@ export const IntermediatesSettingsField = (_props: SettingFieldProps) => {
const session = useAuthSession();
const { canClearOthersIntermediates } = useCapabilities();
const user = session.phase === 'ready' ? session.user : null;
+ // A surface that stays mounted (the Launchpad page) still starts over on each entry point's request.
+ const focusRequest = useIntermediatesFocusRequest();
return (
<Box display="flex" flex="1" flexDirection="column" minH="0">
<IntermediatesManager
+ key={focusRequest}
canClearOthersIntermediates={canClearOthersIntermediates}
currentUserId={user?.user_id ?? null}
currentUserLabel={user ? user.display_name || user.email : null}
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/Launchpad.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/Launchpad.tsx
index 1ee433701d..657536d24f 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/Launchpad.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/Launchpad.tsx
@@ -1,14 +1,23 @@
import { Box, Flex, VisuallyHidden, type SystemStyleObject } from '@chakra-ui/react';
import { FontsPage } from '@features/fonts/launchpad';
import { useCapabilities, UsersPage } from '@features/identity';
-import { requestIntermediatesFocus } from '@features/intermediates';
+import { INTERMEDIATES_SETTING_ID, requestIntermediatesFocus } from '@features/intermediates';
import { ModelsPage } from '@features/models';
import { NodesPage } from '@features/nodes';
-import { useLocation } from '@tanstack/react-router';
+import { useLocation, useNavigate } from '@tanstack/react-router';
import { LaunchpadCommandPalette } from '@workbench/palette/LaunchpadCommandPalette';
-import { openWorkbenchSettings } from '@workbench/settings/settingsDialogStore';
-import { BlocksIcon, BoxIcon, FolderIcon, HouseIcon, TypeIcon, UsersIcon, type LucideIcon } from 'lucide-react';
-import { useMemo, useState, type ReactNode } from 'react';
+import { PreferencesPage } from '@workbench/settings/launchpad';
+import {
+ BlocksIcon,
+ BoxIcon,
+ FolderIcon,
+ HouseIcon,
+ SettingsIcon,
+ TypeIcon,
+ UsersIcon,
+ type LucideIcon,
+} from 'lucide-react';
+import { useCallback, useMemo, useState, type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { LaunchpadNav, type LaunchpadNavGroupId } from './LaunchpadNav';
@@ -22,7 +31,7 @@ import { ProjectActionsMenuProvider } from './projects/ProjectActionsMenuHost';
* across the route split.
*/
-type LaunchpadSectionId = 'home' | 'projects' | 'models' | 'nodes' | 'users' | 'fonts';
+type LaunchpadSectionId = 'home' | 'projects' | 'models' | 'nodes' | 'users' | 'fonts' | 'preferences';
interface LaunchpadSection {
id: LaunchpadSectionId;
@@ -34,13 +43,13 @@ interface LaunchpadSection {
}
const DEFAULT_SECTION_ID: LaunchpadSectionId = 'home';
-const SECTION_IDS: readonly string[] = ['home', 'projects', 'models', 'nodes', 'users', 'fonts'];
+const SECTION_IDS: readonly string[] = ['home', 'projects', 'models', 'nodes', 'users', 'fonts', 'preferences'];
const isSectionId = (value: string): value is LaunchpadSectionId => SECTION_IDS.includes(value);
-/** `/` is Home; every other section is its own path. */
+/** `/` is Home; every other section is its own path, which may continue into the section (`/preferences/hotkeys`). */
const normalizeSectionId = (value: string): LaunchpadSectionId | null => {
- const id = value.replace(/^\/+/, '');
+ const id = value.replace(/^\/+/, '').split('/')[0] ?? '';
if (id === '') {
return 'home';
@@ -49,11 +58,15 @@ const normalizeSectionId = (value: string): LaunchpadSectionId | null => {
return isSectionId(id) ? id : null;
};
-const SECTION_PATHS: Record<LaunchpadSectionId, '/' | '/projects' | '/models' | '/nodes' | '/users' | '/fonts'> = {
+const SECTION_PATHS: Record<
+ LaunchpadSectionId,
+ '/' | '/projects' | '/models' | '/nodes' | '/users' | '/fonts' | '/preferences'
+> = {
fonts: '/fonts',
home: '/',
models: '/models',
nodes: '/nodes',
+ preferences: '/preferences',
projects: '/projects',
users: '/users',
};
@@ -75,14 +88,21 @@ const getActiveSectionId = (
? requestedSectionId
: DEFAULT_SECTION_ID;
-const manageIntermediatesOf = (userId: string, label: string): void => {
- requestIntermediatesFocus({ ownerId: userId, ownerLabel: label });
- openWorkbenchSettings('intermediates');
-};
-
export const Launchpad = () => {
const { canManageModels, canManageNodes, canManageUsers } = useCapabilities();
const { t } = useTranslation();
+ const navigate = useNavigate();
+ const manageIntermediatesOf = useCallback(
+ (userId: string, label: string) => {
+ requestIntermediatesFocus({ ownerId: userId, ownerLabel: label });
+ void navigate({
+ params: { section: 'intermediates' },
+ search: { setting: INTERMEDIATES_SETTING_ID },
+ to: '/preferences/$section',
+ });
+ },
+ [navigate]
+ );
const filtered = useMemo<LaunchpadSection[]>(
() =>
@@ -133,9 +153,16 @@ export const Launchpad = () => {
label: t('launchpad.sections.users'),
render: () => <UsersPage onManageIntermediates={manageIntermediatesOf} />,
},
+ {
+ group: 'footer',
+ icon: SettingsIcon,
+ id: 'preferences',
+ label: t('launchpad.sections.preferences'),
+ render: () => <PreferencesPage />,
+ },
] satisfies (LaunchpadSection & { condition?: boolean })[]
).filter((section) => section.condition ?? true),
- [canManageModels, canManageNodes, canManageUsers, t]
+ [canManageModels, canManageNodes, canManageUsers, manageIntermediatesOf, t]
);
return (
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadNav.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadNav.tsx
index ba287d4ace..9d1a5e4955 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadNav.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadNav.tsx
@@ -1,7 +1,7 @@
import type { SystemStyleObject } from '@chakra-ui/react';
import type { LucideIcon } from 'lucide-react';
-import { Box, Icon, Stack, Text } from '@chakra-ui/react';
+import { Icon, Stack, Text } from '@chakra-ui/react';
import { Button } from '@platform/ui/Button';
import { Link } from '@tanstack/react-router';
import { useId, useMemo } from 'react';
@@ -18,11 +18,11 @@ const NAV_HEIGHT = { base: 'auto', md: 'full' } as const;
const FOOTER_MARGIN_TOP = { md: 'auto' } as const;
/**
- * Sections are routes, so the rail is route links in visual order: Workspace, the open projects, then Manage.
- * Tab and reading order follow what the rail shows.
+ * Sections are routes, so the rail is route links in visual order: Workspace, the open projects, Manage, then the
+ * footer (Preferences). Tab and reading order follow what the rail shows.
*/
-export type LaunchpadNavGroupId = 'workspace' | 'manage';
+export type LaunchpadNavGroupId = 'workspace' | 'manage' | 'footer';
export interface LaunchpadNavItem {
id: string;
@@ -32,7 +32,7 @@ export interface LaunchpadNavItem {
to: string;
}
-const GROUP_LABEL_KEY: Record<LaunchpadNavGroupId, string> = {
+const GROUP_LABEL_KEY: Record<Exclude<LaunchpadNavGroupId, 'footer'>, string> = {
manage: 'launchpad.groups.manage',
workspace: 'launchpad.groups.workspace',
};
@@ -54,6 +54,20 @@ const NAV_SX: SystemStyleObject = { '& > section ~ section': { pt: '2' } };
/** Rail entries match the settings dialog's navigation items: ghost buttons, subtle for the current page. */
const NAV_ITEM_PROPS = { justifyContent: 'start', size: 'sm', w: 'full' } as const;
+const NavLink = ({ isActive, item }: { isActive: boolean; item: LaunchpadNavItem }) => (
+ <Button
+ asChild
+ {...NAV_ITEM_PROPS}
+ aria-current={isActive ? 'page' : undefined}
+ variant={isActive ? 'subtle' : 'ghost'}
+ >
+ <Link to={item.to}>
+ <Icon as={item.icon} boxSize="3.5" flexShrink={0} />
+ <Text truncate>{item.label}</Text>
+ </Link>
+ </Button>
+);
+
const NavGroup = ({
activeId,
group,
@@ -61,7 +75,7 @@ const NavGroup = ({
showLabel,
}: {
activeId: string;
- group: LaunchpadNavGroupId;
+ group: Exclude<LaunchpadNavGroupId, 'footer'>;
items: LaunchpadNavItem[];
showLabel: boolean;
}) => {
@@ -76,18 +90,7 @@ const NavGroup = ({
</Text>
) : null}
{items.map((item) => (
- <Button
- key={item.id}
- asChild
- {...NAV_ITEM_PROPS}
- aria-current={item.id === activeId ? 'page' : undefined}
- variant={item.id === activeId ? 'subtle' : 'ghost'}
- >
- <Link to={item.to}>
- <Icon as={item.icon} boxSize="3.5" flexShrink={0} />
- <Text truncate>{item.label}</Text>
- </Link>
- </Button>
+ <NavLink key={item.id} isActive={item.id === activeId} item={item} />
))}
</Stack>
);
@@ -97,6 +100,7 @@ export const LaunchpadNav = ({ activeId, items }: { activeId: string; items: Lau
const { t } = useTranslation();
const workspaceItems = useMemo(() => items.filter((item) => item.group === 'workspace'), [items]);
const manageItems = useMemo(() => items.filter((item) => item.group === 'manage'), [items]);
+ const footerItems = useMemo(() => items.filter((item) => item.group === 'footer'), [items]);
// Show headings only when multiple groups need distinguishing.
const showGroupLabels = workspaceItems.length > 0 && manageItems.length > 0;
@@ -123,9 +127,12 @@ export const LaunchpadNav = ({ activeId, items }: { activeId: string; items: Lau
<NavGroup activeId={activeId} group="manage" items={manageItems} showLabel={showGroupLabels} />
) : null}
- <Box mt={FOOTER_MARGIN_TOP} pt="2">
+ <Stack gap="0.5" mt={FOOTER_MARGIN_TOP} pt="2">
+ {footerItems.map((item) => (
+ <NavLink key={item.id} isActive={item.id === activeId} item={item} />
+ ))}
<HelpMenu />
- </Box>
+ </Stack>
</Stack>
);
};
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx
index ad989a85e5..b1ba40875d 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx
@@ -5,7 +5,6 @@ import { AccountMenu } from '@features/identity';
import { useConnectionStatusSelector } from '@platform/transport/connectionStore';
import { InvokeMark } from '@platform/ui/InvokeMark';
import { PaletteButton } from '@workbench/palette/PaletteButton';
-import { SettingsButton } from '@workbench/settings/SettingsButton';
import { useTranslation } from 'react-i18next';
const CONNECTION_LABEL_KEY: Record<Exclude<BackendConnectionStatus, 'connected'>, string> = {
@@ -64,7 +63,6 @@ export const LaunchpadTopBar = () => (
<ConnectionChip />
<HStack gap="0.5">
<PaletteButton />
- <SettingsButton />
<AccountMenu />
</HStack>
</HStack>
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.browser.test.tsx
index 899be5f0e2..7dcd15fee6 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.browser.test.tsx
@@ -22,7 +22,10 @@ vi.mock('react-i18next', () => ({
useTranslation: () => ({ t: (key: string) => key }),
}));
+const navigate = vi.hoisted(() => vi.fn());
+
vi.mock('@tanstack/react-router', () => ({
+ useNavigate: () => navigate,
Link: ({ children, ...props }: { children?: unknown } & Record<string, unknown>) => (
<a href="/app" {...props}>
{children as never}
@@ -142,6 +145,34 @@ describe('ProjectActionsMenuHost', () => {
});
});
+ it('opens the Preferences intermediates section focused on the project', async () => {
+ const { peekIntermediatesFocus } = await import('@features/intermediates/data/focus');
+ host = document.createElement('div');
+ document.body.append(host);
+ root = createRoot(host);
+ await act(() =>
+ root?.render(
+ <ChakraProvider value={system}>
+ <ProjectActionsMenuProvider>
+ <Card id="one" />
+ </ProjectActionsMenuProvider>
+ </ChakraProvider>
+ )
+ );
+ await act(() => userEvent.click(dotsButton('one')));
+ const item = document.querySelector<HTMLElement>('[role="menuitem"][data-value="intermediates"]')!;
+ await act(() => userEvent.click(item));
+
+ expect(peekIntermediatesFocus()).toEqual({ projectId: 'one' });
+ // Revealing the manager's entry puts focus in it on the page.
+ expect(navigate).toHaveBeenCalledWith({
+ params: { section: 'intermediates' },
+ search: { setting: 'intermediatesManager' },
+ to: '/preferences/$section',
+ });
+ await vi.waitFor(() => expect(openMenus()).toHaveLength(0));
+ });
+
it('moves the one menu across cards instead of racing sibling layers', async () => {
// A single host prevents Zag from treating the next card's menu as nested under the still-closing previous
// menu.
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.tsx
index f3dff57a00..72271b522a 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectActionsMenuHost.tsx
@@ -2,11 +2,11 @@ import type { ProjectSummary } from '@workbench/projects/library';
import type { MouseEvent, ReactNode } from 'react';
import { Menu, Portal } from '@chakra-ui/react';
-import { requestIntermediatesFocus } from '@features/intermediates';
+import { INTERMEDIATES_SETTING_ID, requestIntermediatesFocus } from '@features/intermediates';
import { ConfirmDialog } from '@platform/ui/ConfirmDialog';
import { RenameDialog } from '@platform/ui/RenameDialog';
+import { useNavigate } from '@tanstack/react-router';
import { isProjectSummaryCompatible } from '@workbench/projects/library';
-import { openWorkbenchSettings } from '@workbench/settings/settingsDialogStore';
import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -175,6 +175,7 @@ const HostedProjectActionsMenu = ({
onRequestDialog: (dialog: DialogRequest) => void;
}) => {
const actions = useProjectCardActions(request.summary);
+ const navigate = useNavigate();
const isCompatible = isProjectSummaryCompatible(request.summary);
const projectSearch = useMemo(() => ({ project: request.summary.id }), [request.summary.id]);
const positioning = useMemo(() => {
@@ -210,11 +211,15 @@ const HostedProjectActionsMenu = ({
[actions, onRequestDialog, request.summary.name]
);
const handleDeleteIntermediates = useCallback(() => {
- // The manager lives in Settings; it reads this intent once when its section mounts.
+ // The manager lives in Preferences; it reads this intent when it starts.
requestIntermediatesFocus({ projectId: request.summary.id });
- openWorkbenchSettings('intermediates', request.returnFocus ?? undefined);
onClose();
- }, [onClose, request.returnFocus, request.summary.id]);
+ void navigate({
+ params: { section: 'intermediates' },
+ search: { setting: INTERMEDIATES_SETTING_ID },
+ to: '/preferences/$section',
+ });
+ }, [navigate, onClose, request.summary.id]);
const handleDelete = useCallback(
() => onRequestDialog({ actions, kind: 'delete', name: request.summary.name }),
[actions, onRequestDialog, request.summary.name]
diff --git a/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx b/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx
index 962fda1aa7..74093bab12 100644
--- a/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx
+++ b/invokeai/frontend/webv2/src/workbench/palette/LaunchpadCommandPaletteDialog.tsx
@@ -2,7 +2,7 @@ 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';
+import { useAvailableSettings } from '@workbench/settings/useAvailableSettings';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -27,6 +27,22 @@ const LaunchpadCommandPaletteDialog = ({
const navigate = useNavigate();
const search = useSearch({ strict: false }) as { project?: string };
const { canManageModels, canManageNodes, canManageUsers } = useCapabilities();
+ const settingsSections = useAvailableSettings();
+ // Launchpad settings are a page, not the editor's dialog.
+ const launchpadSettingsDeps = useMemo<SettingsEntryDeps>(
+ () => ({
+ ...settingsEntryDeps,
+ openSettingsSection: (destination) => {
+ const { entryId, sectionId } = typeof destination === 'string' ? { sectionId: destination } : destination;
+ void navigate({
+ params: { section: sectionId },
+ search: entryId ? { setting: entryId } : {},
+ to: '/preferences/$section',
+ });
+ },
+ }),
+ [navigate, settingsEntryDeps]
+ );
const entries = useMemo<PaletteEntry[]>(() => {
const navEntry = ({ id, keywords, run }: { id: string; keywords?: string; run: () => void }): PaletteEntry => ({
@@ -50,11 +66,21 @@ const LaunchpadCommandPaletteDialog = ({
...(canManageModels ? [navEntry({ id: 'goToModels', run: () => void navigate({ to: '/models' }) })] : []),
...(canManageNodes ? [navEntry({ id: 'goToNodes', run: () => void navigate({ to: '/nodes' }) })] : []),
...(canManageUsers ? [navEntry({ id: 'goToUsers', run: () => void navigate({ to: '/users' }) })] : []),
- buildOpenSettingsEntry(t, () => openWorkbenchSettings()),
+ buildOpenSettingsEntry(t, () => void navigate({ to: '/preferences' })),
];
- return [...navigation, ...buildSettingsEntries(preferences, settingsEntryDeps, t)];
- }, [canManageModels, canManageNodes, canManageUsers, navigate, preferences, search.project, settingsEntryDeps, t]);
+ return [...navigation, ...buildSettingsEntries(preferences, launchpadSettingsDeps, t, settingsSections)];
+ }, [
+ canManageModels,
+ canManageNodes,
+ canManageUsers,
+ launchpadSettingsDeps,
+ navigate,
+ preferences,
+ search.project,
+ settingsSections,
+ t,
+ ]);
return <CommandPaletteDialog entries={entries} isOpen modifierKeyLabel={modifierKeyLabel} onClose={onClose} />;
};
diff --git a/invokeai/frontend/webv2/src/workbench/settings/PreferencesPage.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/settings/PreferencesPage.browser.test.tsx
new file mode 100644
index 0000000000..9b1dbe1006
--- /dev/null
+++ b/invokeai/frontend/webv2/src/workbench/settings/PreferencesPage.browser.test.tsx
@@ -0,0 +1,220 @@
+/* oxlint-disable react-perf/jsx-no-new-object-as-prop, react-perf/jsx-no-new-function-as-prop */
+import type { SettingFieldProps } from '@platform/ui/settings/contracts';
+import type * as projectsApi from '@workbench/projects/api';
+
+import { ChakraProvider } from '@chakra-ui/react';
+import { accountLifecycle } from '@platform/state/accountLifecycle';
+import {
+ createMemoryHistory,
+ createRootRoute,
+ createRoute,
+ createRouter,
+ Outlet,
+ RouterProvider,
+} from '@tanstack/react-router';
+import { system } from '@theme/system';
+import { createInstance } from 'i18next';
+import { act } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { I18nextProvider, initReactI18next } from 'react-i18next';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { page, userEvent } from 'vitest/browser';
+
+import { PreferencesPage } from './PreferencesPage';
+import { DEFAULT_PREFERENCES, getWorkbenchPreferences, patchWorkbenchPreferences } from './store';
+
+vi.mock('@workbench/projects/api', async (importOriginal) => ({
+ ...(await importOriginal<typeof projectsApi>()),
+ setClientStateValue: async () => {},
+}));
+
+vi.mock('./CustomSettingsEditors', () => ({
+ default: ({ field }: SettingFieldProps) => <div data-custom-editor={field.id}>Custom settings editor</div>,
+}));
+
+const translations = await fetch('/locales/en.json').then((response) => response.json());
+const i18n = createInstance();
+await i18n.use(initReactI18next).init({
+ lng: 'en',
+ fallbackLng: 'en',
+ resources: { en: { translation: translations } },
+ interpolation: { escapeValue: false },
+});
+
+(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
+
+let host: HTMLDivElement;
+let root: Root;
+
+const validateSearch = (search: Record<string, unknown>): { setting?: string } => ({
+ setting: typeof search.setting === 'string' && search.setting.length > 0 ? search.setting : undefined,
+});
+
+/** Like the Launchpad, the page stays mounted while another section's route is showing. */
+const createTestRouter = (path: string) => {
+ const rootRoute = createRootRoute({
+ component: () => (
+ <>
+ <PreferencesPage />
+ <Outlet />
+ </>
+ ),
+ });
+ return createRouter({
+ history: createMemoryHistory({ initialEntries: [path] }),
+ routeTree: rootRoute.addChildren([
+ createRoute({ getParentRoute: () => rootRoute, path: 'preferences', validateSearch }),
+ createRoute({ getParentRoute: () => rootRoute, path: 'preferences/$section', validateSearch }),
+ createRoute({ getParentRoute: () => rootRoute, path: 'fonts' }),
+ ]),
+ });
+};
+
+const render = async (path: string) => {
+ const router = createTestRouter(path);
+ await act(async () => {
+ root.render(
+ <ChakraProvider value={system}>
+ <I18nextProvider i18n={i18n}>
+ <RouterProvider router={router} />
+ </I18nextProvider>
+ </ChakraProvider>
+ );
+ await router.load();
+ });
+ return router;
+};
+
+const search = () => page.getByRole('textbox', { name: i18n.t('settingsDialog.search'), exact: true });
+const sectionItem = (name: string) => page.getByRole('button', { name, exact: true });
+const detailHeading = (name: string) => page.getByRole('heading', { level: 2, name, exact: true });
+
+beforeEach(async () => {
+ await page.viewport(1280, 900);
+ accountLifecycle.activate('preferences-test');
+ await patchWorkbenchPreferences(DEFAULT_PREFERENCES);
+ host = document.createElement('div');
+ host.style.height = '800px';
+ document.body.append(host);
+ root = createRoot(host);
+});
+
+afterEach(async () => {
+ await act(() => root?.unmount());
+ host?.remove();
+ accountLifecycle.invalidate();
+});
+
+describe('Launchpad preferences page', () => {
+ it('lists only settings that need no open project and follows the route', async () => {
+ const router = await render('/preferences/behavior');
+
+ await expect.element(detailHeading('Behavior')).toBeVisible();
+ await expect.element(sectionItem('Behavior')).toHaveAttribute('aria-current', 'true');
+ for (const name of ['Appearance', 'Keyboard shortcuts', 'Gallery', 'Workflow', 'Queue', 'Developer']) {
+ await expect.element(sectionItem(name)).toBeInTheDocument();
+ }
+ // Project, and widget sections with no preference entries, need a project; Server needs admin rights.
+ for (const name of ['Project', 'Preview', 'Canvas', 'Server']) {
+ await expect.element(sectionItem(name)).not.toBeInTheDocument();
+ }
+
+ await act(() => sectionItem('Appearance').click());
+ await expect.poll(() => router.state.location.pathname).toBe('/preferences/appearance');
+ await expect.element(detailHeading('Appearance')).toBeVisible();
+ });
+
+ it('edits a preference through the shared settings store', async () => {
+ await render('/preferences/appearance');
+
+ await act(() => page.getByText('Reduce motion', { exact: true }).click());
+ await expect.poll(() => getWorkbenchPreferences().reduceMotion).toBe(true);
+ });
+
+ it('narrows sections while searching and reveals a result in its section', async () => {
+ const router = await render('/preferences/appearance');
+
+ await act(() => search().fill('numeric attention'));
+ await expect.element(detailHeading(i18n.t('settingsDialog.results'))).toBeVisible();
+ await expect.element(sectionItem('Appearance')).not.toBeInTheDocument();
+ // One match overall, in Behavior.
+ await expect
+ .element(page.getByRole('listitem').filter({ hasText: i18n.t('settingsDialog.allResults') }))
+ .toHaveTextContent(`${i18n.t('settingsDialog.allResults')}1`);
+ await expect.element(page.getByRole('listitem').filter({ hasText: 'Behavior' })).toHaveTextContent('Behavior1');
+ await expect.element(page.getByText('Prefer numeric attention style', { exact: true })).toBeVisible();
+
+ await act(() => page.getByRole('button', { name: i18n.t('settingsDialog.showInSection'), exact: true }).click());
+ await expect.element(search()).toHaveValue('');
+ await expect.element(detailHeading('Behavior')).toBeVisible();
+ await expect
+ .element(page.getByRole('checkbox', { name: 'Prefer numeric attention style', exact: true }))
+ .toHaveFocus();
+ // The reveal request is spent once the entry has focus.
+ await expect.poll(() => router.state.location.href).toBe('/preferences/behavior');
+
+ await act(() => search().fill('no such setting'));
+ await act(() =>
+ page
+ .getByRole('button', { name: i18n.t('settingsDialog.clearSearch'), exact: true })
+ .last()
+ .click()
+ );
+ await expect.element(search()).toHaveValue('');
+ await expect.element(detailHeading('Behavior')).toBeVisible();
+ });
+
+ it('replaces a search left behind when another page asks for a setting', async () => {
+ const router = await render('/preferences/appearance');
+ await act(() => search().fill('motion'));
+ await expect.element(detailHeading(i18n.t('settingsDialog.results'))).toBeVisible();
+
+ // The palette and other Launchpad pages link straight to a setting while this page stays mounted.
+ await act(() => router.navigate({ to: '/fonts' }));
+ await act(() =>
+ router.navigate({
+ params: { section: 'behavior' },
+ search: { setting: 'preferNumericAttentionStyle' },
+ to: '/preferences/$section',
+ })
+ );
+ await expect.element(search()).toHaveValue('');
+ await expect.element(detailHeading('Behavior')).toBeVisible();
+ await expect
+ .element(page.getByRole('checkbox', { name: 'Prefer numeric attention style', exact: true }))
+ .toHaveFocus();
+ await expect.poll(() => router.state.location.href).toBe('/preferences/behavior');
+ });
+
+ it('keeps a search when the rail link returns to the page', async () => {
+ const router = await render('/preferences/appearance');
+ await act(() => search().fill('motion'));
+ await act(() => router.navigate({ to: '/fonts' }));
+ await act(() => router.navigate({ to: '/preferences' }));
+ await expect.element(search()).toHaveValue('motion');
+ await expect.element(detailHeading(i18n.t('settingsDialog.results'))).toBeVisible();
+ });
+
+ it('jumps to search on `/` unless a field is being typed in', async () => {
+ await render('/preferences/appearance');
+
+ await act(() => sectionItem('Behavior').click());
+ await expect.element(sectionItem('Behavior')).toHaveFocus();
+ await userEvent.keyboard('/');
+ await expect.element(search()).toHaveFocus();
+ await userEvent.keyboard('/');
+ await expect.element(search()).toHaveValue('/');
+ });
+
+ it('returns to the last section from the bare route and corrects unknown sections', async () => {
+ const router = await render('/preferences/hotkeys');
+
+ await expect.element(detailHeading('Keyboard shortcuts')).toBeVisible();
+ await act(() => router.navigate({ to: '/fonts' }));
+ await act(() => router.navigate({ to: '/preferences' }));
+ await expect.element(detailHeading('Keyboard shortcuts')).toBeVisible();
+
+ await act(() => router.navigate({ params: { section: 'project' }, to: '/preferences/$section' }));
+ await expect.poll(() => router.state.location.pathname).toBe('/preferences/hotkeys');
+ });
+});
diff --git a/invokeai/frontend/webv2/src/workbench/settings/PreferencesPage.tsx b/invokeai/frontend/webv2/src/workbench/settings/PreferencesPage.tsx
new file mode 100644
index 0000000000..f9bdd19a83
--- /dev/null
+++ b/invokeai/frontend/webv2/src/workbench/settings/PreferencesPage.tsx
@@ -0,0 +1,180 @@
+/* eslint-disable react-perf/jsx-no-jsx-as-prop, react-perf/jsx-no-new-array-as-prop, react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-object-as-prop */
+import type { ListRowProps } from '@platform/ui/list/List';
+
+import { Box, Flex, HStack, Icon, Text } from '@chakra-ui/react';
+import { List } from '@platform/ui/list/List';
+import { ListItem } from '@platform/ui/list/ListItem';
+import { listRowsFromSections, type ListRow } from '@platform/ui/list/listRows';
+import { ManagerColumn, ManagerDetailHeader } from '@platform/ui/ManagerLayout';
+import { resolveSettingsText } from '@platform/ui/settings/contracts';
+import { Navigate, useNavigate, useParams, useSearch } from '@tanstack/react-router';
+import { SearchIcon } from 'lucide-react';
+import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import type { SettingsSection } from './catalog';
+
+import { browseSettings } from './catalog';
+import { SettingsBrowseBody, SettingsSearchField } from './SettingsBrowseBody';
+import { focusSettingsSearchOnSlash } from './settingsSearchShortcut';
+import { useAvailableSettings } from './useAvailableSettings';
+
+const GROUPS = ['application', 'project', 'widgets', 'system'] as const;
+const ALL_RESULTS_KEY = 'all-results';
+
+type ListEntry = { kind: 'all' } | { kind: 'section'; section: SettingsSection };
+
+/**
+ * Launchpad preferences: the settings that need no open project, in the managers' list/detail layout. The
+ * section lives in the route; the query stays in the page, which the Launchpad keeps mounted between visits.
+ */
+export const PreferencesPage = () => {
+ const { t } = useTranslation();
+ const navigate = useNavigate();
+ // Undefined on bare `/preferences` and on the other Launchpad pages this stays mounted behind.
+ const requestedId = useParams({ select: (params: { section?: string }) => params.section, strict: false }) ?? null;
+ const revealEntryId = useSearch({ select: (search: { setting?: string }) => search.setting, strict: false });
+ const [query, setQuery] = useState('');
+ const [searchSection, setSearchSection] = useState<string | null>(null);
+ const [lastSectionId, setLastSectionId] = useState<string | null>(null);
+ const [lastRequest, setLastRequest] = useState({ requestedId, revealEntryId });
+ const sections = useAvailableSettings();
+ const isKnownRequest = requestedId !== null && sections.some((section) => section.id === requestedId);
+
+ // Bare `/preferences` (the rail link) returns to the section last shown.
+ if (isKnownRequest && requestedId !== lastSectionId) {
+ setLastSectionId(requestedId);
+ }
+ // A section or setting requested from elsewhere (an entry point, the palette) replaces a search left behind.
+ if (lastRequest.requestedId !== requestedId || lastRequest.revealEntryId !== revealEntryId) {
+ setLastRequest({ requestedId, revealEntryId });
+ if (
+ (requestedId !== null && requestedId !== lastRequest.requestedId) ||
+ (revealEntryId !== undefined && revealEntryId !== lastRequest.revealEntryId)
+ ) {
+ setQuery('');
+ setSearchSection(null);
+ }
+ }
+
+ const { active, count, displayed, matches, searching } = browseSettings(
+ sections,
+ { activeId: (isKnownRequest ? requestedId : lastSectionId) ?? '', query, searchSection },
+ t
+ );
+
+ const changeQuery = (next: string) => {
+ setQuery(next);
+ setSearchSection(null);
+ };
+ const clearSearch = () => changeQuery('');
+ const openSection = (sectionId: string, entryId?: string) => {
+ void navigate({
+ params: { section: sectionId },
+ search: entryId ? { setting: entryId } : {},
+ to: '/preferences/$section',
+ });
+ };
+ const reveal = (sectionId: string, entryId?: string) => {
+ changeQuery('');
+ openSection(sectionId, entryId);
+ };
+ const clearRevealedEntry = () => {
+ void navigate({ params: { section: active.id }, replace: true, search: {}, to: '/preferences/$section' });
+ };
+
+ const sectionRows = listRowsFromSections<ListEntry>(
+ GROUPS.map((group) => ({
+ items: matches
+ .filter((section) => section.group === group)
+ .map((section) => ({ kind: 'section', section }) as const),
+ key: group,
+ label: t(`settingsDialog.groups.${group}`),
+ })),
+ (entry) => (entry.kind === 'all' ? ALL_RESULTS_KEY : entry.section.id)
+ ).map((row) =>
+ // While searching, group headers count matching settings like the rows do, not sections.
+ searching && row.kind === 'header'
+ ? {
+ ...row,
+ count: matches
+ .filter((section) => `header:${section.group}` === row.key)
+ .reduce((total, section) => total + section.entries.length, 0),
+ }
+ : row
+ );
+ // While searching, "All results" leads the list on its own, above the grouped sections.
+ const rows: ListRow<ListEntry>[] = searching
+ ? [{ item: { kind: 'all' }, key: ALL_RESULTS_KEY, kind: 'item' }, ...sectionRows]
+ : sectionRows;
+
+ const renderItem = (entry: ListEntry, rowProps: ListRowProps) =>
+ entry.kind === 'all' ? (
+ <ListItem
+ {...rowProps}
+ leading={<Icon as={SearchIcon} boxSize="3.5" />}
+ title={t('settingsDialog.allResults')}
+ titleTruncate="end"
+ trailing={String(count)}
+ onPress={() => setSearchSection(null)}
+ />
+ ) : (
+ <ListItem
+ {...rowProps}
+ leading={<Icon as={entry.section.icon} boxSize="3.5" />}
+ title={resolveSettingsText(entry.section.label, t)}
+ titleTruncate="end"
+ trailing={searching ? String(entry.section.entries.length) : undefined}
+ onPress={() => (searching ? setSearchSection(entry.section.id) : openSection(entry.section.id))}
+ />
+ );
+
+ if (requestedId !== null && !isKnownRequest) {
+ return <Navigate params={{ section: active.id }} replace to="/preferences/$section" />;
+ }
+
+ return (
+ <Flex
+ aria-label={t('launchpad.sections.preferences')}
+ role="region"
+ h="full"
+ minH="0"
+ w="full"
+ onKeyDown={focusSettingsSearchOnSlash}
+ >
+ <ManagerColumn title={t('launchpad.sections.preferences')}>
+ <Box p="3">
+ <SettingsSearchField size="xs" value={query} onChange={changeQuery} />
+ </Box>
+ <List
+ activeKey={searching ? (searchSection ?? ALL_RESULTS_KEY) : active.id}
+ density="compact"
+ label={t('settingsDialog.section')}
+ renderItem={renderItem}
+ rows={rows}
+ status="ready"
+ />
+ </ManagerColumn>
+ <Flex direction="column" flex="1" minH="0" minW="0">
+ <ManagerDetailHeader>
+ <HStack alignSelf="stretch" gap="2" px="1">
+ <Icon as={searching ? SearchIcon : active.icon} boxSize="4" />
+ <Text as="h2" fontSize="sm" fontWeight="700">
+ {searching ? t('settingsDialog.results') : resolveSettingsText(active.label, t)}
+ </Text>
+ </HStack>
+ </ManagerDetailHeader>
+ <SettingsBrowseBody
+ count={count}
+ displayed={displayed}
+ revealEntryId={revealEntryId}
+ searching={searching}
+ viewKey={searching ? `search:${searchSection ?? ''}` : active.id}
+ onClearSearch={clearSearch}
+ onReveal={reveal}
+ onRevealed={clearRevealedEntry}
+ />
+ </Flex>
+ </Flex>
+ );
+};
diff --git a/invokeai/frontend/webv2/src/workbench/settings/SettingsButton.tsx b/invokeai/frontend/webv2/src/workbench/settings/SettingsButton.tsx
deleted file mode 100644
index 209544ed5b..0000000000
--- a/invokeai/frontend/webv2/src/workbench/settings/SettingsButton.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { IconButton } from '@platform/ui/Button';
-import { Tooltip } from '@platform/ui/Tooltip';
-import { SettingsIcon } from 'lucide-react';
-
-import { SettingsDialogHost } from './SettingsDialogHost';
-import { openWorkbenchSettings } from './settingsDialogStore';
-
-const handleOpen = () => openWorkbenchSettings();
-
-/**
- * Launchpad settings entry; the workbench opens settings from its app menu and hosts {@link SettingsDialogHost}
- * separately.
- */
-export const SettingsButton = () => {
- return (
- <>
- <Tooltip content="Settings">
- <IconButton aria-label="Settings" size="sm" variant="ghost" onClick={handleOpen}>
- <SettingsIcon />
- </IconButton>
- </Tooltip>
- <SettingsDialogHost />
- </>
- );
-};
diff --git a/invokeai/frontend/webv2/src/workbench/settings/index.ts b/invokeai/frontend/webv2/src/workbench/settings/index.ts
index 04286b5f18..b8dc9e9a28 100644
--- a/invokeai/frontend/webv2/src/workbench/settings/index.ts
+++ b/invokeai/frontend/webv2/src/workbench/settings/index.ts
@@ -1,4 +1,3 @@
// Keep the dialog body out of this barrel to preserve lazy loading.
-export * from './SettingsButton';
export * from './settingsDialogStore';
export * from './store';
diff --git a/invokeai/frontend/webv2/src/workbench/settings/launchpad.tsx b/invokeai/frontend/webv2/src/workbench/settings/launchpad.tsx
new file mode 100644
index 0000000000..bab5ab739b
--- /dev/null
+++ b/invokeai/frontend/webv2/src/workbench/settings/launchpad.tsx
@@ -0,0 +1,19 @@
+import { Center, Spinner } from '@chakra-ui/react';
+import { lazy, Suspense } from 'react';
+
+/** Launchpad entry kept separate so the settings catalog and editors load only when the page opens. */
+const LazyPreferencesPage = lazy(() =>
+ import('./PreferencesPage').then((module) => ({ default: module.PreferencesPage }))
+);
+
+const FALLBACK = (
+ <Center h="full">
+ <Spinner color="fg.muted" size="sm" />
+ </Center>
+);
+
+export const PreferencesPage = () => (
+ <Suspense fallback={FALLBACK}>
+ <LazyPreferencesPage />
+ </Suspense>
+);
diff --git a/invokeai/frontend/webv2/vite.config.mts b/invokeai/frontend/webv2/vite.config.mts
index 356de22051..b50b13b02f 100644
--- a/invokeai/frontend/webv2/vite.config.mts
+++ b/invokeai/frontend/webv2/vite.config.mts
@@ -20,6 +20,8 @@ const PROJECT_ROOT = fileURLToPath(new URL('.', import.meta.url));
// Group eager dependencies shared by both routes to avoid extra chunk requests.
const ROUTE_SHARED_MODULES = [
'/features/fonts/data/keys.ts',
+ // Launchpad entry points and the intermediates settings metadata both read it.
+ '/features/intermediates/data/focus.ts',
'/features/fonts/launchpad.tsx',
'/features/fonts/react.tsx',
'/features/fonts/runtime.ts',
@@ -55,6 +57,8 @@ const ROUTE_SHARED_MODULES = [
'/platform/ui/useScrollAreaPhantomHeal.ts',
'/platform/ui/theme/applyTheme.ts',
'/workbench/components/WorkbenchSplashScreen.tsx',
+ // The splash screen's image URL module; left ungrouped it can split into its own startup chunk.
+ '/assets/SplashImage.webp',
'/workbench/hotkeys/catalog.ts',
'/workbench/hotkeys/modalLayer.ts',
'/workbench/launchpad/formatRelativeTime.ts',
@@ -73,6 +77,8 @@ const ROUTE_SHARED_MODULES = [
'/workbench/projects/projectFileToasts.ts',
'/workbench/projects/useProjectFileActions.ts',
'/workbench/settings/SettingsDialogHost.tsx',
+ '/workbench/settings/launchpad.tsx',
+ '/workbench/settings/settingsSearchShortcut.ts',
] as const;
// Group dependencies shared by the editor shell and lazy widgets to reduce boot requests.
@@ -137,11 +143,14 @@ const WORKFLOW_CORE_MODULES = [
// Keep widget metadata separate so Launchpad settings cannot import editor boot UI.
const WIDGET_METADATA_MODULES = [
'/features/gallery/settingsContribution.ts',
+ '/features/intermediates/settingsContribution.ts',
'/features/queue/widget.ts',
'/features/workflow/widget.ts',
'/workbench/settings/applicationContributions.ts',
'/workbench/settings/catalog.ts',
'/workbench/widgets/canvas/canvasSettings.ts',
+ // canvasSettings reads these keys; grouped elsewhere they can close an import cycle with the editor context.
+ '/workbench/widgets/canvas/invoke/canvasCompositing.ts',
'/workbench/widgets/canvas/settingsContribution.ts',
'/workbench/widgets/image-map/settingsContribution.ts',
'/workbench/widgets/layers/panes/editorPaneLayout.ts',