Skip to content

Agentic UI: Make the site settings WordPress version field a dropdown - #4284

Merged
bcotrim merged 12 commits into
trunkfrom
stu-1927-wp-version-dropdown
Jul 23, 2026
Merged

Agentic UI: Make the site settings WordPress version field a dropdown#4284
bcotrim merged 12 commits into
trunkfrom
stu-1927-wp-version-dropdown

Conversation

@bcotrim

@bcotrim bcotrim commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Implemented with Claude: reused the existing useWordPressVersions query and wpVersionField select 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:

  • "latest" (auto-update) is the first option and is preselected for auto-updating sites. Picking it saves the site as auto-updating, with no version forwarded.
  • Picking a specific version (stable, beta, or nightly) pins the site: isWpAutoUpdating: false and the version is applied on save.
  • Pinned sites show their actual installed version, read from the site's files like Classic does (new getWpVersion connector method: IPC handler on desktop, a /sites/:id/wp-version route 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.
  • The version is only forwarded on save when the user actually changed it — matching Classic's settings modal. Previously any unrelated save of a pinned site forwarded a version and could trigger a WordPress reinstall/upgrade.
  • Offline, the field locks to "latest" — the only version we can apply without a download — and is disabled, with the explanation shown as a hover tooltip like the legacy selector. The field always stays a dropdown: when the version list can't be fetched it offers "latest" (plus the site's installed version) instead of degrading to free text.
  • The dropdown uses the same grouping as the legacy selector: Auto-updating / Beta & Nightly / Stable Versions.
Online Offline
image image

Testing Instructions

  1. Launch Studio with the agentic UI and open a site's overview → Settings tab.
  2. Check the WordPress version field is a dropdown with "latest" preselected, followed by beta/nightly and stable versions.
  3. Pick a specific version and save — the site should restart pinned to that version (auto-updates disabled).
  4. Reopen Settings: the field shows the pinned site's actual installed version.
  5. Change an unrelated field (e.g. site name) on the pinned site and save — WordPress should not be reinstalled or upgraded.
  6. Switch the version back to "latest" and save — the site should be auto-updating again.
  7. Go offline (e.g. turn off Wi-Fi): the field forces "latest", is disabled, and hovering it shows a tooltip explaining that changing the version requires an internet connection.
  8. Create-site form: confirm its WordPress version dropdown still behaves as before (no changes intended there).
  9. Verify the Settings tab in both light and dark mode.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@bcotrim bcotrim self-assigned this Jul 21, 2026
@bcotrim
bcotrim marked this pull request as draft July 21, 2026 16:46
@wpmobilebot

wpmobilebot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 736afc2 vs trunk

app-size

Metric trunk 736afc2 Diff Change
App Size (Mac) 1362.04 MB 1362.05 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 736afc2 Diff Change
load 1082 ms 1059 ms 23 ms ⚪ 0.0%

site-startup

Metric trunk 736afc2 Diff Change
siteCreation 7023 ms 7020 ms 3 ms ⚪ 0.0%
siteStartup 2353 ms 2374 ms +21 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim
bcotrim marked this pull request as ready for review July 21, 2026 20:16
…dropdown

# Conflicts:
#	apps/ui/src/data/queries/use-sites.ts
@nightnei

Copy link
Copy Markdown
Contributor

When the site is restarting, the WP version is temporarily reverted to the previous one:

1231221312.mov
@bcotrim

bcotrim commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

When the site is restarting, the WP version is temporarily reverted to the previous one:

@nightnei it should be fixed, can you take another look please? 🙇

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
@bcotrim

bcotrim commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@sejas I fixed that issue, can you take another look please? 🙇

image
@bcotrim
bcotrim requested a review from sejas July 22, 2026 21:00
@nightnei

Copy link
Copy Markdown
Contributor

@bcotrim Confirm that both the bug Antonio reported and mine are fixed.
But now I faced another bug:

  1. Have latest selected as the default state
  2. Select 6.5 version and save
  3. Select latest and save - latest wasn't saved, and it's reverted to 6.5
@bcotrim

bcotrim commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@nightnei thanks for catching that, should be fixed now! 🙇

@nightnei nightnei 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.

Thanks Bernardo, now works perfectly and I didn't spot any regression 👍

@bcotrim
bcotrim merged commit 0e1a4bc into trunk Jul 23, 2026
13 checks passed
@bcotrim
bcotrim deleted the stu-1927-wp-version-dropdown branch July 23, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants