Skip to content

Conversation

himanshupathak95
Copy link
Contributor

@himanshupathak95 himanshupathak95 commented Aug 19, 2025

What?

Closes #71258

Adds a "Dashboard" option to the Command Palette that allows users to quickly return to the admin dashboard. The Dashboard command only appears when using the block editor screens, like the post editor or the site editor.

Why?

Currently, there's no option in the Command Palette to return to the wp-admin dashboard when working in editors.

How?

Added a new conditional "Dashboard" command to the useAdminNavigationCommands hook in packages/core-commands/src/admin-navigation-commands.js. The command uses URL detection to only appear in editor contexts.

Testing Instructions

  1. Navigate to the post/site editor
  2. Open the Command Palette using Cmd or Ctrl + K
  3. Type "dashboard" in the search field
  4. Verify the "Dashboard" option appears with a dashboard icon and press Enter
  5. Verify you are redirected to the WordPress admin dashboard

Screencasts

Screen.Recording.2025-08-21.at.14.53.33.mov

@himanshupathak95
Copy link
Contributor Author

I did not quite fully understand the usage of the experimental setting - "Command Palette: enable everywhere", since everything seems to work even after this is kept unchecked.

This comment on the original PR says this should be enabled by default with the GB plugin, so technically, do the settings need to be removed?

cc: @t-hamano

Screen.Recording.2025-08-20.at.04.12.40.1.mov

label: __( 'Dashboard' ),
icon: dashboard,
callback: () => {
document.location.assign( 'index.php' );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

document.location.assign( '/wp-admin/' );

Also works here.

@t-hamano
Copy link
Contributor

#71030 (review) on the original PR says this should be enabled by default with the GB plugin, so technically, do the settings need to be removed?

Sorry, it was my mistake 😅 The setting should be removed. I plan to improve the design of the command palette, so I'll fix it accordingly.

@himanshupathak95 himanshupathak95 marked this pull request as ready for review August 20, 2025 07:11
Copy link

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: himanshupathak95 <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: annezazu <[email protected]>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Package] Core commands labels Aug 20, 2025
@himanshupathak95 himanshupathak95 force-pushed the add/71258-command-palette-dashboard branch from 8090f9b to a531272 Compare August 21, 2025 08:14
@himanshupathak95 himanshupathak95 force-pushed the add/71258-command-palette-dashboard branch from a531272 to 3c95f9f Compare August 22, 2025 07:39
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@t-hamano t-hamano merged commit 7bb094a into WordPress:trunk Aug 23, 2025
71 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.6 milestone Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command Palette: Add "Dashboard" option to return to wp admin
2 participants