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.

test(webv2): judge the badge reveal by pointer-events, not opacity

Lincoln Stein15db0b42aef4
diff --git a/invokeai/frontend/webv2/performance/architecture-baseline.json b/invokeai/frontend/webv2/performance/architecture-baseline.json
index 87d8ab300f..6af7a6076f 100644
--- a/invokeai/frontend/webv2/performance/architecture-baseline.json
+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json
@@ -2,12 +2,12 @@
"build": {
"launchpad": {
"baseline": {
- "brotliBytes": 859305,
+ "brotliBytes": 859400,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 858515,
+ "gzipBytes": 858537,
"imageRawBytes": 156376,
- "initialRawBytes": 2010918,
+ "initialRawBytes": 2010995,
"largestAssetRawBytes": 747218,
"otherAssetRawBytes": 0,
"ownedRawBytes": 74443,
@@ -316,15 +316,15 @@
},
"editor": {
"baseline": {
- "brotliBytes": 1184710,
+ "brotliBytes": 1185405,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 1178978,
+ "gzipBytes": 1179571,
"imageRawBytes": 156376,
- "initialRawBytes": 2995640,
+ "initialRawBytes": 2998256,
"largestAssetRawBytes": 747218,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 132910,
+ "ownedRawBytes": 134012,
"requestCount": 106,
"scriptRequestCount": 90,
"sourceOwners": [
@@ -819,6 +819,7 @@
"source:src/workbench/hotkeys/targetWidget.ts",
"source:src/workbench/iconResolver.tsx",
"source:src/workbench/image-actions/recallParametersBridge.ts",
+ "source:src/workbench/image-actions/useFindGalleryItem.ts",
"source:src/workbench/invocation.ts",
"source:src/workbench/invocationSubmit.ts",
"source:src/workbench/launchpad/HelpMenu.tsx",
@@ -1021,7 +1022,7 @@
"source": "src/app/WorkbenchApp.tsx"
}
},
- "capturedAt": "2026-09-14",
+ "capturedAt": "2026-09-15",
"developmentInvalidation": {
"platformUiBarrel": {
"specifier": "@platform/ui",
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryMediaSlot.browser.test.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryMediaSlot.browser.test.tsx
index 8bde3e8052..6e4d241793 100644
--- a/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryMediaSlot.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/picker/GalleryMediaSlot.browser.test.tsx
@@ -370,15 +370,18 @@ describe('GalleryMediaSlot', () => {
// Hidden until the slot is hovered or holds focus. A mouse hover cannot be
// synthesised, but both come from the same `.group` ancestor, so focus
// proves the wiring the badge depends on entirely.
+ //
+ // `pointer-events` rather than `opacity`: the reveal sets both under one
+ // selector, but only opacity is transitioned, so opacity answers for where
+ // the animation has got to rather than for whether the badge is revealed.
+ expect(getComputedStyle(find!).pointerEvents).toBe('none');
expect(getComputedStyle(find!).opacity).toBe('0');
await act(() => {
find!.focus();
});
- // Polled: the reveal is a CSS transition, which does not exist to be
- // awaited until the style recalc that starts it has run.
- await vi.waitFor(() => expect(getComputedStyle(find!).opacity).toBe('1'));
+ expect(getComputedStyle(find!).pointerEvents).toBe('auto');
// The badge is a SIBLING of the slot's face — the face is a <button> and
// may not contain one — so its position is hand-mirrored from the value
diff --git a/invokeai/frontend/webv2/src/features/video/ui/videoReferenceFindInGallery.browser.test.tsx b/invokeai/frontend/webv2/src/features/video/ui/videoReferenceFindInGallery.browser.test.tsx
index da8d410624..d7d74d4bda 100644
--- a/invokeai/frontend/webv2/src/features/video/ui/videoReferenceFindInGallery.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/video/ui/videoReferenceFindInGallery.browser.test.tsx
@@ -136,28 +136,28 @@ describe('video reference find-in-gallery badges', () => {
// mechanism that makes it a hover overlay rather than permanent chrome. A
// mouse hover cannot be synthesised, but focus-within comes from the same
// ancestor, so it proves the scoping either way.
+ //
+ // Read through `pointer-events` rather than `opacity`: the reveal sets both,
+ // under the same selector, but only opacity is transitioned — so opacity
+ // answers for where the animation has got to, while pointer-events answers
+ // for which badge the CSS considers revealed. That is the actual claim here,
+ // and it is true the instant focus lands rather than a few frames later.
const badges = [...findButtons('still.png'), ...findButtons('clip.mp4')];
- const opacities = () => badges.map((button) => getComputedStyle(button).opacity);
+ const revealed = () => badges.map((button) => getComputedStyle(button).pointerEvents);
expect(badges).toHaveLength(2);
- expect(opacities()).toEqual(['0', '0']);
+ expect(revealed()).toEqual(['none', 'none']);
+ expect(badges.map((button) => getComputedStyle(button).opacity)).toEqual(['0', '0']);
- // Each in turn: the one holding focus lights and only it. A badge whose
- // thumbnail lost its `.group` would never light; a `.group` hoisted to the
- // card would light both at once.
- //
- // Polled rather than settled once: the reveal is a CSS transition, which
- // does not exist to be awaited until the style recalc that starts it has
- // run. Settling at the moment of the focus call can therefore return
- // before the transition is even scheduled, and reads its start value.
+ // Each in turn: the one holding focus is revealed and only it. A badge whose
+ // thumbnail lost its `.group` would never be revealed; a `.group` hoisted to
+ // the card would reveal both at once.
for (const [index] of badges.entries()) {
await act(() => {
badges[index]!.focus();
});
- await vi.waitFor(() =>
- expect(opacities()).toEqual(badges.map((_button, other) => (other === index ? '1' : '0')))
- );
+ expect(revealed()).toEqual(badges.map((_button, other) => (other === index ? 'auto' : 'none')));
}
});