-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NewTab won't leave the Command Palette #7441
Comments
oh no, this is another instance where we need to know the difference between Except not in JSON. In Command.cpp:33-66 |
Hi. I've tried to resolve this, yet I think it can't be since code is acting the way it is. |
@zadjii-msft, @DHowett - so this one is broken for 4 months.. and actually I am not sure when it really worked last time for commands that have action args 😊 Right now I don't see any evidence it ever worked 🤔 So.. I am not sure if it is acceptable.. but cannot we simply replace this mechanism with something more explicit and parse-able. Like adding a dedicated field (aka "hideFromPalette")? Since I am not sure we can call it breaking compatibility |
FYI future readers: #8402 has more investigation in it too. Yea, I think the I'm almost wondering how important hiding default commands is in the first place. It doesn't really seem like we've gotten requests for it. It's not like having default keybindings, where their presence might impact other apps. That would certainly make the design easier. If we didn't need to worry about hiding defaults, we could focus on just hiding commands defined by the user. |
For what it's worth, I'm always for as much customizability as possible. The presence of commands that one has long decided they're never going to use creates a measure of noise and, worse, can often hinder "fluent" use by necessitating more keystrokes for the fuzzy-find search. |
This entirely removes `KeyMapping` from the settings model, and builds on the work done in #9543 to consolidate all actions (key bindings and commands) into a unified data structure (`ActionMap`). ## References #9428 - Spec #6900 - Actions page Closes #7441 ## Detailed Description of the Pull Request / Additional comments The important thing here is to remember that we're shifting our philosophy of how to interact/represent actions. Prior to this, the actions arrays in the JSON would be deserialized twice: once for key bindings, and again for commands. By thinking of every entry in the relevant JSON as a `Command`, we can remove a lot of the context switching between working with a key binding vs a command palette item. #9543 allows us to make that shift. Given the work in that PR, we can now deserialize all of the relevant information from each JSON action item. This allows us to simplify `ActionMap::FromJson` to simply iterate over each JSON action item, deserialize it, and add it to our `ActionMap`. Internally, our `ActionMap` operates as discussed in #9428 by maintaining a `_KeyMap` that points to an action ID, and using that action ID to retrieve the `Command` from the `_ActionMap`. Adding actions to the `ActionMap` automatically accounts for name/key-chord collisions. A `NameMap` can be constructed when requested; this is for the Command Palette. Querying the `ActionMap` is fairly straightforward. Helper functions were needed to be able to distinguish an explicit unbinding vs the command not being found in the current layer. Internally, we store explicitly unbound names/key-chords as `ShortcutAction::Invalid` commands. However, we return `nullptr` when a query points to an unbound command. This is done to hide this complexity away from any caller. The command palette still needs special handling for nested and iterable commands. Thankfully, the expansion of iterable commands is performed on an `IMapView`, so we can just expose `NameMap` as a consolidation of `ActionMap`'s `NameMap` with its parents. The same can be said for exposing key chords in nested commands. ## Validation Steps Performed All local tests pass.
🎉This issue was addressed in #9621, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Add the following to your settings.json:
Expected behavior
This entry does not appear in the Command Palette.
Actual behavior
It appears in the Command Palette after explicitly setting "name" to null.
The text was updated successfully, but these errors were encountered: