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
fix(webv2): give the workflow overflow menu the open-as menu's presentation
joshistoast91dbf3d54eea
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.jsonindex cd3860523a..0bbc5b4514 100644--- a/invokeai/frontend/webv2/public/locales/en.json+++ b/invokeai/frontend/webv2/public/locales/en.json@@ -2980,15 +2980,19 @@"deleteConfirmBody": "Delete \"{{name}}\" from the workflow library? This cannot be undone.","deleteConfirmTitle": "Delete workflow","deleteFailed": "Failed to delete workflow",+ "deleteHint": "Removes it from your library","downloadJson": "Download JSON",+ "downloadJsonHint": "For bug reports and sharing","duplicate": "Duplicate","duplicateFailed": "Failed to duplicate workflow",+ "duplicateHint": "Saves a copy under Yours, original untouched","duplicateName": "{{name}} copy","duplicated": "Saved a copy under Yours","empty": "No workflows match these filters.","fetching": "Fetching workflow…","findModel": "Find {{name}} in the model manager","forkIntoProject": "Fork into new project",+ "forkIntoProjectHint": "Copies it into a new project","installModels_one": "Install 1 model","installModels_other": "Install {{count}} models","installQueued": "Model installs queued",@@ -3004,6 +3008,7 @@"nodeCount_other": "{{count}} nodes","notRunYet": "Not run yet","open": "Open",+ "openHint": "Replaces the current workflow","previewGraph": "Preview graph","requirementInstallable": "Not installed","requirementInstalled": "Installed",diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.browser.test.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.browser.test.tsxindex 5b8dd93fcf..b7d1958726 100644--- a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.browser.test.tsx+++ b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.browser.test.tsx@@ -84,13 +84,17 @@ const TRANSLATIONS: Record<string, string> = {'workflowLibrary.deleteConfirmBody': 'Delete "{{name}}" from the workflow library? This cannot be undone.','workflowLibrary.deleteConfirmTitle': 'Delete workflow','workflowLibrary.deleteFailed': 'Failed to delete workflow',+ 'workflowLibrary.deleteHint': 'Removes it from your library','workflowLibrary.downloadJson': 'Download JSON',+ 'workflowLibrary.downloadJsonHint': 'For bug reports and sharing','workflowLibrary.duplicate': 'Duplicate','workflowLibrary.duplicateFailed': 'Failed to duplicate workflow',+ 'workflowLibrary.duplicateHint': 'Saves a copy under Yours, original untouched','workflowLibrary.duplicateName': '{{name}} copy','workflowLibrary.duplicated': 'Saved a copy under Yours','workflowLibrary.findModel': 'Find {{name}} in the model manager','workflowLibrary.forkIntoProject': 'Fork into new project',+ 'workflowLibrary.forkIntoProjectHint': 'Copies it into a new project','workflowLibrary.installModels_one': 'Install 1 model','workflowLibrary.installModels_other': 'Install {{count}} models','workflowLibrary.installQueued': 'Model installs queued',@@ -99,6 +103,7 @@ const TRANSLATIONS: Record<string, string> = {'workflowLibrary.moreActions': 'More actions','workflowLibrary.notRunYet': 'Not run yet','workflowLibrary.open': 'Open',+ 'workflowLibrary.openHint': 'Replaces the current workflow','workflowLibrary.previewGraph': 'Preview graph','workflowLibrary.requirementInstallable': 'Not installed','workflowLibrary.requirementInstalled': 'Installed',@@ -622,6 +627,12 @@ describe('WorkflowLibraryDetailPanel', () => {it('deletes only after the confirmation is accepted', async () => {await renderPanel(TEXT_TO_IMAGE);+ await openMenu();+ // The overflow menu carries the same second-line hints as the graph+ // preview's "Open as" menu — this is the one place that unification is+ // asserted, rather than duplicating it under every item.+ expect(menuItem('delete')?.textContent).toContain('Removes it from your library');+await clickMenuItem('delete');const confirm = document.querySelector<HTMLElement>('[role="alertdialog"]');diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.tsxindex f41d89045b..232e1ec6f0 100644--- a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.tsx+++ b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDetailPanel.tsx@@ -412,14 +412,16 @@ export const WorkflowLibraryDetailPanel = ({</Menu.Trigger><Portal><Menu.Positioner>- <MenuContent minW="12rem">+ <MenuContent minW="16rem"><MenuActionItem+ hint={t('workflowLibrary.openHint')}icon={WorkflowIcon}label={t('workflowLibrary.open')}value="open"onSelect={handleOpen}/><MenuActionItem+ hint={t('workflowLibrary.duplicateHint')}icon={CopyIcon}isDisabled={isDuplicatePending}label={t('workflowLibrary.duplicate')}@@ -427,12 +429,14 @@ export const WorkflowLibraryDetailPanel = ({onSelect={handleDuplicate}/><MenuActionItem+ hint={t('workflowLibrary.forkIntoProjectHint')}icon={GitForkIcon}label={t('workflowLibrary.forkIntoProject')}value="fork-into-project"onSelect={handleFork}/><MenuActionItem+ hint={t('workflowLibrary.downloadJsonHint')}icon={DownloadIcon}label={t('workflowLibrary.downloadJson')}value="download-json"@@ -441,6 +445,7 @@ export const WorkflowLibraryDetailPanel = ({{item.category === 'user' ? (// Bundled defaults are not the account's to delete.<MenuActionItem+ hint={t('workflowLibrary.deleteHint')}icon={Trash2Icon}label={t('workflowLibrary.delete')}tone="danger"