From d8b1d86092ccc2e1a156625ee62ae989976e304d Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Fri, 17 Apr 2026 08:29:24 +1000 Subject: [PATCH] Update dialog-local-server.tsx --- .../src/components/dialog-local-server.tsx | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/packages/app/src/components/dialog-local-server.tsx b/packages/app/src/components/dialog-local-server.tsx index f27437466a..9c8c9b0a65 100644 --- a/packages/app/src/components/dialog-local-server.tsx +++ b/packages/app/src/components/dialog-local-server.tsx @@ -4,7 +4,7 @@ import { showToast } from "@opencode-ai/ui/toast" import { createEffect, createMemo, For, Match, on, onCleanup, Show, Switch } from "solid-js" import { createStore, reconcile, unwrap } from "solid-js/store" import { useLanguage } from "@/context/language" -import type { LocalServerConfig, LocalServerState, LocalServerStep } from "@/context/platform" +import type { LocalServerConfig, LocalServerMode, LocalServerState, LocalServerStep } from "@/context/platform" import { usePlatform } from "@/context/platform" const WSL_STEPS: LocalServerStep[] = ["wsl", "distro", "opencode", "switch"] @@ -105,6 +105,10 @@ export function DialogLocalServer(props: { targetMode?: "windows" | "wsl" }) { } return { mode: "windows" as const, distro: null as string | null } }) + const configuredRuntimeLabel = createMemo(() => runtimeLabel(configuredRuntime().mode, configuredRuntime().distro)) + const currentRuntimeLabel = createMemo(() => + runtimeLabel(current()?.runtime.mode ?? "windows", current()?.runtime.distro ?? null), + ) const needsRestart = createMemo(() => { const state = current() if (!state) return false @@ -533,22 +537,20 @@ export function DialogLocalServer(props: { targetMode?: "windows" | "wsl" }) {
{targetMode() === "windows" - ? configuredRuntime().mode === "windows" - ? "Restart OpenCode to finish switching back to Windows." - : "Switch the Local Server target back to Windows." + ? needsRestart() + ? "Restart OpenCode to switch back to Windows." + : "Windows Local Server is active." : needsRestart() - ? "Restart OpenCode to finish switching to WSL." - : "WSL Local Server is active."} + ? `Restart OpenCode to start using ${configuredRuntimeLabel()}.` + : `${configuredRuntimeLabel()} is active.`}
- Configured:{" "} - {configuredRuntime().mode === "wsl" ? `wsl:${configuredRuntime().distro ?? "unknown"}` : "windows"} + After restart: {configuredRuntimeLabel()}
- Current:{" "} - {current()?.runtime.mode === "wsl" ? `wsl:${current()?.runtime.distro ?? "unknown"}` : "windows"} + Using now: {currentRuntimeLabel()}
Complete the earlier steps first.
@@ -626,6 +628,11 @@ function stepTitle(step: LocalServerStep) { return "Switch" } +function runtimeLabel(mode: LocalServerMode, distro: string | null) { + if (mode === "windows") return "Windows" + return distro ? `WSL on ${distro}` : "WSL" +} + function stepState( step: LocalServerStep, state: {