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): contain filmstrip intrinsic width so side panels never stretch

joshistoast8cab805acace
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx
index fb19e5190f..f16f0fbe52 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx
@@ -35,10 +35,14 @@ export const PreviewFilmstrip = ({
}
return (
- // The ScrollArea root's recipe defaults to `height: 100%`, so the strip
- // MUST get an explicit height or it swallows the widget (the frame's
- // flex-1 collapses). Height = thumb size + scrollbar allowance.
+ // Two containment rules keep the strip honest: the ScrollArea root's
+ // recipe defaults to `height: 100%`, so it MUST get an explicit height or
+ // it swallows the widget; and `contain: inline-size` zeroes the strip's
+ // intrinsic width so a long board can never stretch the widget wider than
+ // its panel (side panels host widgets in a grid ScrollArea.Content that
+ // otherwise grows to max-content).
<ScrollArea.Root
+ css={FILMSTRIP_CONTAIN_CSS}
flexShrink={0}
h={density === 'full' ? '3.75rem' : '2.75rem'}
minW="0"
@@ -130,6 +134,8 @@ const FilmstripThumb = ({
);
};
+const FILMSTRIP_CONTAIN_CSS = { contain: 'inline-size' } as const;
+
const FILMSTRIP_IMG_STYLE = {
display: 'block',
height: '100%',
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/__screenshots__/PreviewCompareDropZone.browser.test.tsx/PreviewCompareDropZone-resolves-null-when-the-drop-lands-outside-the-zone-1.png b/invokeai/frontend/webv2/src/workbench/widgets/preview/__screenshots__/PreviewCompareDropZone.browser.test.tsx/PreviewCompareDropZone-resolves-null-when-the-drop-lands-outside-the-zone-1.png
deleted file mode 100644
index 47767d2f3d..0000000000
Binary files a/invokeai/frontend/webv2/src/workbench/widgets/preview/__screenshots__/PreviewCompareDropZone.browser.test.tsx/PreviewCompareDropZone-resolves-null-when-the-drop-lands-outside-the-zone-1.png and /dev/null differ
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/__screenshots__/PreviewCompareDropZone.browser.test.tsx/PreviewCompareDropZone-shows-the-drop-ring-during-a-gallery-image-drag-and-resolves-the-drop-1.png b/invokeai/frontend/webv2/src/workbench/widgets/preview/__screenshots__/PreviewCompareDropZone.browser.test.tsx/PreviewCompareDropZone-shows-the-drop-ring-during-a-gallery-image-drag-and-resolves-the-drop-1.png
deleted file mode 100644
index 47767d2f3d..0000000000
Binary files a/invokeai/frontend/webv2/src/workbench/widgets/preview/__screenshots__/PreviewCompareDropZone.browser.test.tsx/PreviewCompareDropZone-shows-the-drop-ring-during-a-gallery-image-drag-and-resolves-the-drop-1.png and /dev/null differ