Skip to content

fix: prevent shortcut editor from creating override when unchanged#282

Merged
antfu merged 1 commit intovitejs:mainfrom
SaKaNa-Y:fix/shortcut-editor-no-false-override
Apr 8, 2026
Merged

fix: prevent shortcut editor from creating override when unchanged#282
antfu merged 1 commit intovitejs:mainfrom
SaKaNa-Y:fix/shortcut-editor-no-false-override

Conversation

@SaKaNa-Y
Copy link
Copy Markdown
Contributor

@SaKaNa-Y SaKaNa-Y commented Apr 6, 2026

Description

Compare edited key against default before saving. Skip writing to
commandShortcuts when the value matches the preset, avoiding the
false "modified" indicator (reset icon) on unchanged shortcuts.

Linked Issues

Additional context

  Compare edited key against default before saving. Skip writing to
  commandShortcuts when the value matches the preset, avoiding the
  false "modified" indicator (reset icon) on unchanged shortcuts.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 6, 2026

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@282

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@282

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@282

@vitejs/devtools-rpc

npm i https://pkg.pr.new/@vitejs/devtools-rpc@282

@vitejs/devtools-self-inspect

npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@282

commit: 014aac2

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the shortcuts editor UX by avoiding writing a commandShortcuts override when the edited shortcut matches the command’s default keybinding, preventing unchanged shortcuts from being flagged as “modified” (showing the reset icon).

Changes:

  • Add a helper to resolve a command’s default keybinding from the commands registry.
  • Update shortcut save logic to delete an existing override (or skip writing) when the saved key equals the default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@antfu antfu merged commit 2870143 into vitejs:main Apr 8, 2026
9 of 10 checks passed
@SaKaNa-Y SaKaNa-Y deleted the fix/shortcut-editor-no-false-override branch April 8, 2026 03:02
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.

3 participants