mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-16 14:27:26 +00:00
The runtime clamps a clip's live duration to the composition length when it builds the timeline/manifest, so the Studio's stored element durations are truncated (an 8s clip whose start sits near the comp end reads as ~3.8s). The content-driven duration sync measured the furthest clip end from those store durations, so every move/resize/delete fed the truncated value back in and the composition length could only ratchet DOWN — never grow to fit a clip longer than the current length. Moving a clip past the end just re-truncated it. Fix: measure the furthest clip end from the PATCHED SOURCE HTML (raw data-duration) via furthestClipEndFromSource, for all four duration-sync sites (single move, batched move, resize, delete). Since the source carries the authored, untruncated durations, the composition grows to fit and the runtime clamp becomes a no-op. Extracted furthestClipEndFromDocument from readTimelineDurationFromDocument (excluding the root) and reused it. Replaces the store-based resolveMovedContentEnd (removed). Tests updated: furthestClipEndFromSource units + a persist-level test proving the saved source grows to the raw 8s end (fails if the sync is removed). Runtime-side clamp (clipTree/timeline) left for a separate framework-level decision.
@hyperframes/studio
Browser-based composition editor UI for Hyperframes. Provides a visual timeline, code editor, and live preview for building video compositions.
Install
npm install @hyperframes/studio
What it does
The studio is a React application with:
- Visual timeline — drag, resize, and arrange elements on tracks
- Code editor — edit HTML and GSAP scripts with CodeMirror (syntax highlighting, autocomplete)
- Live preview — see changes in real time as you edit
- Composition inspector — view and modify element properties
Development
The studio is embedded in the hyperframes preview command. To develop the studio UI itself:
cd packages/studio
bun run dev # Start Vite dev server
bun run build # Build for production
bun run typecheck # Type-check
Tech stack
- React 18/19, Zustand (state management)
- CodeMirror 6 (editor)
- Tailwind CSS (styling)
- Vite (bundler)
- Phosphor Icons
Documentation
Full documentation: hyperframes.heygen.com/packages/studio
Related packages
@hyperframes/core— types and parsers used by the editorhyperframes— CLI that serves the studio viahyperframes preview