From 2462f0e3798377a008c05fc7e199a75c9bb51645 Mon Sep 17 00:00:00 2001 From: Josh Gratton Date: Sun, 31 May 2026 22:14:22 -0400 Subject: [PATCH] fix(web): give a recovery control when WSL becomes unavailable Companion to the backend fall-back-to-Windows fix. The Connections "WSL backend" row was hidden whenever desktopWslState.available was false. If the user still had the WSL backend persisted (enabled, possibly wsl-only) but WSL went away (uninstalled, distro removed), the desktop falls back to the Windows backend yet the UI offered no way to clear the WSL preference - stranding the user until WSL worked again or settings were hand-edited. renderWslRow now shows a recovery row in that state (WSL unavailable but still persisted) with a "Switch to Windows" action that routes through the existing disable flow (clears wslBackendEnabled and, if set, wslOnly, then relaunches onto Windows). When WSL is unavailable and unused there's nothing to recover, so the section stays hidden as before. --- .../settings/ConnectionsSettings.tsx | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx index 116d81868e..be09264f77 100644 --- a/apps/web/src/components/settings/ConnectionsSettings.tsx +++ b/apps/web/src/components/settings/ConnectionsSettings.tsx @@ -2558,7 +2558,37 @@ export function ConnectionsSettings() { }, [applyWslSettingChange, desktopBridge, pendingWslChange]); const renderWslRow = () => { - if (!desktopWslState || !desktopWslState.available) return null; + if (!desktopWslState) return null; + // WSL went unavailable while the user still has the WSL backend persisted + // (it may have been uninstalled or its distro removed). The desktop side + // falls back to the Windows backend, but the normal distro picker needs a + // live distro list it no longer has. Without a control here the user would + // be stranded on a WSL preference they can't clear, so render a recovery + // row that switches back to Windows. When WSL is unavailable AND unused, + // there's nothing to recover — keep the section hidden as before. + if (!desktopWslState.available) { + if (!desktopWslState.enabled && !desktopWslState.wslOnly) return null; + return ( + {desktopWslError} + ) : null + } + control={ + + } + /> + ); + } // Distro is null when the user wants the WSL default. Map it to the // real default's name so the Select highlights a real option; fall // back to the sentinel only when no distros are listed yet (the