Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"build": "vite build && tsup",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:timeline-virtualization": "node tests/e2e/timeline-virtualization.mjs",
"test:watch": "vitest",
"report:sdk-cutover": "bun src/utils/sdkCutoverPolicy.report.ts"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/studio/src/hooks/useStudioTestHooks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ describe("timeline performance fixture", () => {
expect(usePlayerStore.getState().lintFindingsByElement.size).toBe(0);
expect(usePlayerStore.getState().elements).toHaveLength(1_000);
expect(usePlayerStore.getState().expandedClipIds.size).toBe(1_000);

api.resetTimelinePerformanceFixture();
expect(notifications).toBe(2);
expect(usePlayerStore.getState()).toMatchObject({
isPlaying: false,
duration: 0,
timelineReady: false,
elements: [],
});
unsubscribe();
act(() => root.unmount());
expect(window.__studioTest).toBeUndefined();
Expand Down
4 changes: 4 additions & 0 deletions packages/studio/src/hooks/useStudioTestHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface StudioTestApi {
loadTimelinePerformanceFixture: (
spec: TimelinePerformanceFixtureSpec,
) => TimelinePerformanceFixtureSummary;
resetTimelinePerformanceFixture: () => void;
readTimelinePerformanceDiagnostics: () => Readonly<TimelinePerformanceDiagnostics>;
timelineViewportBudgets: typeof TIMELINE_VIEWPORT_BUDGETS;
}
Expand Down Expand Up @@ -88,6 +89,9 @@ export function useStudioTestHooks({
});
return fixture.summary;
},
resetTimelinePerformanceFixture: () => {
usePlayerStore.getState().reset();
},
readTimelinePerformanceDiagnostics: () => readTimelinePerformanceDiagnostics(),
timelineViewportBudgets: TIMELINE_VIEWPORT_BUDGETS,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://hyperframes.heygen.com/schema/hyperframes.json",
"paths": {
"blocks": "compositions",
"components": "compositions/components",
"assets": "assets"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Timeline virtualization QA fixture</title>
<style>
html,
body {
width: 1920px;
height: 1080px;
margin: 0;
overflow: hidden;
background: #0a0a0b;
}
</style>
</head>
<body>
<div
id="timeline-virtualization-anchor"
class="clip"
data-composition-id="timeline-virtualization"
data-width="1920"
data-height="1080"
data-start="0"
data-duration="60"
data-fps="30"
data-track-index="0"
style="position: absolute; inset: 0"
></div>
<script>
window.__timelines = window.__timelines || {};
window.__timelines["timeline-virtualization"] = {
pause() {},
seek() {},
};
</script>
</body>
</html>
Loading
Loading