Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
feat(webv2): add opt-out for enqueue toasts
joshistoast5999937b3868
diff --git a/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsx b/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsxindex ae0bf9e447..fd4d1de878 100644--- a/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsx+++ b/invokeai/frontend/webv2/src/workbench/settings/SettingsDialog.tsx@@ -382,6 +382,7 @@ const BehaviorSection = () => {confirmImageDeletion,enableInformationalPopovers,enableModelDescriptions,+ notifyOnEnqueue,preferNumericAttentionStyle,showPromptSyntaxHighlighting,} = useWorkbenchPreferences();@@ -397,6 +398,9 @@ const BehaviorSection = () => {const updateEnableModelDescriptions = useCallback((checked: boolean) => {updatePreferences({ enableModelDescriptions: checked });}, []);+ const updateNotifyOnEnqueue = useCallback((checked: boolean) => {+ updatePreferences({ notifyOnEnqueue: checked });+ }, []);const updatePreferNumericAttentionStyle = useCallback((checked: boolean) => {updatePreferences({ preferNumericAttentionStyle: checked });}, []);@@ -430,6 +434,12 @@ const BehaviorSection = () => {label="Enable model descriptions in dropdowns"onChange={updateEnableModelDescriptions}/>+ <SettingToggle+ checked={notifyOnEnqueue}+ description="Show a toast each time an invocation is added to the queue."+ label="Notify when queued"+ onChange={updateNotifyOnEnqueue}+ /><SettingTogglechecked={preferNumericAttentionStyle}description="Prefer numeric prompt attention syntax when controls insert attention weights."diff --git a/invokeai/frontend/webv2/src/workbench/settings/contracts.ts b/invokeai/frontend/webv2/src/workbench/settings/contracts.tsindex a41f9ba2a1..da84d2a5b2 100644--- a/invokeai/frontend/webv2/src/workbench/settings/contracts.ts+++ b/invokeai/frontend/webv2/src/workbench/settings/contracts.ts@@ -53,6 +53,8 @@ export interface WorkbenchPreferences {language: WorkbenchLanguage;enableInformationalPopovers: boolean;enableModelDescriptions: boolean;+ /** Toast when an invocation is added to the queue. The notification center records it regardless. */+ notifyOnEnqueue: boolean;/** Write numeric attention weights (`(word)1.1`) when the attention hotkeys insert them. */preferNumericAttentionStyle: boolean;/** Experimental. Color prompt syntax in prompt fields; changes rendering only. */diff --git a/invokeai/frontend/webv2/src/workbench/settings/store.ts b/invokeai/frontend/webv2/src/workbench/settings/store.tsindex 1032b996ca..6b5725b40e 100644--- a/invokeai/frontend/webv2/src/workbench/settings/store.ts+++ b/invokeai/frontend/webv2/src/workbench/settings/store.ts@@ -68,6 +68,7 @@ export const DEFAULT_PREFERENCES: WorkbenchPreferences = {launchpadPinnedProjectIds: [],launchpadProjectsSort: 'edited',launchpadProjectsView: 'grid',+ notifyOnEnqueue: true,preferNumericAttentionStyle: false,queueJobsScope: 'all',reduceMotion: false,@@ -292,6 +293,10 @@ export const normalizeWorkbenchPreferences = (preferences?: WorkbenchPreferenceslaunchpadProjectsView: isProjectsViewId(preferences?.launchpadProjectsView)? preferences.launchpadProjectsView: DEFAULT_PREFERENCES.launchpadProjectsView,+ notifyOnEnqueue:+ typeof preferences?.notifyOnEnqueue === 'boolean'+ ? preferences.notifyOnEnqueue+ : DEFAULT_PREFERENCES.notifyOnEnqueue,preferNumericAttentionStyle:typeof preferences?.preferNumericAttentionStyle === 'boolean'? preferences.preferNumericAttentionStylediff --git a/invokeai/frontend/webv2/src/workbench/shell/notifications/WorkbenchNotificationToaster.tsx b/invokeai/frontend/webv2/src/workbench/shell/notifications/WorkbenchNotificationToaster.tsxindex 5b0bb91131..a48e9b5221 100644--- a/invokeai/frontend/webv2/src/workbench/shell/notifications/WorkbenchNotificationToaster.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/notifications/WorkbenchNotificationToaster.tsx@@ -1,9 +1,12 @@import type { WorkbenchNotificationKind } from '@workbench/projectContracts';import { toaster } from '@platform/ui';+import { useWorkbenchPreferenceSelector } from '@workbench/settings/store';import { useWorkbenchSelector } from '@workbench/WorkbenchContext';import { useEffect, useRef } from 'react';+import { shouldToastNotification } from './toastPolicy';+const notificationToastType: Record<WorkbenchNotificationKind, 'error' | 'info' | 'success'> = {error: 'error',info: 'info',@@ -12,6 +15,7 @@ const notificationToastType: Record<WorkbenchNotificationKind, 'error' | 'info'export const WorkbenchNotificationToaster = () => {const notifications = useWorkbenchSelector((snapshot) => snapshot.notifications);+ const notifyOnEnqueue = useWorkbenchPreferenceSelector((prefs) => prefs.notifyOnEnqueue);const toastedNotificationIdsRef = useRef<Set<string> | null>(null);useEffect(() => {@@ -26,6 +30,11 @@ export const WorkbenchNotificationToaster = () => {}toastedNotificationIdsRef.current.add(notification.id);++ if (!shouldToastNotification(notification, { notifyOnEnqueue })) {+ continue;+ }+queueMicrotask(() => {toaster.create({description: notification.message,@@ -34,7 +43,7 @@ export const WorkbenchNotificationToaster = () => {});});}- }, [notifications]);+ }, [notifications, notifyOnEnqueue]);return null;};diff --git a/invokeai/frontend/webv2/src/workbench/shell/notifications/toastPolicy.test.ts b/invokeai/frontend/webv2/src/workbench/shell/notifications/toastPolicy.test.tsnew file mode 100644index 0000000000..d1d4819deb--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/shell/notifications/toastPolicy.test.ts@@ -0,0 +1,28 @@+import type { WorkbenchNotification } from '@workbench/projectContracts';++import { describe, expect, it } from 'vitest';++import { shouldToastNotification } from './toastPolicy';++const note = (overrides: Partial<WorkbenchNotification>): WorkbenchNotification => ({+ createdAt: '2026-08-14T00:00:00.000Z',+ id: 'n-1',+ isRead: false,+ kind: 'success',+ title: 'Invocation queued',+ ...overrides,+});++describe('shouldToastNotification', () => {+ it('toasts enqueue notifications when the preference is on', () => {+ expect(shouldToastNotification(note({ category: 'enqueue' }), { notifyOnEnqueue: true })).toBe(true);+ });++ it('suppresses enqueue toasts when the preference is off', () => {+ expect(shouldToastNotification(note({ category: 'enqueue' }), { notifyOnEnqueue: false })).toBe(false);+ });++ it('always toasts uncategorized notifications', () => {+ expect(shouldToastNotification(note({ kind: 'error', title: 'Error' }), { notifyOnEnqueue: false })).toBe(true);+ });+});diff --git a/invokeai/frontend/webv2/src/workbench/shell/notifications/toastPolicy.ts b/invokeai/frontend/webv2/src/workbench/shell/notifications/toastPolicy.tsnew file mode 100644index 0000000000..0f77bfd0a8--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/shell/notifications/toastPolicy.ts@@ -0,0 +1,8 @@+import type { WorkbenchNotification } from '@workbench/projectContracts';+import type { WorkbenchPreferences } from '@workbench/settings/contracts';++/** Whether a recorded notification should also surface as a toast. */+export const shouldToastNotification = (+ notification: WorkbenchNotification,+ prefs: Pick<WorkbenchPreferences, 'notifyOnEnqueue'>+): boolean => (notification.category === 'enqueue' ? prefs.notifyOnEnqueue : true);