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): float the preview filmstrip over the media instead of reserving height

joshistoast5f325ee329c6
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx
index dbb41d2867..7a80a74300 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFilmstrip.tsx
@@ -9,11 +9,13 @@ import { useCallback, useMemo } from 'react';
import type { PreviewDensity } from './previewDensity';
/**
- * A docked strip of the current board's thumbnails between frame and footer —
- * the same `boardImages` the "N of M" counter is derived from, made spatial.
- * Fixed height (`flexShrink=0`) so the fitted frame's `100cqh` math is never
- * stolen from. Thumbs are standard all-image gallery-item drag sources, so they work
- * with every existing drop target (canvas zones, boards, drop-to-compare).
+ * A floating strip of the current board's thumbnails above the footer — the
+ * same `boardImages` the "N of M" counter is derived from, made spatial. It
+ * overlays the fitted media rather than reserving height from it, so it
+ * carries the same opaque island fill as the footer to stay legible over any
+ * image. Thumbs are standard all-image gallery-item drag sources, so they
+ * work with every existing drop target (canvas zones, boards,
+ * drop-to-compare).
*/
export const PreviewFilmstrip = ({
@@ -41,10 +43,16 @@ export const PreviewFilmstrip = ({
// its panel (side panels host widgets in a grid ScrollArea.Content that
// otherwise grows to max-content).
<ScrollArea.Root
+ bg="bg.subtle"
+ borderColor="border.subtle"
+ borderWidth="1px"
css={FILMSTRIP_CONTAIN_CSS}
flexShrink={0}
h={density === 'full' ? '3.75rem' : '2.75rem'}
minW="0"
+ px="1.5"
+ rounded="md"
+ shadow="sm"
size="xs"
variant="hover"
w="full"
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx
index 9515d20976..69c6ada926 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewFrame.tsx
@@ -52,7 +52,7 @@ const CENTER_CHROME_INSET = 'var(--wb-center-chrome-inset, 0px)';
*
* It belongs on the stage rather than on the widget root so the dot grid still
* runs to every edge and passes *behind* the chrome — the same arrangement that
- * lets `paddingBottom` pass it behind the filmstrip. Because the stage is a size
+ * lets `paddingBottom` pass it behind the footer island. Because the stage is a size
* container, `getFittedFrameCss` reads the shrunken content box and refits the
* media with no further change.
*/
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
index 979d808360..f76e5e0122 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/preview/PreviewWidgetView.tsx
@@ -251,18 +251,14 @@ export const getMatchingProgressImage = (
const selectGenerateRecallValues = createGenerateFormValuesSelector();
/**
- * Bottom padding the grid surface reserves for the overlaid filmstrip and
- * details island — their collapsed heights plus the 2-unit inset and gap. An
- * expanded Details panel grows over the grid on purpose; it is self-capped at
- * `40cqh` and closes back down.
+ * Bottom padding the grid surface reserves for the overlaid details island —
+ * its collapsed height plus the 2-unit inset and gap. The filmstrip
+ * deliberately reserves nothing: it is a floating overlay above the media's
+ * lower edge, so toggling it never reflows the fitted image. An expanded
+ * Details panel grows over the grid on purpose; it is self-capped at `40cqh`
+ * and closes back down.
*/
-const getPreviewOverlayReserve = (density: PreviewDensity, hasFilmstrip: boolean): string => {
- if (!hasFilmstrip) {
- return '5.5rem';
- }
-
- return density === 'full' ? '9.75rem' : '8.75rem';
-};
+const PREVIEW_OVERLAY_RESERVE = '5.5rem';
export const PreviewWidgetView = ({ region, runtime }: WidgetViewProps) => {
const galleryValues = useActiveProjectSelector((project) => getProjectWidgetValues(project, 'gallery'));
@@ -1055,11 +1051,11 @@ const SelectedMediaPreview = ({
source: Parameters<typeof PreviewFrame>[0]['source'];
}) => {
const { t } = useTranslation();
- const overlayReserve = getPreviewOverlayReserve(density, filmstripItems !== null);
// The grid surface fills; the filmstrip and details float above its lower
- // edge. The surface reserves matching bottom padding so the fitted media is
- // never tucked under them — only the dot grid passes behind.
+ // edge. The surface reserves bottom padding for the details island only, so
+ // the fitted media is never tucked under it; the filmstrip floats over the
+ // media itself and steals no height.
return (
<Flex direction="column" h="full" minH="0" position="relative" w="full">
<PreviewFrame
@@ -1072,7 +1068,7 @@ const SelectedMediaPreview = ({
loupeControlsRef={loupeControlsRef}
onVideoCopyAvailabilityChange={onCopyAvailabilityChange}
padding={density === 'full' ? '6' : '3'}
- paddingBottom={overlayReserve}
+ paddingBottom={PREVIEW_OVERLAY_RESERVE}
shouldAntialiasLiveImage
source={source}
variant="framed"