feat: add keyboard shortcut (Alt+Shift+C) to toggle Component Inspector#1090
Open
JamesGoslings wants to merge 1 commit intovuejs:mainfrom
Open
feat: add keyboard shortcut (Alt+Shift+C) to toggle Component Inspector#1090JamesGoslings wants to merge 1 commit intovuejs:mainfrom
JamesGoslings wants to merge 1 commit intovuejs:mainfrom
Conversation
Closes vuejs#1058 - Add Alt(Option)+Shift+C shortcut in overlay to toggle Component Inspector - Add the same shortcut in client (DevTools iframe) via RPC - Add terminal hint for the new shortcut when Vite dev server starts
✅ Deploy Preview for vue-devtools-docs canceled.
|
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
Closes #1058
This PR adds a keyboard shortcut
Alt(Option)+Shift+Cto toggle the Component Inspector, solving the pain point where clicking to activate the inspector causes pop-ups/overlays to close.Motivation
Many UI libraries auto-close pop-ups on outside click. When using the Component Inspector to locate components inside these pop-ups, clicking activates the inspector but simultaneously closes the pop-up. A keyboard shortcut avoids this issue entirely.
Changes
packages/overlay/src/App.vueAlt+Shift+Ckeydown listener to calltoggleVueInspector()packages/client/src/App.vuepackages/vite/src/vite.tsHow it works
Alt+Shift+D(toggle DevTools panel)Altmaps toOptionon macOS automatically (viae.altKey)vueInspectorSupported/vueInspectorDetectedis trueEscapestill works to exit the inspector (unchanged)Terminal output
Test
Note
The issue author also mentioned customizable shortcuts. Since all existing shortcuts in the project (
Alt+Shift+D,Escape) are hardcoded, adding customization would require architectural changes (e.g. passing user config through virtual modules to runtime). This can be addressed in a follow-up PR if needed.