fix: Delete/Backspace removes the selected timeline clip - #78
Merged
Merged
Conversation
There was no delete shortcut at all — the only removal affordance was the empty-layer trash button, which agent-generated tracks (always populated) never show, so their clips looked undeletable. Adds an editor-level Delete/Backspace handler that removes the selected clip by id from whichever layer holds it (video/text/audio), skipping text fields so typing is unaffected. Goes through updateEdl, so it participates in undo and autosave. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
removeCliphelper searches every layer by clip id (video/text/audio; caption layers have no clips), so agent-generated and hand-placed clips delete identically — no id-pattern assumptions.App.tsx: skips text fields/contentEditable so typing is unaffected, reads selection throughgetState()at keypress time, clears the selection after, and routes throughupdateEdlso deletion participates in undo (Cmd+Z brings the clip back) and autosave.Test plan
npm run typecheck && npm test && npm run buildgreen (152 tests, 2 new forremoveClip)Renderer-only change — HMR covers it, no dev restart needed.
Made with Cursor