From a10e576422e94f9f10523cf71c177dfcb9bc7951 Mon Sep 17 00:00:00 2001 From: Josh Gratton Date: Fri, 19 Jun 2026 17:25:48 -0400 Subject: [PATCH] fix(settings): seed WSL backend state on mount so the WSL settings UI renders The merge resolution that dropped the old desktop access-management useEffect (now owned by the desktopNetworkAccess hook upstream) also removed the getWslState() initializer it was bundled with. As a result desktopWslState stayed null and renderWslRow() returned null, hiding the WSL settings picker entirely. Re-add a focused effect that seeds desktopWslState from the bridge when local-backend management is available. Addresses Macroscope review finding on ConnectionsSettings.tsx. --- .../settings/ConnectionsSettings.tsx | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx index b2329bc878..021919f43a 100644 --- a/apps/web/src/components/settings/ConnectionsSettings.tsx +++ b/apps/web/src/components/settings/ConnectionsSettings.tsx @@ -2801,6 +2801,34 @@ export function ConnectionsSettings() { [desktopBridge], ); + // Seed the WSL backend state from the desktop bridge on mount (and when + // local-backend management becomes available). Without this, desktopWslState + // stays null and renderWslRow() bails, hiding the WSL settings UI entirely. + // The broader desktop access-management state is owned by desktopNetworkAccess + // upstream; this effect only owns the WSL picker's state. + useEffect(() => { + if (!canManageLocalBackend || !desktopBridge) { + return; + } + let cancelled = false; + void desktopBridge + .getWslState() + .then((state) => { + if (!cancelled) { + setDesktopWslState(state); + } + }) + .catch((error: unknown) => { + if (cancelled) { + return; + } + setDesktopWslError(error instanceof Error ? error.message : "Failed to load WSL state."); + }); + return () => { + cancelled = true; + }; + }, [canManageLocalBackend, desktopBridge]); + // True when a desktop-local WSL backend is currently registered as an // environment on this machine. We use this as a proxy for "the user has work // that lives on the WSL side": if WSL has connected in a way that registered