fix: multi-file timeline drop spacing#487
Merged
miguel-heygen merged 1 commit intomainfrom Apr 25, 2026
Merged
Conversation
5e055d7 to
7d0a945
Compare
7d0a945 to
b4ac293
Compare
jrusso1020
approved these changes
Apr 25, 2026
Collaborator
jrusso1020
left a comment
There was a problem hiding this comment.
Multi-file drop placement looks good after the b4ac293 follow-up. All edge cases I flagged are closed:
- Zero/missing-duration silent overlap → fixed via
FALLBACK_TIMELINE_FILE_DROP_DURATION = 5. Placement math now always advances; the new "uses fallback spacing when a duration is unavailable" test pins the behavior. - Default-track at-time-0 occupied → covered by the new "moves a default-track drop to a clear row" test.
- Empty drop set → covered.
- Clear high-track placement → covered.
Verified locally on b4ac293:
bun test packages/studio/src/utils/timelineAssetDrop.test.ts→ 12/12 passbun run --filter @hyperframes/studio test→ 221/221 pass- Studio typecheck clean
Sequenced placement with same-track overlap detection is the right model for "user dropped these as a group." The clamp-to-positive on clip.start / clip.duration, and 2dp rounding match the rest of the timeline math. Effect dependency on [activeCompPath, handleTimelineAssetDrop, timelineElements, uploadProjectFiles] is correct for the new closure.
Low blast radius — Studio drag-drop only, no render-pipeline impact.
— Rames Jusso
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Studio could still produce a bad timeline layout when multiple media files were dropped onto the timeline at once.
The files uploaded correctly, but the placement logic treated the group too loosely:
What this fixes
Multi-file timeline placement
data-durationmatches the placement math when metadata is availableOccupied-row handling
{ start: 0, track: 0 }placement path when track0is already occupiedMedia coverage
Root cause
The multi-file drop helper only knew about the number of uploaded files. It did not know the duration of each uploaded media asset, so it could not build a non-overlapping sequence from the drop point.
The direct file-drop handler also passed placement into each insert independently. That meant the drop could use the same start time repeatedly, and it could target a row that was already occupied by an existing clip.
A smaller edge case existed when a duration resolved to
0or was otherwise unavailable: placement math did not advancenextStart, but the insert path could still write a positive fallback duration later. The helper now uses a finite fallback for placement too.Behavior
Verification
Local checks
bun run --filter @hyperframes/studio test -- src/utils/timelineAssetDrop.test.ts-> 12 tests passbun run --filter @hyperframes/studio test-> 221 tests passbun run --filter @hyperframes/studio typecheckbunx oxlint packages/studio/src/utils/timelineAssetDrop.ts packages/studio/src/utils/timelineAssetDrop.test.tsbunx oxfmt --check packages/studio/src/utils/timelineAssetDrop.ts packages/studio/src/utils/timelineAssetDrop.test.tsbun run --filter @hyperframes/studio buildgit diff --checkBrowser / live verification
Verified against a live local Studio fixture with real media files:
2.18s,3.38s, and4.98s0while the new media group moved together to clear track1agent-browser errorswas clean after the dropagent-browserrecording pass for the tested flowNotes
timeline-multi-drop-reproStudio project and generated MP4 / MOV / MP3 files used for browser verification are local-only and are not part of this PR