fix: harden studio timeline editing and local renders (#463)

* fix: harden studio timeline editing and local renders

* test: cover studio local render fallback

* fix(studio): scale composition hover previews to stage size

* test: normalize studio producer fallback paths

* fix(studio): preserve move surface and retry render fallback
This commit is contained in:
Miguel Ángel
2026-04-24 00:18:37 +02:00
committed by GitHub
parent 21063c66d9
commit 6610b8ad00
15 changed files with 774 additions and 72 deletions
@@ -0,0 +1,37 @@
import { describe, expect, it } from "vitest";
import { resolveCompositionPreviewScale } from "./CompositionsTab";
describe("resolveCompositionPreviewScale", () => {
it("scales a 16:9 stage to fit the composition card", () => {
expect(
resolveCompositionPreviewScale({
cardWidth: 80,
cardHeight: 45,
stageWidth: 1920,
stageHeight: 1080,
}),
).toBeCloseTo(80 / 1920);
});
it("scales non-16:9 stages against their actual dimensions", () => {
expect(
resolveCompositionPreviewScale({
cardWidth: 80,
cardHeight: 45,
stageWidth: 1280,
stageHeight: 720,
}),
).toBeCloseTo(80 / 1280);
});
it("falls back to the default stage when dimensions are invalid", () => {
expect(
resolveCompositionPreviewScale({
cardWidth: 80,
cardHeight: 45,
stageWidth: 0,
stageHeight: Number.NaN,
}),
).toBeCloseTo(80 / 1920);
});
});