-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dagit] Allow disabling keyboard shortcuts (#7515)
## Summary We received a report that users with QWERTZ keyboard layouts were inadvertently launching runs from Launchpad by typing <kbd>Alt</kbd>+<kbd>L</kbd>, which is `@` in that keyboard layout and therefore a perfectly reasonable thing to type. Our current assumption in shortcut handling is that `Alt` is not expected to produce characters, which is inaccurate for this keyboard layout. Users may also find that their preferred task manager has keybinding conflicts with Dagit generally. To that end, allow users to disable keyboard shortcuts in Dagit entirely. This PR adds a localStorage setting and a switch in "User Settings" to allow this customization. By default, shortcuts are enabled. If the user turns them off, they are all disabled and holding down a modifier key no longer displays shortcuts on the app. Additionally: - Replace all uses of deprecated `keyCode` with `code`. - Update the modifier key list used to determine whether to display shortcuts on the page. - Fix a bug where control keys weren't displaying shortcuts. ## Test Plan Load Dagit, verify that shortcuts are enabled by default. Go to User Settings, toggle them off. After reload, verify that modifier keys don't show shortcuts on the page and that no shortcuts are enabled. Toggle them back on, verify that they are restored. With shortcuts disabled, switch to a German keyboard layout (QWERTZ), view Launchpad. Type an `@` into the editor, verify that a run isn't inadvertently launched.
- Loading branch information
Showing
7 changed files
with
63 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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