Repository navigation
fix: close menus on Escape and on a click on the empty top bar - #1034
Conversation
The top bar is the window's drag region, and the OS takes a press there as a caption click that never reaches the page, so the document mousedown that closes the wordmark menu (and the presets popover) missed it. The bar now drops its drag region while one of its menus is open. Fixes #1009
The wordmark menu listened for Escape on its own element, so the key went unheard once focus had left it: a press on the menu's padding or a separator drops focus to <body>. It now listens on the document, as the dialogs do, hands focus back to the trigger and stops the key there. The HUD popovers already closed on Escape, but dropped focus to <body> when it was inside them; it now goes back to the button that opened them. The colour popover (Radix) already closes and refocuses its swatch; a test pins it. Fixes #1015
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughEditor menus and launch popovers now restore focus to their triggers when Escape closes them. The editor top bar disables its drag region while a menu is expanded. Tests cover these interactions and color-picker focus restoration. ChangesPopover dismissal and focus behavior
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The identified focus concern does not block merging. Real Windows caption-click behavior remains unverified, but no failure has been established. 🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Full details: Out of Scope Changes checkExplanation The diff also changes Escape handling and focus return in Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Summary
Empty top bar (#1009)
Escape (#1015)
<body>. It now listens on the document like the dialogs, refocuses the trigger and stops the key.<body>.Related issue
Closes #1009
Part of #1015. Left open: keyboard navigation in the HUD language menu, and a macOS check of Escape on the HUD and the colour popover, which did not reproduce in Chromium.
Type of change
Release impact
Desktop impact
Testing
app-regionisno-dragwhile a menu is open.🤖 Generated with Claude Code