Skip to content
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: consider bringing back more context to names of commands #54230

Open
annezazu opened this issue Sep 6, 2023 · 16 comments · May be fixed by #54366
Open

Command Palette: consider bringing back more context to names of commands #54230

annezazu opened this issue Sep 6, 2023 · 16 comments · May be fixed by #54366
Assignees
Labels
Needs Design Feedback Needs general design feedback. [Package] Commands /packages/commands [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@annezazu
Copy link
Contributor

annezazu commented Sep 6, 2023

What problem does this address?

In testing out GB 16.6, I'm noticing that it's tricky to know which command to use for patterns, styles, pages as there's not much distinction in the duplicated items:

command.palette.which.commands.to.use.mov

Here's a specific example with Styles (of note, where is the style revision option?):

Screen Shot 2023-09-06 at 12 06 44 PM

With just 6.3, while harder to skim, it's easier to get a sense of what each command will do:

styles.open.command.mov

What is your proposed solution?

I think we need to keep iterating on how verbose these descriptions are. Currently, I found I needed to guess which option might match what I'm trying to do between patterns, styles, and pages. cc @WordPress/gutenberg-design

@annezazu annezazu added Needs Design Feedback Needs general design feedback. [Package] Commands /packages/commands labels Sep 6, 2023
@richtabor
Copy link
Member

Yea, I agree. The tricky part is on these more generic locations, even some with the same icons.

I'm not sure why "Open style revisions" is now just "Styles" though — that doesn't seem right.

Here's an issue on adding context to post types: #51505

@richtabor
Copy link
Member

And templates should be clearly identified as templates:

CleanShot 2023-09-06 at 15 48 37

Why I leaned towards this exploration in #53192 (comment), where the category/type/source could be exposed like "Templates > Index":

image

@jameskoster
Copy link
Contributor

I know we initially decided against this, but I still think the command palette could benefit from more organisation patterns in order for it to scale.

commandpalette

@annezazu
Copy link
Contributor Author

annezazu commented Sep 7, 2023

Yeah, I am feeling that latter design might be helpful to explore at this stage.

@richtabor
Copy link
Member

Or even just the context on the right side.

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 8, 2023
@richtabor
Copy link
Member

What about if we just append the context to the title? I.e. "Index template" instead of "Index"?

CleanShot 2023-09-11 at 19 19 33

@richtabor richtabor linked a pull request Sep 12, 2023 that will close this issue
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 12, 2023
@t-hamano
Copy link
Contributor

What about if we just append the context to the title? I.e. "Index template" instead of "Index"?

I think this issue needs to be considered for localization. Depending on the language, the word order may not always be {template-part-name} template part or {pattern-name} pattern. Words may be reversed, words may be hyphenated, and words may not be lowercased.

The following is an example of a pattern description.

English (en)

Header pattern

en

French (fr_FR)

composition Header

fr_FR

German (de_DE)

Header-Vorlage

de_DE

Italiano (it_IT)

pattern Header

it_IT

@jameskoster
Copy link
Contributor

Additionally it wouldn't work so well for other post types "Hello World post" is a bit strange. It would produce a lot of repetition too. Groups with headings solves those issues. The headings could even drill down into contextual views:

commandpalette

@richtabor
Copy link
Member

I think this issue needs to be considered for localization.

Yea, I'll push @youknowriad's suggestion here.

@richtabor
Copy link
Member

richtabor commented Sep 12, 2023

Groups with headings solves those issues.

I think we can solve it without having to split up the command list, keeping the flow predictable and simple. I don't personally mind appended template/template part.

But also the text on the right side could be helpful (#53192), especially if folks start adding third-party commands. It's an extra affordance to help identify what the command is/where it's from, rather than if it's a command or shortcut.

For templates, we could have "Templates" as the extra affordance.

@jameskoster
Copy link
Contributor

Yeah there's probably many ways to slice it.

It's an extra affordance to help identify what the command is/where it's from, rather than if it's a command or shortcut.

Might be worth trying this. Having the identifier in a consistent position seems way more scannable compared to the suffix. Makes the localisation element simpler too.

@jameskoster
Copy link
Contributor

@richtabor unsure if this is what you meant, but it could work:

commandpalette2

It solves all the issues with the suffix approach, and plays nicely with the third-party identification pattern you proposed.

@richtabor
Copy link
Member

@richtabor unsure if this is what you meant, but it could work:

Yea I think so.

@annezazu
Copy link
Contributor Author

annezazu commented Sep 27, 2023

More food for thought with the Command Palette from the FSE Outreach Program's Final Touches call for testing:

It would be awesome to have more information about the current state of a toggle, “Disable distraction free mode” instead of “Toggle distraction free mode.” Or maybe make the icon of the active toggle reflect its state by adding a black background like the Settings or Styles buttons do.

& more feedback:

Using the Command Palette. I write Portfolio and get up two Portfolios that have two different icons. One that looks like a post/page and the other as if it is a template part. Hovering over both it would be nice if it said something like: Portfolio page and the other Portfolio template part. To strengthen the meaning of the icons I see.

@danielbachhuber
Copy link
Member

On a WordPress multisite install, it would be nice to have an affordance for selecting a site to run the command on.

@SaxonF
Copy link
Contributor

SaxonF commented Oct 10, 2023

Grouping is worth revisiting. cmdk has <Command.Group heading="Letters">. This works quite well for other products like Linear and Vercel.

linear-command.mp4
vercel-command.mp4

You can also see nested commands which would resolve scenarios like @danielbachhuber multisite or digging into a post type commands without navigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback. [Package] Commands /packages/commands [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants