From 37eaacc07b5671f4dfacd3bf772fac8a7d53199a Mon Sep 17 00:00:00 2001 From: auberginewly <3127221787@qq.com> Date: Sat, 23 May 2026 16:13:38 +0800 Subject: [PATCH] fix(export): clear timeline selection when opening export panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #611 which fixed the bulk suggest-zooms path; this covers the manual selection path. --- src/components/video-editor/SettingsPanel.tsx | 7 ++++++- src/components/video-editor/VideoEditor.tsx | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx index d3683976..ef597d22 100644 --- a/src/components/video-editor/SettingsPanel.tsx +++ b/src/components/video-editor/SettingsPanel.tsx @@ -284,6 +284,7 @@ interface SettingsPanelProps { onGifSizePresetChange?: (preset: GifSizePreset) => void; gifOutputDimensions?: { width: number; height: number }; onExport?: () => void; + onExportPanelOpen?: () => void; unsavedExport?: { arrayBuffer: ArrayBuffer; fileName: string; @@ -414,6 +415,7 @@ export function SettingsPanel({ onGifSizePresetChange, gifOutputDimensions = DEFAULT_GIF_SETTINGS.outputDimensions, onExport, + onExportPanelOpen, unsavedExport, onSaveUnsavedExport, selectedAnnotationId, @@ -822,7 +824,10 @@ export function SettingsPanel({ data-testid={getTestId("export-panel-button")} type="button" title={exportPanelMode.label} - onClick={() => setActivePanelMode(exportPanelMode.id)} + onClick={() => { + setActivePanelMode(exportPanelMode.id); + onExportPanelOpen?.(); + }} className={cn( "mt-auto flex h-8 w-8 items-center justify-center rounded-lg border transition-all", activePanelMode === "export" && !hasTimelineSelection diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index b32621c9..bbd043a9 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -2256,6 +2256,11 @@ export default function VideoEditor() { : getAspectRatioValue(aspectRatio), )} onExport={handleOpenExportDialog} + onExportPanelOpen={() => { + setSelectedZoomId(null); + setSelectedTrimId(null); + setSelectedSpeedId(null); + }} selectedAnnotationId={selectedAnnotationId} annotationRegions={annotationOnlyRegions} onAnnotationContentChange={handleAnnotationContentChange}