fix(hub-ui): keep transient-context commands listed in shortcut settings - #222
Merged
Merged
Conversation
Pin `dockOpen`/`paletteOpen` when filtering commands for the shortcut settings list, instead of evaluating `when` against the live context. Those two flags are transient dispatch state (close-panel's `!paletteOpen` exists to hand Escape to the palette, not to mark the command unbindable), so filtering by their live values dropped permanently bindable rows like Close Panel the moment the command palette opened. Ports vitejs/devtools#524 by @SaKaNa-Y to this fork's equivalent file after the v0.9 migration. Co-authored-by: SaKaNa-Y <15715093608@163.com>
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Context
Ports vitejs/devtools#524 ("fix(core): keep transient-context commands listed in shortcut settings") by @SaKaNa-Y to this fork's equivalent file after the v0.9 migration moved
SettingsShortcuts.vuefrompackages/core/src/client/webcomponents/components/views-builtin/(vitejs/devtools) topackages/hub-ui/src/client/components/views-builtin/(here).Problem
SettingsShortcuts.vuefiltered the shortcut list withfilterCommandsByWhen(commandsCtx.commands, props.context.when.context), evaluating each command'swhenclause against the live context. The Close Panel command'swhen: 'dockOpen && !paletteOpen'exists so Escape defers to the command palette while it's open — it doesn't mean Close Panel becomes unbindable. But because the settings page reads the livepaletteOpenflag, opening the Command Palette (Ctrl+K) made Close Panel'swhenevaluate false and the row vanished from the shortcut settings list, then reappeared once the palette closed.Fix
Pin the transient dispatch flags (
dockOpen: true,paletteOpen: false) when filtering commands for this page, since it's only reachable with the dock open and the palette closed anyway.popupOpenandclientTypestay live — those describe whether a command can exist at all (e.g. dock-mode commands still correctly disappear while the dock is detached into a popup).Closes #210
Co-authored-by: SaKaNa-Y 15715093608@163.com
This PR was created with the help of an agent.