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(webv2): restore prompt row hover contrast

joshistoast727812a8c760
diff --git a/docs/superpowers/specs/2026-07-29-prompt-list-interaction-consistency-design.md b/docs/superpowers/specs/2026-07-29-prompt-list-interaction-consistency-design.md
index e5b6ec1aa4..e36451b659 100644
--- a/docs/superpowers/specs/2026-07-29-prompt-list-interaction-consistency-design.md
+++ b/docs/superpowers/specs/2026-07-29-prompt-list-interaction-consistency-design.md
@@ -18,6 +18,10 @@ That gives every selectable item the same:
No new recipe, color token, duration token, or per-feature hover constant will be added.
+The dynamic-prompts and prompt-template popovers use `bg.subtle` as their
+backing surface. This keeps the shared `bg.muted` row hover visibly distinct
+without overriding the `Row` recipe on individual list items.
+
## Component treatment
### Wildcard list
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.browser.test.tsx b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.browser.test.tsx
index f3f43ee1f0..6c59d2e898 100644
--- a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.browser.test.tsx
@@ -9,6 +9,7 @@ import {
getRenderedLineCount,
getXsButtonDensityStyles,
matchElementWidth,
+ waitForComputedStyles,
} from '@features/generation/ui/promptFields/promptFieldsBrowserTestUtils';
import { PromptTextarea } from '@features/generation/ui/promptFields/PromptTextarea';
import { Button } from '@platform/ui/Button';
@@ -172,6 +173,31 @@ describe('dynamic prompts in the positive prompt field', () => {
expect(onUsePrompt).toHaveBeenCalledWith('a red cat');
});
+ it('keeps the row hover visible against the popover surface', async () => {
+ await render('a {red|green} cat');
+ const hoverBackgroundColor = getComputedStyle(
+ host!.querySelector('[data-testid="row-hover-style-probe"]')!
+ ).backgroundColor;
+
+ await vi.waitFor(() => expect(findButton().textContent).toContain('2'));
+ await act(async () => {
+ await userEvent.click(findButton());
+ });
+
+ const row = [...document.querySelectorAll<HTMLButtonElement>('button')].find(
+ (button) =>
+ button.title === 'widgets.generate.dynamicPrompts.usePrompt' && button.textContent?.includes('a red cat')
+ )!;
+ const popover = row.closest<HTMLElement>('[data-scope="popover"][data-part="content"]')!;
+
+ await act(async () => {
+ await userEvent.hover(row);
+ });
+ await waitForComputedStyles(row, { backgroundColor: hoverBackgroundColor });
+
+ expect(getComputedStyle(row).backgroundColor).not.toBe(getComputedStyle(popover).backgroundColor);
+ });
+
it('preserves the former xs Button density, typography, border, and wrapping', async () => {
const longPrompt =
'a documentary portrait of a long-haired golden retriever beside a mountain lake under dramatic evening light';
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.tsx b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.tsx
index 6a8e4acf37..61fa7661f2 100644
--- a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.tsx
+++ b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/DynamicPromptsButton.tsx
@@ -100,7 +100,7 @@ export const DynamicPromptsButton = ({
</Tooltip>
<Portal>
<Popover.Positioner>
- <Popover.Content bg="bg.muted" borderColor="border.emphasized" borderWidth="1px" w="26rem">
+ <Popover.Content bg="bg.subtle" borderColor="border.emphasized" borderWidth="1px" w="26rem">
<Popover.Body p="2.5">
<Stack gap="2.5">
{/* `alignSelf` keeps the tabs to their content width; stretched across
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.browser.test.tsx b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.browser.test.tsx
index 7bef9f2eb4..0a4209ab0b 100644
--- a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.browser.test.tsx
@@ -1,8 +1,11 @@
import type { PromptTemplateSnapshot } from '@features/generation/core/promptTemplates';
+import type { PromptTemplateRecord } from '@features/generation/data/promptTemplates';
import type { PromptTemplateCatalog } from '@features/generation/ui/usePromptTemplates';
-import { ChakraProvider } from '@chakra-ui/react';
+import { Box, ChakraProvider } from '@chakra-ui/react';
+import { waitForComputedStyles } from '@features/generation/ui/promptFields/promptFieldsBrowserTestUtils';
import { PromptTemplatesButton } from '@features/generation/ui/promptFields/PromptTemplatesButton';
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { system } from '@theme/system';
import i18next from 'i18next';
import { act } from 'react';
@@ -76,6 +79,13 @@ const applied: PromptTemplateSnapshot = {
negativePrompt: '',
positivePrompt: '{prompt}, cinematic',
};
+const template: PromptTemplateRecord = {
+ ...applied,
+ hasImage: false,
+ isDefault: false,
+ isPublic: false,
+ userId: 'user-1',
+};
const render = async (activeTemplate: PromptTemplateSnapshot | null) => {
host = document.createElement('div');
@@ -84,11 +94,14 @@ const render = async (activeTemplate: PromptTemplateSnapshot | null) => {
await act(() => {
root?.render(
- <I18nextProvider i18n={i18n}>
- <ChakraProvider value={system}>
- <PromptTemplatesButton activeTemplate={activeTemplate} showSyntaxHighlighting={false} onApply={vi.fn()} />
- </ChakraProvider>
- </I18nextProvider>
+ <QueryClientProvider client={new QueryClient()}>
+ <I18nextProvider i18n={i18n}>
+ <ChakraProvider value={system}>
+ <Box aria-hidden bg="bg.muted" data-testid="row-hover-style-probe" />
+ <PromptTemplatesButton activeTemplate={activeTemplate} showSyntaxHighlighting={false} onApply={vi.fn()} />
+ </ChakraProvider>
+ </I18nextProvider>
+ </QueryClientProvider>
);
});
};
@@ -96,7 +109,10 @@ const render = async (activeTemplate: PromptTemplateSnapshot | null) => {
/** What the hook was handed on the most recent render. */
const lastIsEnabled = (): boolean | undefined => usePromptTemplates.mock.calls.at(-1)?.[0]?.isEnabled;
-beforeEach(() => usePromptTemplates.mockClear());
+beforeEach(() => {
+ usePromptTemplates.mockClear();
+ usePromptTemplates.mockReturnValue(catalog);
+});
afterEach(async () => {
await act(() => root?.unmount());
@@ -125,6 +141,34 @@ describe('the prompt templates button', () => {
expect(lastIsEnabled()).toBe(true);
});
+ it('keeps the template row hover visible against the popover surface', async () => {
+ usePromptTemplates.mockReturnValue({
+ ...catalog,
+ personalTemplates: [template],
+ templates: [template],
+ });
+ await render(null);
+ const hoverBackgroundColor = getComputedStyle(
+ host!.querySelector('[data-testid="row-hover-style-probe"]')!
+ ).backgroundColor;
+
+ await act(async () => {
+ await userEvent.click(host!.querySelector<HTMLButtonElement>('button[aria-label="Prompt templates"]')!);
+ });
+
+ const row = [...document.querySelectorAll<HTMLButtonElement>('button')].find((button) =>
+ button.textContent?.includes('Cinematic')
+ )!;
+ const popover = row.closest<HTMLElement>('[data-scope="popover"][data-part="content"]')!;
+
+ await act(async () => {
+ await userEvent.hover(row);
+ });
+ await waitForComputedStyles(row, { backgroundColor: hoverBackgroundColor });
+
+ expect(getComputedStyle(row).backgroundColor).not.toBe(getComputedStyle(popover).backgroundColor);
+ });
+
// An applied template has to be re-read whether the list is open or not: to
// refresh its text after an edit, and to notice it has been deleted.
it('asks for it whenever a template is applied', async () => {
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.tsx b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.tsx
index 46a1b5dd02..8e797faded 100644
--- a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.tsx
+++ b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesButton.tsx
@@ -135,7 +135,7 @@ export const PromptTemplatesButton = ({
</Tooltip>
<Portal>
<Popover.Positioner>
- <Popover.Content bg="bg.muted" borderColor="border.emphasized" borderWidth="1px" w="26rem">
+ <Popover.Content bg="bg.subtle" borderColor="border.emphasized" borderWidth="1px" w="26rem">
<Popover.Body p="2.5">
{editorTarget ? (
<PromptTemplateEditor