Agentic UI: Make the site settings WordPress version field a dropdown - #4284
Conversation
📊 Performance Test ResultsComparing 736afc2 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
…dropdown # Conflicts: # apps/ui/src/data/queries/use-sites.ts
|
When the site is restarting, the WP version is temporarily reverted to the previous one: 1231221312.mov |
@nightnei it should be fixed, can you take another look please? 🙇 |
sejas
left a comment
There was a problem hiding this comment.
Code looks good. I just found a edge case that I think is misleading. When I'm offline the WP version option is disabled and it makes sense, but it also changes from the real value to latest which I think is not correct.
wp-version-offline.mp4
…dropdown # Conflicts: # apps/local/src/index.ts
|
@sejas I fixed that issue, can you take another look please? 🙇
|
|
@bcotrim Confirm that both the bug Antonio reported and mine are fixed.
|
|
@nightnei thanks for catching that, should be fixed now! 🙇 |
nightnei
left a comment
There was a problem hiding this comment.
Thanks Bernardo, now works perfectly and I didn't spot any regression 👍
#4332) ## Related issues - Related to STU-1927 - Follow-up to #4284, which added this behavior to the site settings form ## How AI was used in this PR Implemented with Claude: ported the legacy `wp-version-selector` offline semantics onto the create-site form, reusing the `offline` support `wpVersionField` already gained in #4284. Code and tests reviewed by me. ## Proposed Changes The WordPress version field in the agentic UI **create-site** form didn't account for being offline. Because the version list is fetched over the network, going offline left the field with nothing to offer and it degraded to a free-text input — you could type any version, and only "latest" can actually be installed without a download. - **Offline, the field now locks to "latest"** and is disabled, with the explanation shown as a hover tooltip — the same behavior Studio Classic's create form has, and the same the settings form got in #4284. - **The field stays a dropdown while offline** instead of degrading to free text, so there's no way to type a version that can't be installed. - **A pre-seeded version is forced back to "latest" while offline** — e.g. when a Blueprint suggestion asks for 6.7 — so the form can't submit something that would fail on creation. - **Online behavior is unchanged**, including the existing free-text fallback when the version list can't be fetched while online. | Light | Dark | |--------|--------| | <img width="3248" height="2122" alt="image" src="https://github.com/user-attachments/assets/a2ff49ab-c03a-4414-8168-e34c9975cb25" /> | <img width="3248" height="2122" alt="image" src="https://github.com/user-attachments/assets/d8b3a3d6-47fa-4213-95fc-d4caa4c58645" /> | ## Testing Instructions 1. Launch Studio with the agentic UI and start creating a new site → expand **Advanced settings**. 2. While online, confirm the WordPress version field is unchanged: a dropdown with "latest" plus the available versions, and still editable. 3. Go offline (turn off Wi-Fi), then reopen the create-site form → **Advanced settings**. 4. The WordPress version field should be a **disabled dropdown showing "latest"** — not a text input. Hover it: the tooltip reads "Changing WordPress version requires an internet connection." 5. Still offline, start the flow from a Blueprint that suggests a specific version (e.g. 6.7) — the field should force back to "latest" rather than keeping the suggested version. 6. Create the site while offline and confirm it succeeds on the latest bundled version. 7. Go back online — the field should re-enable and list the fetched versions again. 8. Check the field in **both light and dark** color schemes. ## Pre-merge Checklist - [x] Have you checked for TypeScript, React or other console errors?

Related issues
How AI was used in this PR
Implemented with Claude: reused the existing
useWordPressVersionsquery andwpVersionFieldselect support, then extended them for the settings form and ported the legacy version-selector semantics. Code and tests reviewed by me.Proposed Changes
The WordPress version field in the agentic UI site settings was a free-text input, so you could type anything (including invalid versions). It's now a dropdown of the actually available WordPress versions, with the same semantics as Studio Classic:
isWpAutoUpdating: falseand the version is applied on save.getWpVersionconnector method: IPC handler on desktop, a/sites/:id/wp-versionroute on the local server). If the installed version is older than the fetched offers, it's inserted into the list in the right position so it stays selectable.Testing Instructions
Pre-merge Checklist