-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Palette: Mapping Contextual Commands #50407
Comments
A WIP, and some may not be entirely possible just yet. Let's riff on these to get going. |
Nice, this looks like a great start.
|
✅
Good idea. I'll add one for "Manage categories" and another for "Add new category template".
I wanted to focus on the actual commands this go around, but recent "context" will be good. |
@youknowriad Do we have sub-commands yet, or was that still up in the air? |
🤞 We can add a command for Global styles revisions for the site editor soon! |
@richtabor We don't have sub commands yet. Also, I'd like some clarifications about how the "contextual commands" work. For instance:
I'd love also to get some designs/mockups about how these contextual commands should look. |
This one could depend on #49980. That is, if you are in the site editor, but in the "page editing" portion, you can show one set of commands, whereas inside the template editing "mode", you'd show the others.
Can we be aware of what's selected in the canvas? My instinct when thinking of contextuality, it's related either to what is selected, or what mode you are in. So Site editor > select header > edit header in focus mode — the last two steps, or at least the last step, could be the context that defines the suggestions. CC: @richtabor in case you have clarification or mockups going over this. |
My question is about when we have more than one context, do we accumulate the contextual commands or do we force the command center to only show one context at time (the more focused I guess) |
My instinct would also be that we always replace the suggestions with the most focused context. |
Perhaps the "Site Editor" table of suggestions above is throwing us a bit. Currently you have to be in the Edit View to trigger the command center (for now, at least). These are the fallback suggestions (the ones marked as suggestions). I see these as a tree of context. If I'm in the Site Editor, editing a template, I will have the "Editing a template" commands suggested/prioritized, but I can still access the "Open Style Book" command if I type in "Open S". "Open Style Book" is limited to the Site Editor top-level context, while "Replace template" is limited to the "Editing a template" context within the Site Editor. The tree is important, especially as we consider bringing the Command Center elsewhere, like the Post Editor. As in that scenario there would be commands (suggested, or otherwise) that should be scoped to the Post Editor (and commands, like "Open Style Book" which should not be available in the Post Editor). Regarding the suggestions, I think of them as a flag of sorts. Flagging a command within a specific context should surface it as an available command when I press CMD+K. Does that clear it up? |
I think focusing on where you're at in the editing experience is appropriate. If I'm in an isolated mode of the template part ( If I'm editing a template, then I am in the If I don't have a specific context, i.e. I clicked on "Templates" from the Site Editor navigation ( Commands with more than one contextWe can add more contexts as we flesh this out, say for the Templates view we'd have suggested commands for Adding a new template and Managing all templates, which would be suggested in this view (though they are also available in the Edit Template view). |
Do we have any designs/mockups about the context commands within the command center ? I'm also struggling to define the API to work with context. Do we offer these:
and internally keep a tree of contexts. or do we offer just this:
|
Yup, there's a Figma doc here: |
I'm not aware of all the nuances of the API, but the above seems good to me. And probably the context should be an object to pass additional properties that we're going to use in the future. |
@ntsekouras The downside of that API is that the third party devs can't add their own context unless they know how to restore the right context (duplicate the code we have to orchestrate and choose the right context) |
Should we open a separate issue for displaying 'recently edited' shortcuts when editing a page, template, or template part? |
I'm not sure how useful the "Edit header" shortcuts are when editing a template, given you can already see and click on the template parts via the canvas. Since we want to include shortcuts to X recently edited, the palette is going to get quite large: What do you think @richtabor ? |
Passing on some feedback from the FSE Outreach Program's latest call for testing:
In particular, it is odd that you can search for template parts, including custom ones, but not general patterns. As patterns take center stage with the Pattern section, I think we should consider adding this. |
Another consideration for "Editing a postType": direct access to revisions. |
Should we surface management actions in site editor sections? IE in Templates you'd see "Add new template", "Manage all templates"? Same for Pages, Patterns, etc. |
As part of the twenty fifth call for testing, adding a command to open list view was suggested, along with a few other ideas:
Another suggestion to add List View in:
|
I'd love to have a command to open/expand a block's advanced panel settings. It makes sense to open advanced options easily with a command or at least make it available to search for. |
A good place to start on this one might be to show the current context. We're already showing initial commands based on this context. |
Tentative mapping out of contextual commands for the Command Center.
These are commands that should be suggested and prioritized when the Command Center is invoked from specific flows (currently within the Site Editor). There are likely more to bake in, but these will help us build it out.
If you have ideas for more, do share them.
Site Editor
Editing a template
Editing a template part
Editing a postType
Editing a category template
/edit-tags.php?taxonomy=category
viewcc @youknowriad @WordPress/gutenberg-design
The text was updated successfully, but these errors were encountered: