Skip to content

fix(export): clear timeline selection when opening export panel#645

Open
auberginewly wants to merge 1 commit into
siddharthvaddem:mainfrom
auberginewly:fix/export-panel-hidden-after-zoom-select
Open

fix(export): clear timeline selection when opening export panel#645
auberginewly wants to merge 1 commit into
siddharthvaddem:mainfrom
auberginewly:fix/export-panel-hidden-after-zoom-select

Conversation

@auberginewly
Copy link
Copy Markdown
Contributor

@auberginewly auberginewly commented May 23, 2026

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

SettingsPanel computes:

const hasTimelineSelection = Boolean(selectedZoomId || selectedTrimId || selectedSpeedId);

Both the export button's active highlight and the export panel content are gated on !hasTimelineSelection:

// button highlight
activePanelMode === "export" && !hasTimelineSelection ? "active" : "inactive"

// panel content
{activePanelMode === "export" && !hasTimelineSelection && ( ... )}

When the user clicks a zoom region, selectedZoomId becomes non-null in VideoEditor. Clicking the Download button only calls setActivePanelMode("export") (local SettingsPanel state) — it does not clear the selection in VideoEditor. So hasTimelineSelection stays true and the export panel never renders.

Fix

Add an onExportPanelOpen callback prop to SettingsPanel. When the Download button is clicked, the callback fires alongside the local mode switch, clearing selectedZoomId, selectedTrimId, and selectedSpeedId in VideoEditor so hasTimelineSelection drops to false and the export panel renders immediately.

// VideoEditor.tsx
onExportPanelOpen={() => {
  setSelectedZoomId(null);
  setSelectedTrimId(null);
  setSelectedSpeedId(null);
}}

(selectedAnnotationId and selectedBlurId are intentionally excluded — they are not part of hasTimelineSelection and don't affect export panel visibility.)

Relation to PR #611

PR #611 fixed a sibling bug: the "Suggest Zooms" bulk path called setSelectedZoomId for 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

File Change
src/components/video-editor/SettingsPanel.tsx Add onExportPanelOpen prop; call it in the Download button onClick
src/components/video-editor/VideoEditor.tsx Pass onExportPanelOpen that clears the three timeline selection states

Verification

  1. Load a video in the editor
  2. Add a zoom region and click it — zoom settings panel appears
  3. Click the Download (↓) button in the left rail
  4. Expected: export panel appears immediately, zoom deselected
  5. Repeat with a trim region and a speed region — same result

Summary by CodeRabbit

  • Bug Fixes
    • Timeline selections (trim, zoom, speed) are now automatically cleared when opening the export panel, preventing accidental edits or lingering selection state during export.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09da2566-f8d1-41e5-ad0c-7f5bdbcd57c0

📥 Commits

Reviewing files that changed from the base of the PR and between 85bbe5f and 37eaacc.

📒 Files selected for processing (2)
  • src/components/video-editor/SettingsPanel.tsx
  • src/components/video-editor/VideoEditor.tsx

📝 Walkthrough

Walkthrough

SettingsPanel gains an optional onExportPanelOpen prop and calls it when the export panel is opened. VideoEditor passes a handler that clears selectedZoomId, selectedTrimId, and selectedSpeedId when export is activated.

Changes

Export Panel Callback Integration

Layer / File(s) Summary
Export callback contract and selection clearing
src/components/video-editor/SettingsPanel.tsx, src/components/video-editor/VideoEditor.tsx
SettingsPanelProps adds onExportPanelOpen?: () => void; SettingsPanel destructures and invokes it on export button click; VideoEditor passes a handler that resets selectedZoomId, selectedTrimId, and selectedSpeedId.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly Related PRs

  • siddharthvaddem/openscreen#611: Also manages timeline selection state around export visibility, specifically preventing selectedZoomId from being set during "Suggest Zooms" operations.

Suggested Reviewers

  • siddharthvaddem

Poem

🎬 export opens, selections flee,
zoom and trim take a coffee break,
speed id slips off quietly,
UI breathes, ready to bake. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly describes the main fix: clearing timeline selection when the export panel opens, which directly addresses the bug preventing the Download button from working.
Description check ✅ Passed Description is comprehensive and well-structured, covering problem, root cause, fix, and verification steps. It includes context with PR #611 and detailed code examples. Follows most template sections effectively despite not using exact template format.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

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.
@auberginewly auberginewly force-pushed the fix/export-panel-hidden-after-zoom-select branch from 85bbe5f to 37eaacc Compare May 23, 2026 08:17
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.

1 participant