Skip to content

feat: add confirmation dialog for track deletion (#738)#755

Open
Vitalcheffe wants to merge 1 commit intoOpenCut-app:mainfrom
Vitalcheffe:fix/track-delete-confirmation-738
Open

feat: add confirmation dialog for track deletion (#738)#755
Vitalcheffe wants to merge 1 commit intoOpenCut-app:mainfrom
Vitalcheffe:fix/track-delete-confirmation-738

Conversation

@Vitalcheffe
Copy link
Copy Markdown

@Vitalcheffe Vitalcheffe commented Mar 30, 2026

Problem

Right-click → Delete track immediately destroys the track with all its clips, no confirmation. One misclick can destroy a complex edit.

Solution

Added an AlertDialog (matching the existing DeleteDialog pattern from scenes-view.tsx) that shows element count before confirming:

  • "Delete track? This will remove X elements. This action cannot be undone."
  • Cancel/Confirm buttons with destructive variant
  • Reuses the project's existing @radix-ui AlertDialog component

Changes

  • apps/web/src/components/editor/panels/timeline/index.tsx:
    • Imported AlertDialog components
    • Added trackToDelete state to track pending deletion
    • Replaced direct removeTrack() call with state setter
    • Added AlertDialog with element count display

Fixes #738

Summary by CodeRabbit

Release Notes

  • New Features
    • Timeline track deletion now requires confirmation. A dialog prompt appears when deleting a track, allowing users to cancel or confirm the action to prevent accidental removal.

Right-click → Delete track now shows an AlertDialog with element count
before removing. Prevents accidental destruction of tracks with many clips.

Fixes OpenCut-app#738
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

@Vitalcheffe is attempting to deploy a commit to the OpenCut OSS Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60c20c45-ebc5-4f00-9fb4-81803446ccfc

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc6abc and c296335.

📒 Files selected for processing (1)
  • apps/web/src/components/editor/panels/timeline/index.tsx

📝 Walkthrough

Walkthrough

A confirmation dialog was added to the timeline track deletion flow. When users click "Delete track," a modal dialog now prompts for confirmation instead of immediately removing the track. Canceling dismisses the dialog; confirming proceeds with the deletion.

Changes

Cohort / File(s) Summary
Timeline Track Deletion Confirmation
apps/web/src/components/editor/panels/timeline/index.tsx
Added AlertDialog component with confirmation flow for track deletion. Introduced trackToDelete state to hold pending deletions. Modified delete handler to trigger dialog instead of direct removal. Dialog offers Cancel (clears state) and Delete (executes removal and clears state) options.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • mezotv

Poem

🐰 A delete so swift caused much dismay,
With clips vanishing without delay!
Now a dialog springs forth with care,
"Are you sure?" it asks so fair,
Safety first! No more regret—
Just click confirm, no tears to fret!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description does not comply with the template, which requires approval confirmation for features. Since this is a feature PR, address the template requirement: either open an issue for discussion first (already done #738) or obtain explicit maintainer approval before submitting.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a confirmation dialog for track deletion.
Linked Issues check ✅ Passed The code changes fully satisfy issue #738 requirements by implementing an AlertDialog confirmation flow for track deletion with element count display.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the confirmation dialog for track deletion; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Add confirmation dialog for track deletion with element count

1 participant