Skip to content

fix(editor): close the clip picker on an outside click - #464

Merged
EtienneLescot merged 1 commit into
mainfrom
claude/popover-close-outside-click-8e31ef
Aug 22, 2026
Merged

fix(editor): close the clip picker on an outside click#464
EtienneLescot merged 1 commit into
mainfrom
claude/popover-close-outside-click-8e31ef

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The "Edit clip" popover (clip picker, shown when a project has more than one clip) previously only closed by selecting a clip or re-clicking the trigger button — clicking anywhere else left it open.
  • Adds a mousedown-outside listener scoped to the popover's container, matching the pattern LangButton already uses in EditorTopBar.tsx.
  • Needs to be cherry-picked to release/v1.10.0 for 1.10.0.rc2.

Related issue

No linked issue — reported directly in chat.

Type of change

  • Bug fix

Release impact

  • Patch

Desktop impact

  • Not platform-specific

Screenshots / video

UI-only popover behavior change; no visual/styling change. Verified interactively in-browser (see Testing).

Testing

  • npx tsc --noEmit -p . — clean, no errors.
  • npx biome check on both changed files — clean.
  • Manual pass in a running dev server (browser-shim editor, 2-clip fixture): clicking outside the popover closes it; re-clicking the trigger still toggles it closed; selecting a clip still closes the popover and opens the Edit Clip dialog.
  • Added an e2e test (tests/e2e/v4-shell.spec.ts) covering the outside-click case; full suite passes 5/5 (npx playwright test tests/e2e/v4-shell.spec.ts).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • The clip picker now closes when clicking outside of it.
    • Improved picker behavior when opening, closing, and navigating the interface.
  • Tests

    • Added end-to-end coverage to verify that outside clicks close the clip picker.
    • Improved test setup for scenarios involving multiple clips.

It previously only closed by picking a clip or re-clicking the trigger,
matching the mousedown-outside pattern EditorTopBar's LangButton already
uses. Covers it with an e2e test.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d655b3a-1501-4ac6-8e4a-35185dc00dbc

📥 Commits

Reviewing files that changed from the base of the PR and between 80d4663 and 92a976e.

📒 Files selected for processing (2)
  • src/components/ai-edition/v4/FloatingInspector.tsx
  • tests/e2e/v4-shell.spec.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The clip picker now closes when a mouse click occurs outside its container. End-to-end fixtures and tests cover the multi-clip picker flow and outside-click dismissal.

Changes

Clip picker behavior

Layer / File(s) Summary
Outside-click dismissal
src/components/ai-edition/v4/FloatingInspector.tsx
The clip picker uses a container ref and an effect that closes the picker for outside mouse clicks. The document listener is active only while the picker is open and is removed during cleanup.
End-to-end interaction coverage
tests/e2e/v4-shell.spec.ts
The tests add shared asset construction, a two-clip document fixture, variable clip-count waiting, and coverage for closing the picker after clicking the timeline outside it.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 92a97

This localized UI fix closes the clip picker when users click outside it while preserving existing close and selection behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: closing the clip picker when the user clicks outside it.
Description check ✅ Passed The description covers the change, issue status, type, release impact, platform impact, testing, and the absence of visual changes.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/popover-close-outside-click-8e31ef

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.

@EtienneLescot
EtienneLescot merged commit b4d4399 into main Aug 22, 2026
18 checks passed
@EtienneLescot
EtienneLescot deleted the claude/popover-close-outside-click-8e31ef branch August 22, 2026 10:31
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