Skip to content

Add a feature-flagged Desks UI default toggle#3537

Merged
youknowriad merged 1 commit into
trunkfrom
codex/add-desksui-toggle-preference
May 20, 2026
Merged

Add a feature-flagged Desks UI default toggle#3537
youknowriad merged 1 commit into
trunkfrom
codex/add-desksui-toggle-preference

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

Summary

  • Add a feature-flagged Studio preference to opt into Desks UI as the default renderer, persisted in app.json.
  • Rename the saved desktop UI preference to default to avoid colliding with apps/ui's classic-ui terminology.
  • Keep Ctrl+D / Cmd+D inside Desks UI as an internal toggle between classic and desks views.
  • Add a Desks user-menu action to revert back to the default Studio UI.
  • Fold Desks UI build/start flows into the normal Studio scripts and remove the separate start:new / make:new-ui paths.

Testing

  • Added and updated unit coverage for renderer selection, UI mode persistence, and the Desks user-menu action.
  • Ran lint/format on modified files, typecheck, and targeted Vitest suites.
  • Verified the Desks renderer build helper and main-window renderer selection path locally.

@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented May 19, 2026

📊 Performance Test Results

Comparing f254282 vs trunk

app-size

Metric trunk f254282 Diff Change
App Size (Mac) 1354.54 MB 1375.98 MB +21.44 MB 🔴 1.6%

site-editor

Metric trunk f254282 Diff Change
load 1510 ms 1490 ms 20 ms ⚪ 0.0%

site-startup

Metric trunk f254282 Diff Change
siteCreation 8567 ms 8572 ms +5 ms ⚪ 0.0%
siteStartup 4939 ms 4935 ms 4 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

@youknowriad youknowriad force-pushed the codex/add-desksui-toggle-preference branch from 2e90bd8 to f81ee63 Compare May 20, 2026 09:14
@youknowriad youknowriad force-pushed the codex/add-desksui-toggle-preference branch from f81ee63 to f254282 Compare May 20, 2026 09:37
@youknowriad youknowriad merged commit fb5d73f into trunk May 20, 2026
10 checks passed
@youknowriad youknowriad deleted the codex/add-desksui-toggle-preference branch May 20, 2026 10:09
fredrikekelund pushed a commit that referenced this pull request May 29, 2026
….cmd` (#3627)

## Related issues

- Fixes
[STU-1761](https://linear.app/a8c/issue/STU-1761/windows-npm-start-fails-with-spawn-npx-enoent)

## How AI was used in this PR

Diagnosed and patched with Claude Code. I reviewed the one-line change
and verified it locally on Windows.

## Proposed Changes

`scripts/start-studio.mjs` spawns `npx vite ...` and `npx electron-vite
...` with raw `child_process.spawn(...)`. On Windows, `npx` is `npx.cmd`
(a batch file), and Node's `spawn` without `shell: true` only resolves
real executables — so `npm start` immediately throws `Error: spawn npx
ENOENT` and the dev server never starts. macOS/Linux are unaffected
because `npx` is a real binary there.

Fix: pass `shell: true` to the default `spawn` options inside
`spawnCommand`. The shell resolves `npx` → `npx.cmd` on Windows and
finds `npx` the usual way on macOS/Linux.

This was a latent bug in the predecessor `scripts/start-new-ui.mjs`
(only reachable via the opt-in `npm run start:new`). #3537 promoted that
script to default `npm start`, turning it into a Windows-wide blocker.

### Why this is safe on macOS/Linux

- All spawn args are hardcoded literals (`'vite'`, `'--port'`, `'5200'`,
etc.), so there's no shell-quoting risk.
- `stdio: 'inherit'` still works through the shell wrapper.
- `SIGINT`/`SIGTERM` handlers in the script already call `.kill()` on
the child references, so Ctrl+C still works.

Caveat (not a regression vs. current state, but worth knowing): with
`shell: true` the immediate child is the shell wrapper. If the parent
script is killed abruptly, the inner `vite`/`electron-vite` may briefly
outlive the wrapper until they notice their parent is gone. The script's
own SIGINT/SIGTERM handlers cover the normal Ctrl+C path.

## Testing Instructions

**Windows (the regression):**

1. `git checkout stu-1761-fix-windows-npm-start-enoent`
2. `npm install && npm start`
3. Expected: prestart build runs, then `Starting @studio/ui dev server
on port 5200...` followed by `VITE vX ready in ... ms`, then Electron
launches.
4. On `trunk` the same command throws `Error: spawn npx ENOENT` and
exits with code 1.

**macOS / Linux (regression check):**

1. `npm start` from this branch should behave identically to `trunk` —
vite on 5200, then Electron.

## Pre-merge Checklist

- [ ] Have you checked for TypeScript, React or other console errors?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants