Repository navigation
feat(gpui): lock timeline tracks so clip edits don't move them - #2781
YoavLevavi wants to merge 5 commits into
Conversation
Locked tracks (project config) keep their segments in place when clips are deleted, merged or retimed. A lock button sits in each track's gutter in the GPUI timeline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@YoavLevavi is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the GPUI port @YoavLevavi, wrapping the rippling edits in |
- Reordering clips in the Clips sidebar runs through with_locked_tracks, so a locked track no longer moves when a dropped transition ripples the rest. - The lock is drawn on a track's first lane only, since it locks the track. - with_locked_tracks and lockable_track sit above delete_clip_segments' doc again, and the locked_tracks doc lists the edits actually covered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for the quick turnaround @YoavLevavi, all four points are sorted: the doc comments are back in the right place, clip reordering now goes through |
|
Thanks @richiemcilroy, all four are addressed in 5da66c3:
|
- preset_config drops lockedTracks, and both apply paths keep the current project's locks, so applying a preset never locks or unlocks tracks. - Merges origin/main; audio_project_key lists locked_tracks as not affecting playback audio. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @richiemcilroy, good catch. Fixed in c9165e7 (also merged main): @greptileai review |
| LockableTimelineTrack::Caption => { | ||
| timeline.caption_segments = saved.caption_segments.clone() |
There was a problem hiding this comment.
For generated captions, with_locked_tracks restores caption_segments, but the next project_changed call runs synchronize_caption_track(false). Deleting a clip or changing its speed changes the caption signature, so synchronize_captions replaces the restored positions with times calculated from the edited clips. Deleting a preceding 10-second clip therefore still moves a locked caption from 12 seconds to 2 seconds.
Make caption synchronization respect the lock, including when the project is reopened, and test this through the full edit path.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/editor_edits.rs
Line: 1223-1224
Comment:
**Locked captions still move**
For generated captions, `with_locked_tracks` restores `caption_segments`, but the next `project_changed` call runs `synchronize_caption_track(false)`. Deleting a clip or changing its speed changes the caption signature, so `synchronize_captions` replaces the restored positions with times calculated from the edited clips. Deleting a preceding 10-second clip therefore still moves a locked caption from 12 seconds to 2 seconds.
Make caption synchronization respect the lock, including when the project is reopened, and test this through the full edit path.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.# Conflicts: # apps/desktop-gpui/src/editor_window.rs # apps/desktop-gpui/src/presets.rs
GPUI port of #2378.
ProjectConfiguration::locked_tracks(LockableTimelineTrack).edits::with_locked_trackswraps the clip edits that ripple other tracks (deleting, merging and retiming clips) and keeps locked tracks' segments where they were.Testing: new
deleting_a_clip_leaves_locked_tracks_in_placetest,cargo test --bin cap-gpui(edits/assets),cargo test -p cap-project --lib.🤖 Generated with Claude Code
Fix the Caption lock before merging; generated captions still move after clip edits.
Findings
Fix with agent prompt
Summary
Adds saved track locks and gutter buttons. Clip deletion, merging, speed changes, and reordering restore locked tracks after moving other tracks.
Reviews (1) · Last reviewed commit: "Track lock: keep locks out of presets; m..." · Reviewed by Greptile