Skip to content

Agentic UI: Add Studio CLI toggle to application settings - #4302

Merged
bcotrim merged 6 commits into
trunkfrom
agentic-settings-cli-toggle
Jul 22, 2026
Merged

Agentic UI: Add Studio CLI toggle to application settings#4302
bcotrim merged 6 commits into
trunkfrom
agentic-settings-cli-toggle

Conversation

@bcotrim

@bcotrim bcotrim commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Implemented with Claude Code from a scoped brief: it ported the StudioCliSection from #3979 to the auto-save settings model, extended the connector contract across the three connectors, and wrote the tests. Two behaviors were hardened based on manual testing feedback: a "cancel behind the native dialog leaves the toggle stale" bug (fixed by refetching the installed state after saving) and standalone-CLI handling (toggle disabled with an explanatory tooltip). All code was human-reviewed and manually tested on macOS.

Proposed Changes

Adds a Studio CLI section to the new (agentic UI) application settings, so users can install or uninstall the studio terminal command without switching back to the classic UI — the last preference from the classic settings that had no equivalent in the new experience.

  • The toggle saves immediately (same auto-save behavior as the rest of the settings) and links to the CLI docs.
  • Install/uninstall can be declined or fail behind native OS dialogs (permissions, dev-build warnings) while the IPC call still resolves, so after every change the UI re-checks the actual installed state and the toggle settles on reality — cancelling the native dialog returns the toggle to its saved position instead of showing a state that never happened. Failures surface an inline error in the section.
  • When the studio command is a standalone (curl) install, the app never installs over or uninstalls it — previously the toggle would appear to work but silently no-op. The toggle is now disabled in that case, with a tooltip explaining that the CLI is managed outside the app and pointing at studio uninstall. This exposes the existing externally-managed detection from the installation managers over IPC (isStudioCliExternallyManaged).
  • The section is hidden where installing a CLI isn't possible: browser hosts (studio ui / hosted) and Windows Store builds. This introduces a minimal getAppGlobals() connector method (platform + Windows Store flag) for that gating, since this part of Agentic UI: Application Settings #3979 hadn't landed with the earlier settings PRs.
Light Dark
image image
image image

Testing Instructions

Note: this PR adds a main-process IPC handler, so a full app restart (not hot reload) is required.

  1. Enable the new Studio experience and open Settings.
  2. Confirm a Studio CLI card appears below Account, with the toggle reflecting whether ~/.local/bin/studio exists (where studio).
  3. Turn the toggle on, accept the dev-build warning → studio resolves in a new terminal and the toggle stays on.
  4. Turn it off, accept → the symlink is removed and the toggle stays off.
  5. Toggle again but press Cancel in the native dialog → the toggle returns to its previous position (this was the stale-state bug fixed here).
  6. With a standalone curl-installed CLI (symlink at ~/.local/bin/studio pointing outside the app bundle): the toggle shows on but is disabled. Hovering it shows a tooltip pointing at studio uninstall — it should open quickly (~200ms, faster than the app's default tooltip delay, since the disabled control gives no other feedback) and wrap as a compact multi-line bubble (max width 280px) instead of one long line.
  7. Check both light and dark mode, including the toggle's checked/unchecked, disabled, and focus styles, plus the tooltip in step 6.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@bcotrim bcotrim self-assigned this Jul 22, 2026
@bcotrim
bcotrim requested review from nightnei and sejas July 22, 2026 13:01
@wpmobilebot

wpmobilebot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 9447c48 vs trunk

app-size

Metric trunk 9447c48 Diff Change
App Size (Mac) 1361.95 MB 1361.96 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 9447c48 Diff Change
load 1088 ms 1041 ms 47 ms ⚪ 0.0%

site-startup

Metric trunk 9447c48 Diff Change
siteCreation 6976 ms 6976 ms 0 ms ⚪ 0.0%
siteStartup 2350 ms 2351 ms +1 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

bcotrim added 2 commits July 22, 2026 15:13
…-toggle

# Conflicts:
#	apps/ui/src/components/settings-view/index.tsx
#	apps/ui/src/data/core/connectors/local/index.ts

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

I confirmed the toggle installs and uninstalls Studio from the desktop app. I also tested that the toggle is disabled when I install studio from curl. We could add the cursor disallow for that case.

I also noticed that the App doesn't detect it if I install it form npm install -g wp-studio@latest. I suggest creating an issue as a follow-up.

The alert about using system node vs Electron node is difficult to understand for users, but that alert already exists in the Classic UI.

Image Image Image
@bcotrim
bcotrim merged commit 41f9cf4 into trunk Jul 22, 2026
13 checks passed
@bcotrim
bcotrim deleted the agentic-settings-cli-toggle branch July 22, 2026 19:47
@bcotrim bcotrim mentioned this pull request Jul 24, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants