Close the IDE with Cmd/Ctrl+E while the code editor has focus - #5129
Open
jadhavgaurav wants to merge 1 commit into
Open
Close the IDE with Cmd/Ctrl+E while the code editor has focus#5129jadhavgaurav wants to merge 1 commit into
jadhavgaurav wants to merge 1 commit into
Conversation
Monaco owns Cmd+E for "Use Selection for Find", so the keydown never reached the application's keyboard system and the shortcut that opened the IDE could not close it again. addKeyboardShortcutOverrides already re-dispatches Cmd/Ctrl+Enter, Cmd/Ctrl+Shift+Enter and Cmd/Ctrl+K on the window; Cmd/Ctrl+E now joins them. Cmd/Ctrl+F is left to Monaco, so the find widget is still a keystroke away. FullScreenIDE registered Escape and Mod+E on one handler that blurs Monaco when the editor has focus and only closes otherwise, so even a delivered Cmd+E would have blurred. The handler is split: Escape keeps stepping out of the editor before it closes, and Mod+E always closes. Closes OpenFn#4959
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes Cmd/Ctrl+E so it closes the IDE while the Monaco editor has focus.
Two things were in the way:
actions.findWithSelection("Use Selection forFind") command, so the keydown never reached the app's keyboard system.
addKeyboardShortcutOverridesalready re-dispatches Cmd/Ctrl+Enter,Cmd/Ctrl+Shift+Enter and Cmd/Ctrl+K on
window; Cmd/Ctrl+E now joins them.Cmd/Ctrl+F is deliberately left to Monaco, so the find widget is still one
keystroke away.
FullScreenIDEregisteredEscape, Control+e, Meta+eon a single handlerthat blurs Monaco when the editor has focus and only closes otherwise. Even
with the key delivered, Cmd+E would have blurred instead of closing. The
handler is now split: Escape keeps its step-out-then-close behaviour, and
Mod+E always closes, mirroring the Mod+E that opened the IDE.
Closes #4959
Validation steps
closes the IDE, as before.
Additional notes for the reviewer
assets/test/monaco/keyboard-overrides.test.tscovers theoverride registration and the dispatched event on both platforms, plus a
guard that Mod+F is not claimed.
FullScreenIDE.keyboard.test.tsxgains a"Mod+E - Close IDE" block. Five of these fail on
mainand pass here (Iverified by reverting the two source files and re-running).
assetschecks run locally: the new and changed files are Prettier-clean andadd no new ESLint or
tsc --project tsconfig.browser.jsonerrors (both filesalready carry pre-existing errors; the counts are identical before and
after). I could not run
mixchecks: there is no Elixir toolchain on thismachine, and nothing in this change touches Elixir.
addKeyboardShortcutOverridesis also used by the manual run panel's customdataclip editor, so Mod+E closes the IDE from there too. That seemed right;
say the word if you'd rather scope it to the job editor.
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer) — n/a, client-sidekeyboard handling only