-
Notifications
You must be signed in to change notification settings - Fork 711
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
Command Registration Service #174
Comments
Some way to know the current context (as in what item/element/control is currently selected) so the search results of available commands can be contextually relevant. A friendly name for each command, so in XAML or Code Behind, you can easily populate ContextMenus, CommandBarFlyouts, and other commands, from the list of registered commands, and each command can have an icon glyph, keyboard shortcut, tooltip. automation name, etc. Which will apply wherever that command is placed. This will probably need a settings store which manages each command that is added, which a search control (or possibly cortana voice commands) can surface to the user. |
@mdtauk |
These things should be kept in mind as you add (and remove) items through the "Command Registration Service" and how they could be displayed when searching for the command. In settings, the search results display an icon, this could be taken from the UICommand. Office does the same thing If there is some kind of context aspect to searching through the available commands - then you could choose to only show commands related to the current focus/selection - or perhaps show all results, but disable those not related to the context. As to how to integrate the notion of context. Perhaps the service could have groups of UICommands, and then you "assign" a group name to a control which then allows the Command Search Box, to filter the commands it presents? So something like CommandGroupName = "ImageCommands". |
I guess this ties into #81 as well then? I think a big challenge with commands like this too, is global keyboard shortcut registration. If the command as part of this system could enable a keyboard accelerator which could be intercepted from anywhere in the app to execute, that'd be super helpful. Right now, I have some issues with things in WebView or other text controls where I have to detect the keyboard input to re-implement my shortcut as the app doesn't get it for it's own shortcuts. |
If the CommandRegistrationService included a global context notion, it could take the list of context aware commands, and enable or disable Keyboard Shortcuts that are applicable to the current context. Maybe there needs to be Global Command lists, as well as Contextual Command lists. The Context may be generic as well as specific. So if the current context object is an image, then the CommandLists with a SupportedContext of image - would become active. When we group commands in this way, why not allow the future UWP Ribbon control #168 to have Contextual tabs display these commands in the same way Office display image layout controls when an image is selected? |
Proposal: Command Registration Service
Summary
A pattern is emerging where application capabilities are being exposed via a common search experience at the top level of the UX. This search bar is often included near the title bar or within a command region, like the Ribbon. VS Code as well as other apps have adopted this pattern. In those apps it has been met with good customer feedback.
Additionally, many times these search regions utilize telemetry to make command suggestions. Sometimes they even utilize various flavors of AI to determine the set of items that are suggested. While I believe it would be advantageous to offer an 'intelligent commanding suggestion system' within WinUI, providing a common way to even register commands within an app seems like a logical first step.
TL / DR
This feature proposal covers a command registration service, which is a first building block for more advanced 'command searching' and ' intelligent command suggestion' features.
Rationale
Creating this registration system would enable:
Functional Requirements
Open Questions
The text was updated successfully, but these errors were encountered: