From 9e730c6b6c8ec3e36d48a1c4fec3caf391ae32f5 Mon Sep 17 00:00:00 2001 From: Mitchell Austin Date: Thu, 29 Jun 2023 21:13:12 -0700 Subject: [PATCH 1/2] =?UTF-8?q?Revise=20use=20of=20=E2=80=9Ccommand=20menu?= =?UTF-8?q?=E2=80=9D=20to=20=E2=80=9Ccommand=20palette=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dropping "global" where it was used as well. --- packages/commands/README.md | 4 ++-- packages/commands/src/components/command-menu.js | 6 +++--- packages/commands/src/hooks/use-command-loader.js | 2 +- packages/commands/src/hooks/use-command.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/commands/README.md b/packages/commands/README.md index 130812664368ff..c6504ff638cdea 100644 --- a/packages/commands/README.md +++ b/packages/commands/README.md @@ -38,7 +38,7 @@ _Type_ ### useCommand -Attach a command to the Global command menu. +Attach a command to the command palette. _Parameters_ @@ -46,7 +46,7 @@ _Parameters_ ### useCommandLoader -Attach a command loader to the Global command menu. +Attach a command loader to the command palette. _Parameters_ diff --git a/packages/commands/src/components/command-menu.js b/packages/commands/src/components/command-menu.js index 9f59db3f6f53cb..b4a828f34303db 100644 --- a/packages/commands/src/components/command-menu.js +++ b/packages/commands/src/components/command-menu.js @@ -155,7 +155,7 @@ export function CommandMenu() { registerShortcut( { name: 'core/commands', category: 'global', - description: __( 'Open the global command menu' ), + description: __( 'Open the command palette' ), keyCombination: { modifier: 'primary', character: 'k', @@ -192,7 +192,7 @@ export function CommandMenu() { }; useEffect( () => { - // Focus the command menu input when mounting the modal. + // Focus the command palette input when mounting the modal. if ( isOpen ) { commandMenuInput.current.focus(); } @@ -211,7 +211,7 @@ export function CommandMenu() { __experimentalHideHeader >
- +
Date: Thu, 29 Jun 2023 21:15:44 -0700 Subject: [PATCH 2/2] =?UTF-8?q?Find=20=E2=80=9Ccommand=20center=E2=80=9D?= =?UTF-8?q?=20and=20replace=20with=20=E2=80=9Ccommand=20palette=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/commands/src/hooks/use-command-context.js | 2 +- packages/commands/src/store/actions.js | 4 ++-- packages/commands/src/store/reducer.js | 4 ++-- packages/edit-site/src/components/layout/index.js | 2 +- packages/edit-site/src/components/site-hub/index.js | 2 +- test/e2e/specs/site-editor/command-center.spec.js | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/commands/src/hooks/use-command-context.js b/packages/commands/src/hooks/use-command-context.js index e0efde0ec8759c..ac41118241fccd 100644 --- a/packages/commands/src/hooks/use-command-context.js +++ b/packages/commands/src/hooks/use-command-context.js @@ -11,7 +11,7 @@ import { store as commandsStore } from '../store'; import { unlock } from '../lock-unlock'; /** - * Sets the active context of the command center + * Sets the active context of the command palette * * @param {string} context Context to set. */ diff --git a/packages/commands/src/store/actions.js b/packages/commands/src/store/actions.js index f461914a7cef64..f6d9105dd2b906 100644 --- a/packages/commands/src/store/actions.js +++ b/packages/commands/src/store/actions.js @@ -84,7 +84,7 @@ export function unregisterCommandLoader( name ) { } /** - * Opens the command center. + * Opens the command palette. * * @return {Object} action. */ @@ -95,7 +95,7 @@ export function open() { } /** - * Closes the command center. + * Closes the command palette. * * @return {Object} action. */ diff --git a/packages/commands/src/store/reducer.js b/packages/commands/src/store/reducer.js index c2bb73b189f16b..eba6346f3f2c4c 100644 --- a/packages/commands/src/store/reducer.js +++ b/packages/commands/src/store/reducer.js @@ -63,7 +63,7 @@ function commandLoaders( state = {}, action ) { } /** - * Reducer returning the command center open state. + * Reducer returning the command palette open state. * * @param {Object} state Current state. * @param {Object} action Dispatched action. @@ -82,7 +82,7 @@ function isOpen( state = false, action ) { } /** - * Reducer returning the command center's active context. + * Reducer returning the command palette's active context. * * @param {Object} state Current state. * @param {Object} action Dispatched action. diff --git a/packages/edit-site/src/components/layout/index.js b/packages/edit-site/src/components/layout/index.js index 3398ec332c7662..bbe9d7ff707ca6 100644 --- a/packages/edit-site/src/components/layout/index.js +++ b/packages/edit-site/src/components/layout/index.js @@ -143,7 +143,7 @@ export default function Layout() { headerAnimationState = canvasMode; // edit, view, init } - // Sets the right context for the command center + // Sets the right context for the command palette const commandContext = canvasMode === 'edit' && isEditorPage ? 'site-editor-edit' diff --git a/packages/edit-site/src/components/site-hub/index.js b/packages/edit-site/src/components/site-hub/index.js index 5162091f91d428..d4f68943c46ae5 100644 --- a/packages/edit-site/src/components/site-hub/index.js +++ b/packages/edit-site/src/components/site-hub/index.js @@ -174,7 +174,7 @@ const SiteHub = forwardRef( ( props, ref ) => { className="edit-site-site-hub_toggle-command-center" icon={ search } onClick={ () => openCommandCenter() } - label={ __( 'Open command center' ) } + label={ __( 'Open command palette' ) } /> ) } diff --git a/test/e2e/specs/site-editor/command-center.spec.js b/test/e2e/specs/site-editor/command-center.spec.js index 0ee6d77d3b3018..9d22248bc2362a 100644 --- a/test/e2e/specs/site-editor/command-center.spec.js +++ b/test/e2e/specs/site-editor/command-center.spec.js @@ -3,7 +3,7 @@ */ const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); -test.describe( 'Site editor command center', () => { +test.describe( 'Site editor command palette', () => { test.beforeAll( async ( { requestUtils } ) => { await requestUtils.activateTheme( 'emptytheme' ); } ); @@ -17,11 +17,11 @@ test.describe( 'Site editor command center', () => { await admin.visitSiteEditor(); } ); - test( 'Open the command center and navigate to the page create page', async ( { + test( 'Open the command palette and navigate to the page create page', async ( { page, } ) => { await page - .getByRole( 'button', { name: 'Open command center' } ) + .getByRole( 'button', { name: 'Open command palette' } ) .focus(); await page.keyboard.press( 'Meta+k' ); await page.keyboard.type( 'new page' ); @@ -36,11 +36,11 @@ test.describe( 'Site editor command center', () => { ).toBeVisible(); } ); - test( 'Open the command center and navigate to a template', async ( { + test( 'Open the command palette and navigate to a template', async ( { page, } ) => { await page - .getByRole( 'button', { name: 'Open command center' } ) + .getByRole( 'button', { name: 'Open command palette' } ) .click(); await page.keyboard.type( 'index' ); await page.getByRole( 'option', { name: 'index' } ).click();