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(generate): give prompt template rows a visible hover

Josh Corbettae8b49a77891
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplates.browser.test.tsx b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplates.browser.test.tsx
index 0ea5363d4c..828380ee3c 100644
--- a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplates.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplates.browser.test.tsx
@@ -108,6 +108,8 @@ let host: HTMLDivElement | null = null;
let root: Root | null = null;
(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
+const TEMPLATE_ROW_HOVER_PROBE_PROPS = { bg: 'bg.emphasized/60' };
+
const userTemplate: PromptTemplateRecord = {
hasImage: false,
id: 'user-1',
@@ -160,8 +162,11 @@ const StatefulPromptTemplatesPanel = ({ catalog }: { catalog: PromptTemplateCata
return (
<>
- <Box aria-hidden bg="bg.muted/60" data-testid="row-hover-style-probe" />
- <Row asChild>
+ {/* The popover surface is bg.muted, so template rows hover one step up;
+ the probe Row carries the same override so the rest of the Row
+ contract (focus ring, transitions) is still compared like for like. */}
+ <Box aria-hidden bg="bg.emphasized/60" data-testid="row-hover-style-probe" />
+ <Row asChild _hover={TEMPLATE_ROW_HOVER_PROBE_PROPS}>
<button aria-label="Row probe" type="button">
Row probe
</button>
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesPanel.tsx b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesPanel.tsx
index b5697a3f06..4a2a8e3885 100644
--- a/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesPanel.tsx
+++ b/invokeai/frontend/webv2/src/features/generation/ui/promptFields/PromptTemplatesPanel.tsx
@@ -27,6 +27,9 @@ import { useCallback, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
const THUMBNAIL_SIZE = '7';
+// The rows sit on the popover's `bg.muted` surface, where the row recipe's
+// `bg.muted/60` hover is invisible — hover needs the next surface step.
+const TEMPLATE_ROW_HOVER_PROPS = { bg: 'bg.emphasized/60' };
const TEMPLATE_THUMBNAIL_FALLBACK = (
<Box
alignItems="center"
@@ -396,6 +399,7 @@ const TemplateRow = ({
px="2"
py="1.5"
rounded="sm"
+ _hover={isActive ? undefined : TEMPLATE_ROW_HOVER_PROPS}
>
<button type="button" onClick={handleApply}>
<TemplateThumbnail template={template} />