From f192f2798cda85f4bb9737fcf5b3f6773bebb599 Mon Sep 17 00:00:00 2001 From: "open-design-crew[bot]" <299007234+open-design-crew[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 15:03:42 +0800 Subject: [PATCH] fix(studio): keep brand actions below short landscape previews (#640) * fix(studio): keep brand actions below short landscape previews * fix(studio): align landscape brand actions --------- Co-authored-by: qiqi --- studio/src/motion/BrandStories.module.css | 4 ++++ tests/related-template-preview-browser.mjs | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/studio/src/motion/BrandStories.module.css b/studio/src/motion/BrandStories.module.css index 2c7298432..95eda9ccf 100644 --- a/studio/src/motion/BrandStories.module.css +++ b/studio/src/motion/BrandStories.module.css @@ -165,6 +165,10 @@ .collectionIntro { grid-column:1/-1; } .relatedShelf { padding:var(--motion-space-20); } } +@media(max-width:699px) and (orientation:landscape) { + .storyDialog[open] { padding-bottom:0; } + .actionDock { position:static; margin-top:var(--motion-space-12); padding-inline:0; box-shadow:none; } +} @media(prefers-reduced-motion:no-preference) { .stackItem { transition:transform var(--motion-duration-normal) var(--motion-ease-out); } .storyDialog .reelFrame:global(.om-button) { transition:transform var(--motion-duration-normal) var(--motion-ease-out),border-color var(--motion-duration-fast) var(--motion-ease-out),background var(--motion-duration-fast) var(--motion-ease-out); } diff --git a/tests/related-template-preview-browser.mjs b/tests/related-template-preview-browser.mjs index 8d09ac455..15c389200 100644 --- a/tests/related-template-preview-browser.mjs +++ b/tests/related-template-preview-browser.mjs @@ -152,7 +152,18 @@ try { }); assert(geometry.width >= 224 && geometry.height >= 126 && geometry.inViewport, `Brand preview remains visible at ${width}×${height}: ${JSON.stringify(geometry)}`); assert(Math.abs(geometry.width / geometry.height - 16 / 9) < .02, 'The brand preview keeps the video aspect ratio'); - results.push({ mode: 'brand-preview', viewport: [width, height], ...geometry }); + const actionDock = await page.$eval('dialog[aria-label="Figma brand story"][open] [aria-label="Work actions"]', element => { + const dock = element.getBoundingClientRect(); + const video = element.closest('[aria-label="Selected release"]')?.querySelector('[aria-busy]')?.getBoundingClientRect(); + const position = getComputedStyle(element).position; + return { top: dock.top, bottom: dock.bottom, position, videoBottom: video?.bottom ?? null, + overlapsVideo: video ? dock.top < video.bottom && dock.bottom > video.top : false }; + }); + if (width < 700 && width > height) { + assert.equal(actionDock.position, 'static', `Action dock should flow below the video at ${width}×${height}`); + assert.equal(actionDock.overlapsVideo, false, `Action dock should not cover the video at ${width}×${height}`); + } + results.push({ mode: 'brand-preview', viewport: [width, height], ...geometry, actionDock }); await page.screenshot({ path: path.join(output, `brand-${width}x${height}.png`) }); } console.log('PASS default masonry cards, player budget and same-dialog selection; legacy popup bounds, Retry and Escape in both themes at 640x360, 390x844 and 1440x900');