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.

fix(preview): lead the action strip with a labelled Edit button

joshistoast6674071a5754
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewActionStrip.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewActionStrip.tsx
index db605ea7ef..79771da962 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewActionStrip.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewActionStrip.tsx
@@ -3,7 +3,7 @@ import type { ImageActions } from '@workbench/image-actions';
import { HStack, Icon } from '@chakra-ui/react';
import { galleryImageItemToGalleryImage, isGalleryImageItem, toGalleryItemRef } from '@features/gallery/contracts';
-import { IconButton, Tooltip } from '@platform/ui';
+import { Button, IconButton, Tooltip } from '@platform/ui';
import {
CopyIcon,
EllipsisVerticalIcon,
@@ -95,13 +95,25 @@ export const PreviewActionStrip = ({
return (
<HStack flexShrink={0} gap="0.5">
- {starButton}
- {image ? <StripIconButton icon={ImagesIcon} label="Select for Compare" onClick={selectForCompare} /> : null}
- {/* Videos have no canvas destination, so the verb simply is not offered
- for them — the same guard the context menu's image-only branch uses. */}
+ {/* First and worded, not another glyph in the row: it is the strip's one
+ verb that moves the image into actual work. "Edit" like legacy's
+ button; the aria-label keeps the destination. Videos have no canvas
+ destination, so it simply is not offered for them — the same guard
+ the context menu's image-only branch uses. */}
{image ? (
- <StripIconButton icon={PencilIcon} label={t('widgets.preview.editOnCanvas')} onClick={editOnCanvas} />
+ <Button
+ aria-label={t('widgets.preview.editOnCanvas')}
+ color="fg.muted"
+ size="2xs"
+ variant="ghost"
+ onClick={editOnCanvas}
+ >
+ <Icon as={PencilIcon} boxSize="3.5" />
+ {t('common.edit')}
+ </Button>
) : null}
+ {starButton}
+ {image ? <StripIconButton icon={ImagesIcon} label="Select for Compare" onClick={selectForCompare} /> : null}
{item.kind === 'video' && onCopyCurrentFrame ? (
<StripIconButton
disabled={!isVideoFrameCopyAvailable}
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
index 775dc06ba8..cfaaf0f469 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewMediaChrome.browser.test.tsx
@@ -88,7 +88,7 @@ void i18n.use(initReactI18next).init({
resources: {
en: {
translation: {
- common: { countOfTotal: '{{count}} of {{total}}', generating: 'Generating' },
+ common: { countOfTotal: '{{count}} of {{total}}', edit: 'Edit', generating: 'Generating' },
widgets: {
preview: {
copyCurrentFrame: 'Copy Current Frame',
@@ -458,6 +458,9 @@ describe('Preview mixed media footer and actions', () => {
const editOnCanvas = host?.querySelector<HTMLButtonElement>('[aria-label="Edit on Canvas"]');
expect(editOnCanvas).not.toBeNull();
+ // Leads the strip and carries a visible label, not just a glyph.
+ expect(host?.querySelector('button')).toBe(editOnCanvas);
+ expect(editOnCanvas?.textContent).toContain('Edit');
expect(host?.querySelector('[aria-label="Copy Current Frame"]')).toBeNull();
await interact(() => editOnCanvas?.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true })));
expect(actions.sendToCanvas).toHaveBeenCalledWith([expect.objectContaining({ imageName: 'shared' })], 'raster');