fix(web): handle sidebar shortcut before editors#3921
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5fa8008. Configure here.
ApprovabilityVerdict: Approved Straightforward bug fix that switches the sidebar toggle shortcut listener to capture phase so it executes before rich-text editors that use the same shortcut. Changes are limited in scope with an appropriate opt-out mechanism for keybinding input fields. You can customize Macroscope's approvability policy. Learn more. |

Summary
Closes #3833
Verification
Note
Low Risk
Small keyboard-event ordering change with an explicit opt-out for keybinding capture inputs; no auth, data, or API impact.
Overview
Fixes sidebar toggle (
Mod+Bby default) being swallowed by focused rich-text editors by handling the shortcut earlier in the event pipeline.In
SidebarControl, the globalkeydownlistener now runs in the capture phase sosidebar.togglecanpreventDefault/stopPropagationbefore editors apply bold formatting. The handler also bails out when the event target is inside[data-keybinding-capture], so recording shortcuts in Keybindings settings is not overridden by the global sidebar handler.Keybinding edit inputs (existing and new rows) are tagged with
data-keybinding-capture=""to opt into that exception.Reviewed by Cursor Bugbot for commit a881201. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix sidebar toggle shortcut to use capture phase and skip keybinding inputs
AppSidebarLayout.tsxnow registers on the capture phase so it runs before focused editors consume the shortcut.[data-keybinding-capture].KeybindingsSettings.tsxare marked withdata-keybinding-captureso the sidebar toggle does not fire while editing shortcuts.Macroscope summarized a881201.