Skip to content

[Website] Keep the current WordPress version in the settings dropdown - #4051

Merged
adamziel merged 2 commits into
trunkfrom
preserve-selected-wordpress-version
Jul 14, 2026
Merged

[Website] Keep the current WordPress version in the settings dropdown#4051
adamziel merged 2 commits into
trunkfrom
preserve-selected-wordpress-version

Conversation

@adamziel

@adamziel adamziel commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

This PR keeps the current WordPress version visible in the settings dropdown while the version list reloads.

The list of WordPress versions comes from the running Playground. After changing settings and restarting it, that list can arrive after the form. The form then has a selected version that is not in the dropdown, so the dropdown shows its empty option.

Add the selected version to the options until the list catches up. If it is an older version and the older list is hidden, keep it in the visible list. Do not add a second copy when the version is already present.

This keeps the settings form correct when it moves into the Dock in #3965.

Verified with npm exec nx test playground-website --output-style=static and npm exec nx typecheck playground-website --output-style=static.

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a dedicated options builder so the WordPress version <select> keeps showing the user’s selected version during the window where the runtime “supported versions” index may lag after a reboot.

Changes:

  • Extracted WordPress version option construction into getWordPressVersionOptions(...).
  • Ensured non-listed selected versions can be injected into the options to keep the <select> stable.
  • Added focused Vitest coverage for missing-current-version handling and duplicate prevention.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/playground/website/src/components/site-manager/site-settings-form/wordpress-version-options.ts New shared builder for WordPress version dropdown options, including “keep selected version visible” behavior.
packages/playground/website/src/components/site-manager/site-settings-form/wordpress-version-options.spec.ts New tests validating the options builder behavior for missing versions and duplicates.
packages/playground/website/src/components/site-manager/site-settings-form/unconnected-site-settings-form.tsx Switches the settings form to use the new options builder instead of inlined option construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamziel adamziel changed the title [Website] Keep the selected WordPress version in the settings list Jul 14, 2026
@adamziel
adamziel merged commit 9c81b1f into trunk Jul 14, 2026
53 checks passed
@adamziel
adamziel deleted the preserve-selected-wordpress-version branch July 14, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment