fix(export): clear timeline selection when opening export panel#645
fix(export): clear timeline selection when opening export panel#645auberginewly wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughSettingsPanel gains an optional ChangesExport Panel Callback Integration
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly Related PRs
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
When a zoom/trim/speed region is selected, hasTimelineSelection is true and the export panel is gated behind !hasTimelineSelection. Clicking the Download button only switched activePanelMode locally in SettingsPanel without clearing the selection in VideoEditor, so the export panel never rendered. Add onExportPanelOpen callback prop to SettingsPanel and call it on Download button click to clear selectedZoomId, selectedTrimId, and selectedSpeedId — making hasTimelineSelection false and unblocking the export panel. Complements PR siddharthvaddem#611 which fixed the bulk suggest-zooms path; this covers the manual selection path.
85bbe5f to
37eaacc
Compare
Problem
After manually clicking a zoom (or trim/speed) region in the timeline, the Download button stops working. The export panel never appears — the user is stuck seeing the zoom-edit panel and must click elsewhere in the timeline to deselect before they can export.
Root Cause
SettingsPanelcomputes:Both the export button's active highlight and the export panel content are gated on
!hasTimelineSelection:When the user clicks a zoom region,
selectedZoomIdbecomes non-null inVideoEditor. Clicking the Download button only callssetActivePanelMode("export")(localSettingsPanelstate) — it does not clear the selection inVideoEditor. SohasTimelineSelectionstaystrueand the export panel never renders.Fix
Add an
onExportPanelOpencallback prop toSettingsPanel. When the Download button is clicked, the callback fires alongside the local mode switch, clearingselectedZoomId,selectedTrimId, andselectedSpeedIdinVideoEditorsohasTimelineSelectiondrops tofalseand the export panel renders immediately.(
selectedAnnotationIdandselectedBlurIdare intentionally excluded — they are not part ofhasTimelineSelectionand don't affect export panel visibility.)Relation to PR #611
PR #611 fixed a sibling bug: the "Suggest Zooms" bulk path called
setSelectedZoomIdfor every auto-zoom, leaving the last one selected and hiding the export panel. Fix: don't steal selection in the bulk path.This PR covers the remaining path: manual selection via a timeline click. Together they ensure the Download button works from any editor state.
Changes
src/components/video-editor/SettingsPanel.tsxonExportPanelOpenprop; call it in the Download buttononClicksrc/components/video-editor/VideoEditor.tsxonExportPanelOpenthat clears the three timeline selection statesVerification
Summary by CodeRabbit