Files
t3code/packages
Josh Gratton e00ad61e45 feat: add wsl-only mode + project icon dedup
Three things in one branch:

* fix(web): drop the per-thread container icon when every thread in
  the project is already on WSL (a7a2e1bd, already pushed).

* feat(web): confirm before disable / distro-switch when WSL has
  state (449e18f8, already pushed).

* This commit: add a third backend mode where the WSL backend runs
  as the primary and the Windows backend isn't started.

The mode lands as a new `wslOnly` setting on DesktopAppSettings,
gated behind wslBackendEnabled. When both are true:

  - DesktopBackendConfiguration.resolvePrimary now dispatches at
    resolve time. The Windows path builds the same start config as
    before; the WSL path reuses resolveWslStartConfig with the
    primary port and the user's chosen distro, so the WSL backend
    binds where the Windows backend would have, the renderer loads
    from the same exposure endpoint, and cookie-auth keeps working.

  - DesktopBackendPool reads settings once at layer init to pick the
    primary's label ("Windows" vs "WSL (Ubuntu)"). The label is
    captured per process; flipping the mode requires a restart.

  - DesktopWslBackend.reconcile skips the parallel "wsl:<distro>"
    registration when wsl-only is on, otherwise we'd run two WSL
    processes on the same distro.

  - New IPC channel SET_WSL_ONLY_CHANNEL plus a setWslOnly handler.
    getWslState now includes the wslOnly flag, and the DesktopBridge
    contract gains setWslOnly(enabled).

  - Settings UI gets a third row ("Run WSL only") under the distro
    picker, visible when WSL is enabled. The confirmation dialog
    grows a third branch with restart-aware copy ("Save and restart
    later") since the primary spec is captured at layer init.

Migration / defaults: wslOnly defaults to false. Existing setups
stay on parallel mode unless the user explicitly turns this on.

Tests: test bridges, settings mock, and IPC layerTest extended for
the new field. Existing settings + backend + WSL test suites pass.
2026-05-18 10:43:34 -04:00
..