Skip to content

Editor: Hide cmd palette shortcut in document bar when admin bar is shown#79060

Merged
fushar merged 2 commits into
trunkfrom
admin-bar-in-editor-command
Jun 10, 2026
Merged

Editor: Hide cmd palette shortcut in document bar when admin bar is shown#79060
fushar merged 2 commits into
trunkfrom
admin-bar-in-editor-command

Conversation

@fushar

@fushar fushar commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

What?

Follow-up to #77964

When the admin bar is shown in the editor (via the above experiment), the cmd-K icon is no longer necessary.

Why?

Because it's already present in the admin bar. Otherwise, there will be duplicate buttons with the same functionalities that are close by.

How?

Hide the cmd-K shortcut icon from the document bar component in such case.

Testing Instructions

  1. Go to Gutenberg -> Experiments, scroll all the way down, enable the "Toolbar in editor" experiment.
  2. Go to Appearance -> Editor.
  3. Verify that the title no longer shows the cmd-K (/ctrl-K) icon.
  4. Disable the experiment; verify that the cmd-K icon is back.

Screenshots or screencast

Before

image image

After

image image

Use of AI Tools

I used Claude Opus 4.8 to help with the implementation.

@github-actions github-actions Bot added the [Package] Editor /packages/editor label Jun 9, 2026
@fushar fushar added the [Type] Enhancement A suggestion for improvement. label Jun 9, 2026
@fushar fushar marked this pull request as ready for review June 9, 2026 16:27
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: fushar <fushar@git.wordpress.org>
Co-authored-by: arthur791004 <arthur791004@git.wordpress.org>
Co-authored-by: StevenDufresne <dufresnesteven@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Size Change: +44 B (0%)

Total Size: 8.46 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 466 kB +28 B (+0.01%)
build/styles/editor/style-rtl.css 30.5 kB +3 B (+0.01%)
build/styles/editor/style-rtl.min.css 25.9 kB +5 B (+0.02%)
build/styles/editor/style.css 30.5 kB +3 B (+0.01%)
build/styles/editor/style.min.css 25.8 kB +5 B (+0.02%)

compressed-size-action

@StevenDufresne

Copy link
Copy Markdown
Contributor

This PR is doing two things, both meaningful changes to experience:

  • Removing the visual ⌘k landmark.
  • Removing the ability to click on the title.

The title container still looks the same. Users will expect it to function the same. Have we considered visual changes to communicate behavioral changes?

@fushar fushar changed the title Editor: Render document bar as static title when admin bar is shown Editor: Hide cmd palette shortcut in document when admin bar is shown Jun 10, 2026
@fushar fushar changed the title Editor: Hide cmd palette shortcut in document when admin bar is shown Editor: Hide cmd palette shortcut in document bar when admin bar is shown Jun 10, 2026
@fushar

fushar commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Removing the ability to click on the title.
The title container still looks the same. Users will expect it to function the same.

Yeah, you're right, it's not that simple. I think I'm going to play it safe for now -- just hide the shortcut icon as it's the most offending issue.

@github-actions

Copy link
Copy Markdown

Flaky tests detected in 9fde74d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27253890346
📝 Reported issues:

@arthur791004 arthur791004 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make senses to me 👍

padding-left: $grid-unit-30;
.editor-document-bar.has-shortcut & {
@include break-medium() {
padding-left: $grid-unit-30;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would it be better to also change it to padding-inline-start?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While that's semantically correct, I want to avoid doing unrelated changes to make the PR very focused 😄

@jasmussen

Copy link
Copy Markdown
Contributor

For what it's worth, if we will be introducing the adminbar by default inside the editor, then it is worth mid-term to ponder a different interface than the current gray document title blob. From @fcoveram, we have some more breadcrumb-like elements. Not totally polished but looking in this direction:

image

@jasmussen

Copy link
Copy Markdown
Contributor

PR makes sense btw. 👍

@fushar fushar left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it is worth mid-term to ponder a different interface than the current gray document title blob.

Yes, I agree this is not ideal. But I believe the current changes are good for short-term to fix an obviously broken visual. If/when the experiment graduates, we can try to consider better UI for this 😄

padding-left: $grid-unit-30;
.editor-document-bar.has-shortcut & {
@include break-medium() {
padding-left: $grid-unit-30;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While that's semantically correct, I want to avoid doing unrelated changes to make the PR very focused 😄

@fushar fushar merged commit 3427bb2 into trunk Jun 10, 2026
42 of 44 checks passed
@fushar fushar deleted the admin-bar-in-editor-command branch June 10, 2026 08:04
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants