From 7567c001965336be0ab07d760a2d8cc228eab182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Cs=C3=A9csey?= Date: Thu, 27 Aug 2026 10:45:17 +0100 Subject: [PATCH 01/15] Rename the "latest" WordPress version option to "Auto-update" and name the installed version --- apps/cli/commands/config/set.ts | 4 +- apps/cli/commands/site/create.ts | 4 +- .../components/wp-version-selector/index.tsx | 15 +++-- .../add-site/components/create-site-form.tsx | 3 +- .../site-settings/edit-site-details.tsx | 3 + .../tests/edit-site-details.test.tsx | 25 +++++++ .../src/components/site-fields/index.test.ts | 67 +++++++++++++++++++ apps/ui/src/components/site-fields/index.ts | 9 ++- .../site-fields/wp-version-control.tsx | 20 +++--- .../site-overview-view/index.test.tsx | 25 ++++++- .../components/site-settings-view/index.tsx | 10 ++- .../common/lib/wordpress-version-labels.ts | 26 +++++++ 12 files changed, 188 insertions(+), 23 deletions(-) create mode 100644 apps/ui/src/components/site-fields/index.test.ts create mode 100644 packages/common/lib/wordpress-version-labels.ts diff --git a/apps/cli/commands/config/set.ts b/apps/cli/commands/config/set.ts index e07df34860..55e9f208a4 100644 --- a/apps/cli/commands/config/set.ts +++ b/apps/cli/commands/config/set.ts @@ -423,7 +423,9 @@ export const registerCommand = ( yargs: StudioArgv ) => { } ) .option( 'wp', { type: 'string', - description: __( 'WordPress version' ), + description: __( + 'WordPress version. Use "latest" to let the site auto-update, or pin a version (e.g., "6.4", "6.4.1")' + ), coerce: ( value: string ) => { if ( ! isValidWordPressVersion( value ) ) { throw new ValidationError( diff --git a/apps/cli/commands/site/create.ts b/apps/cli/commands/site/create.ts index f3cbbe0bc5..39ef10181d 100644 --- a/apps/cli/commands/site/create.ts +++ b/apps/cli/commands/site/create.ts @@ -564,7 +564,9 @@ export const registerCommand = ( yargs: StudioArgv ) => { } ) .option( 'wp', { type: 'string', - describe: __( 'WordPress version (e.g., "latest", "6.4", "6.4.1")' ), + describe: __( + 'WordPress version. Use "latest" to let the site auto-update, or pin a version (e.g., "6.4", "6.4.1")' + ), defaultDescription: DEFAULT_WORDPRESS_VERSION, coerce: coerceWpVersion, } ) diff --git a/apps/studio/src/components/wp-version-selector/index.tsx b/apps/studio/src/components/wp-version-selector/index.tsx index 2f17ba3229..d38c078f45 100644 --- a/apps/studio/src/components/wp-version-selector/index.tsx +++ b/apps/studio/src/components/wp-version-selector/index.tsx @@ -1,4 +1,5 @@ import { DEFAULT_WORDPRESS_VERSION, MINIMUM_WORDPRESS_VERSION } from '@studio/common/constants'; +import { getAutoUpdateVersionLabel } from '@studio/common/lib/wordpress-version-labels'; import { isWordPressBetaVersion } from '@studio/common/lib/wordpress-version-utils'; import { SelectControl, Icon } from '@wordpress/components'; import { info } from '@wordpress/icons'; @@ -23,6 +24,8 @@ type WPVersionSelectorProps = { fallbackOptions: { label: string; value: string }[]; /** Custom message to show when offline. If not provided, will use the default message */ offlineMessage?: string; + /** Shown in the auto-update label. Only pass it for auto-updating sites. */ + installedVersion?: string; }; export const WPVersionSelector = ( { @@ -33,6 +36,7 @@ export const WPVersionSelector = ( { extraOptions, fallbackOptions, offlineMessage, + installedVersion, }: WPVersionSelectorProps ) => { const { __ } = useI18n(); const isOffline = useOffline(); @@ -76,7 +80,7 @@ export const WPVersionSelector = ( {