From 19e8d56745143b7a5e6684936b39cece808394bb Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Wed, 11 Nov 2026 22:42:05 -0500 Subject: [PATCH 1/2] fix(studio): menus and popovers ease their scale in, not only their opacity --- packages/studio/src/components/ui/Menu.test.tsx | 14 +++++++++++++- packages/studio/src/components/ui/Menu.tsx | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/studio/src/components/ui/Menu.test.tsx b/packages/studio/src/components/ui/Menu.test.tsx index 3322657f5ae..2aeac667cf3 100644 --- a/packages/studio/src/components/ui/Menu.test.tsx +++ b/packages/studio/src/components/ui/Menu.test.tsx @@ -6,7 +6,7 @@ import React, { act, useState } from "react"; import { compile } from "tailwindcss"; import { afterEach, beforeAll, describe, expect, it } from "vitest"; import { loadStylesheet, STYLES_DIR } from "../../styles/styleSources"; -import { ContextMenu, Menu, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator } from "./Menu"; +import { ContextMenu, floatingMotion, Menu, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator } from "./Menu"; import { Popover } from "./Popover"; import { isTypingTarget } from "../../utils/typingTarget"; import { shouldIgnorePlaybackShortcutTarget } from "../../player/lib/playbackShortcuts"; @@ -443,3 +443,15 @@ describe("open motion", () => { expect(compileStudioCss([rowRadius])).toMatch(/calc\(var\(--radius-lg\) \+ 6px\)/); }); }); + +describe("floatingMotion", () => { + it("transitions every property its starting and ending styles set", () => { + const classes = floatingMotion("duration-open").split(/\s+/); + const transitioned = classes.flatMap((c) => c.match(/^transition-\[(.+)\]$/)?.[1].split(",") ?? []); + const animated = classes.flatMap( + (c) => c.match(/^data-\[(?:starting|ending)-style\]:(?:\[([\w-]+):|(opacity|scale|translate|rotate)-)/)?.slice(1) ?? [], + ).filter(Boolean); + expect(new Set(animated)).toEqual(new Set(["opacity", "scale"])); + for (const property of animated) expect(transitioned).toContain(property); + }); +}); diff --git a/packages/studio/src/components/ui/Menu.tsx b/packages/studio/src/components/ui/Menu.tsx index ebefc3f04b4..5e0046d017c 100644 --- a/packages/studio/src/components/ui/Menu.tsx +++ b/packages/studio/src/components/ui/Menu.tsx @@ -47,7 +47,7 @@ const VIEWPORT_MARGIN = 8; export function floatingMotion(openDuration: "duration-open" | "duration-tooltip") { return cn( "origin-[var(--transform-origin)] outline-hidden", - "transition-[opacity,transform] ease-out-quint", + "transition-[opacity,scale] ease-out-quint", openDuration, "data-[ending-style]:duration-close data-[ending-style]:ease-in", "data-[starting-style]:[opacity:var(--popup-enter-opacity)]", From acf2315e6fca84d08f5f280faa1402791452c951 Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Wed, 11 Nov 2026 23:19:32 -0500 Subject: [PATCH 2/2] style(studio): format the floatingMotion test --- .../studio/src/components/ui/Menu.test.tsx | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/packages/studio/src/components/ui/Menu.test.tsx b/packages/studio/src/components/ui/Menu.test.tsx index 2aeac667cf3..f6b2caba2b0 100644 --- a/packages/studio/src/components/ui/Menu.test.tsx +++ b/packages/studio/src/components/ui/Menu.test.tsx @@ -6,7 +6,15 @@ import React, { act, useState } from "react"; import { compile } from "tailwindcss"; import { afterEach, beforeAll, describe, expect, it } from "vitest"; import { loadStylesheet, STYLES_DIR } from "../../styles/styleSources"; -import { ContextMenu, floatingMotion, Menu, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator } from "./Menu"; +import { + ContextMenu, + floatingMotion, + Menu, + MenuItem, + MenuRadioGroup, + MenuRadioItem, + MenuSeparator, +} from "./Menu"; import { Popover } from "./Popover"; import { isTypingTarget } from "../../utils/typingTarget"; import { shouldIgnorePlaybackShortcutTarget } from "../../player/lib/playbackShortcuts"; @@ -447,10 +455,19 @@ describe("open motion", () => { describe("floatingMotion", () => { it("transitions every property its starting and ending styles set", () => { const classes = floatingMotion("duration-open").split(/\s+/); - const transitioned = classes.flatMap((c) => c.match(/^transition-\[(.+)\]$/)?.[1].split(",") ?? []); - const animated = classes.flatMap( - (c) => c.match(/^data-\[(?:starting|ending)-style\]:(?:\[([\w-]+):|(opacity|scale|translate|rotate)-)/)?.slice(1) ?? [], - ).filter(Boolean); + const transitioned = classes.flatMap( + (c) => c.match(/^transition-\[(.+)\]$/)?.[1].split(",") ?? [], + ); + const animated = classes + .flatMap( + (c) => + c + .match( + /^data-\[(?:starting|ending)-style\]:(?:\[([\w-]+):|(opacity|scale|translate|rotate)-)/, + ) + ?.slice(1) ?? [], + ) + .filter(Boolean); expect(new Set(animated)).toEqual(new Set(["opacity", "scale"])); for (const property of animated) expect(transitioned).toContain(property); });