Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(web): calm one-row server update status and banner
Theo Browne80720ad592dc
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsxindex 9621f5f16..d8ca76677 100644--- a/apps/web/src/components/ChatView.tsx+++ b/apps/web/src/components/ChatView.tsx@@ -160,7 +160,6 @@ import {CheckCircle2Icon,ChevronDownIcon,GitBranchIcon,- TriangleAlertIcon,WifiOffIcon,} from "lucide-react";import { cn, randomHex } from "~/lib/utils";@@ -1986,31 +1985,35 @@ function ChatViewContent(props: ChatViewProps) {const updateFailed = serverUpdateState.status === "failed";items.push({id: `server-version:${serverUpdateEnvironmentId}`,- variant: updateFailed ? "error" : updateInProgress ? "default" : "warning",- icon: updateInProgress ? (- <span- className="size-1.5 animate-status-pulse rounded-full bg-foreground"- aria-hidden="true"- />- ) : (- <TriangleAlertIcon />- ),+ variant: updateFailed ? "error" : "default",+ // In-flight and failed states carry their own status dot inside+ // ServerUpdateProgress; only the idle offer needs an icon.+ icon:+ updateInProgress || updateFailed ? null : (+ <span+ className="size-1.5 rounded-full border border-muted-foreground/40"+ aria-hidden="true"+ />+ ),title:- updateInProgress || updateFailed- ? `${updateFailed ? "Could not update" : "Updating"} ${versionMismatchServerLabel}`- : "Client and server versions differ",- description:updateInProgress || updateFailed ? (- <ServerUpdateProgress- fromVersion={serverUpdateState.fromVersion}- state={serverUpdateState}- />+ `${updateFailed ? "Could not update" : "Updating"} ${versionMismatchServerLabel}`) : versionMismatch ? (- <>- Client {versionMismatch.clientVersion} is connected to {versionMismatchServerLabel}{" "}- {versionMismatch.serverVersion}.{" "}- {serverUpdateGuidance(versionMismatchSelfUpdate, versionMismatchServerLabel)}- </>+ <Tooltip>+ <TooltipTrigger render={<span>Server update available</span>} />+ <TooltipPopup side="top">+ {versionMismatchServerLabel} {versionMismatch.serverVersion}{" "}+ <span aria-hidden="true">→</span> {versionMismatch.clientVersion}+ </TooltipPopup>+ </Tooltip>+ ) : (+ "Server update available"+ ),+ description:+ updateInProgress || updateFailed ? (+ <ServerUpdateProgress state={serverUpdateState} />+ ) : versionMismatchSelfUpdate === "desktop-managed" ? (+ serverUpdateGuidance(versionMismatchSelfUpdate, versionMismatchServerLabel)) : null,// The desktop-managed guidance is already the description; the action// slot would only repeat it.@@ -2023,13 +2026,13 @@ function ChatViewContent(props: ChatViewProps) {serverLabel={versionMismatchServerLabel}selfUpdate={versionMismatchSelfUpdate}targetVersion={versionMismatch.clientVersion}- {...(updateFailed ? { label: "Retry update" } : {})}+ label={updateFailed ? "Retry" : "Update"}/>),...(updateInProgress || updateFailed || !versionMismatchDismissKey? {}: {- dismissLabel: "Dismiss version mismatch warning",+ dismissLabel: "Dismiss update notice",onDismiss: () => {dismissVersionMismatch(versionMismatchDismissKey);setDismissedVersionMismatchKey(versionMismatchDismissKey);diff --git a/apps/web/src/components/ServerUpdateAction.test.tsx b/apps/web/src/components/ServerUpdateAction.test.tsxindex 4d5669a0a..292884895 100644--- a/apps/web/src/components/ServerUpdateAction.test.tsx+++ b/apps/web/src/components/ServerUpdateAction.test.tsx@@ -101,10 +101,9 @@ describe("ServerUpdateAction", () => {});describe("ServerUpdateProgress", () => {- it("renders the monochrome step rail with only the active step highlighted", () => {+ it("shows one calm status row for the restart wait", () => {const markup = renderToStaticMarkup(<ServerUpdateProgress- fromVersion="0.0.30"state={{status: "running",stage: "resuming",@@ -114,23 +113,36 @@ describe("ServerUpdateProgress", () => {/>,);- expect(markup).toContain("0.0.30");- expect(markup).toContain("0.0.31");- expect(markup).toContain("Download");- expect(markup).toContain("Install");- expect(markup).toContain("Resuming");- // The wait state is monochrome and calm: no success/warning colors, no- // status sentence, one duty-cycled pulse on the active step.+ expect(markup).toContain("Restarting…");+ // The wait state is monochrome and calm: no versions, no step rail, no+ // success/warning colors, one duty-cycled pulse on the dot.+ expect(markup).not.toContain("0.0.30");+ expect(markup).not.toContain("Resum");expect(markup).not.toContain("text-success");expect(markup).not.toContain("text-primary");expect(markup).toContain("animate-status-pulse");expect(markup).not.toContain("animate-spin");});- it("keeps the failed stage visible with its retryable error", () => {+ it("folds the sub-second installing handoff into the download phase", () => {+ const markup = renderToStaticMarkup(+ <ServerUpdateProgress+ state={{+ status: "running",+ stage: "installing",+ fromVersion: "0.0.30",+ targetVersion: "0.0.31",+ }}+ />,+ );++ expect(markup).toContain("Downloading…");+ expect(markup).not.toContain("Install");+ });++ it("keeps the failure visible with its retryable error", () => {const markup = renderToStaticMarkup(<ServerUpdateProgress- fromVersion="0.0.30"state={{status: "failed",stage: "installing",diff --git a/apps/web/src/components/ServerUpdateAction.tsx b/apps/web/src/components/ServerUpdateAction.tsxindex f3b6c694f..40d55e3a5 100644--- a/apps/web/src/components/ServerUpdateAction.tsx+++ b/apps/web/src/components/ServerUpdateAction.tsx@@ -1,110 +1,63 @@import type { EnvironmentId, ServerSelfUpdateCapability } from "@t3tools/contracts";-import type { ServerUpdateState } from "@t3tools/client-runtime/state/server";+import type { ServerUpdateStage, ServerUpdateState } from "@t3tools/client-runtime/state/server";import {isAtomCommandInterrupted,squashAtomCommandFailure,} from "@t3tools/client-runtime/state/runtime";-import { CheckIcon } from "lucide-react";import { useCopyToClipboard } from "~/hooks/useCopyToClipboard";-import { cn } from "~/lib/utils";import { serverEnvironment } from "~/state/server";import { useAtomCommand } from "~/state/use-atom-command";import { manualServerUpdateCommand } from "~/versionSkew";import { Button } from "./ui/button";import { toastManager } from "./ui/toast";-const UPDATE_STEPS = [- { stage: "downloading", label: "Download", activeLabel: "Downloading" },- { stage: "installing", label: "Install", activeLabel: "Installing" },- { stage: "resuming", label: "Resume", activeLabel: "Resuming" },-] as const;+// The wire "installing" stage is a sub-second launcher handoff, so the UI+// folds it into the download phase; everything after the handoff is the+// restart the user is actually waiting through.+const UPDATE_STAGE_LABELS: Record<ServerUpdateStage, string> = {+ downloading: "Downloading…",+ installing: "Downloading…",+ resuming: "Restarting…",+};const pendingUpdateEnvironmentIds = new Set<EnvironmentId>();+export function serverUpdateStageLabel(stage: ServerUpdateStage): string {+ return UPDATE_STAGE_LABELS[stage];+}+function updateFailureMessage(error: unknown): string {return error instanceof Error ? error.message : "Server update failed.";}/**- * Monochrome step rail for an in-flight server update. The update is a- * wait, not a warning: done steps recede to gray, the active step is the- * only bright element and pulses. Failure keeps the rail but surfaces the- * error below it.+ * One-row status for an in-flight server update: "Downloading…" then+ * "Restarting…". The update is a wait, not a warning: a single pulsing dot+ * and label, no step rail, no versions. Failure turns the row red with the+ * rollback reason.*/export function ServerUpdateProgress({- fromVersion,state,}: {- readonly fromVersion: string;readonly state: Exclude<ServerUpdateState, { status: "idle" }>;}) {- const currentIndex = UPDATE_STEPS.findIndex(({ stage }) => stage === state.stage);-- return (- <div className="mt-1 min-w-0 space-y-2.5">- <p className="text-xs text-muted-foreground/70">- {fromVersion} <span aria-hidden="true">→</span> {state.targetVersion}- </p>- <ol className="flex min-w-0 items-center" aria-label="Server update progress">- {UPDATE_STEPS.map((step, index) => {- const complete = index < currentIndex;- const current = index === currentIndex;- const failed = current && state.status === "failed";- const running = current && state.status === "running";- return (- <li- key={step.stage}- className={cn(- "flex min-w-0 items-center text-xs font-medium",- index < UPDATE_STEPS.length - 1 ? "flex-1" : null,- complete- ? "text-muted-foreground"- : failed- ? "text-destructive"- : running- ? "animate-status-pulse text-foreground"- : "text-muted-foreground/50",- )}- aria-current={running ? "step" : undefined}- >- {complete ? (- <CheckIcon- className="size-3.5 shrink-0 opacity-70"- strokeWidth={2.5}- aria-hidden="true"- />- ) : (- <span- className={cn(- "size-1.5 shrink-0 rounded-full",- failed- ? "bg-destructive"- : running- ? "bg-foreground"- : "border border-muted-foreground/40",- )}- aria-hidden="true"- />- )}- <span className="ml-1.5 truncate">{running ? step.activeLabel : step.label}</span>- {index < UPDATE_STEPS.length - 1 ? (- <span- className={cn(- "mx-2 h-px min-w-3 flex-1",- complete ? "bg-muted-foreground/40" : "bg-border",- )}- aria-hidden="true"- />- ) : null}- </li>- );- })}- </ol>- {state.status === "failed" ? (- <p className="text-xs text-destructive" role="alert">+ if (state.status === "failed") {+ return (+ <div className="mt-1 flex min-w-0 items-center gap-2 text-xs text-destructive" role="alert">+ <span className="size-1.5 shrink-0 rounded-full bg-destructive" aria-hidden="true" />+ <span className="min-w-0 truncate" title={state.message}>{state.message}- </p>- ) : null}+ </span>+ </div>+ );+ }+ return (+ <div className="mt-1 flex items-center gap-2 text-xs font-medium text-foreground">+ <span+ className="size-1.5 shrink-0 animate-status-pulse rounded-full bg-foreground"+ aria-hidden="true"+ />+ <span>{serverUpdateStageLabel(state.stage)}</span></div>);}@@ -119,7 +72,7 @@ export function ServerUpdateAction({serverLabel,selfUpdate,targetVersion,- label = "Update server",+ label = "Update",}: {readonly environmentId: EnvironmentId;readonly serverLabel: string;diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsxindex cd3db1a97..35bd6ec65 100644--- a/apps/web/src/components/settings/ConnectionsSettings.tsx+++ b/apps/web/src/components/settings/ConnectionsSettings.tsx@@ -4,7 +4,6 @@ import {QrCodeIcon,RefreshCwIcon,TerminalIcon,- TriangleAlertIcon,} from "lucide-react";import { useAtomValue } from "@effect/atom-react";import { type ReactNode, memo, useCallback, useId, useMemo, useState } from "react";@@ -1426,17 +1425,20 @@ function SavedBackendListRow({) : null}{serverUpdateState.status !== "idle" ? (<div className="max-w-md">- <ServerUpdateProgress- fromVersion={serverUpdateState.fromVersion}- state={serverUpdateState}- />+ <ServerUpdateProgress state={serverUpdateState} /></div>) : versionMismatch ? (- <p className="flex items-center gap-1 text-warning text-xs">- <TriangleAlertIcon className="size-3.5 shrink-0" />- Version drift: client {versionMismatch.clientVersion}, server{" "}- {versionMismatch.serverVersion}.- </p>+ <Tooltip>+ <TooltipTrigger+ render={+ <p className="w-fit text-muted-foreground text-xs">Server update available</p>+ }+ />+ <TooltipPopup side="top">+ {versionMismatch.serverVersion} <span aria-hidden="true">→</span>{" "}+ {versionMismatch.clientVersion}+ </TooltipPopup>+ </Tooltip>) : null}{environment.connection.error && !resumingServerUpdate ? (<p className="flex min-w-0 items-center gap-2 text-destructive text-xs">@@ -1461,7 +1463,7 @@ function SavedBackendListRow({serverLabel={`${environment.label} server`}selfUpdate={resolveServerSelfUpdateCapability(environment.serverConfig)}targetVersion={versionMismatch.clientVersion}- label={serverUpdateState.status === "failed" ? "Retry update" : "Update server"}+ label={serverUpdateState.status === "failed" ? "Retry" : "Update"}/>) : null}{isWslEnvironment ? (@@ -2998,21 +3000,21 @@ export function ConnectionsSettings() {? "Update failed": primaryServerUpdateState.status === "running"? "Updating server"- : "Version drift"+ : "Server update available"}description={primaryServerUpdateState.status !== "idle" ? (- <ServerUpdateProgress- fromVersion={primaryServerUpdateState.fromVersion}- state={primaryServerUpdateState}- />+ <ServerUpdateProgress state={primaryServerUpdateState} />) : primaryVersionMismatch ? (- <span className="flex items-center gap-1 text-warning">- <TriangleAlertIcon className="size-3.5 shrink-0" />- Client {primaryVersionMismatch.clientVersion}, server{" "}- {primaryVersionMismatch.serverVersion}. Sync them if RPC calls or reconnects- fail.- </span>+ <Tooltip>+ <TooltipTrigger+ render={<span className="w-fit">Update to match this client.</span>}+ />+ <TooltipPopup side="top">+ {primaryVersionMismatch.serverVersion} <span aria-hidden="true">→</span>{" "}+ {primaryVersionMismatch.clientVersion}+ </TooltipPopup>+ </Tooltip>) : null}control={@@ -3024,9 +3026,7 @@ export function ConnectionsSettings() {serverLabel={primaryEnvironment?.label ?? "this server"}selfUpdate={resolveServerSelfUpdateCapability(primaryServerConfig)}targetVersion={primaryVersionMismatch.clientVersion}- {...(primaryServerUpdateState.status === "failed"- ? { label: "Retry update" }- : {})}+ label={primaryServerUpdateState.status === "failed" ? "Retry" : "Update"}/>) : undefined}diff --git a/docs/user/updating.md b/docs/user/updating.mdindex ea2ff644c..d6c6dfd1c 100644--- a/docs/user/updating.md+++ b/docs/user/updating.md@@ -35,10 +35,10 @@ An older background-service launcher may ask you to run the exact`npx t3@<version> service update` command on the server machine. That one local update installs therollback support needed for later remote updates, including versions that change the database.-After selecting **Update server**, the warning becomes a three-step progress rail:-**Download**, **Install**, and **Resume**. The same progress appears in the conversation and in-Connections, so navigating between them does not lose the update. A failed step remains visible-with its error and an option to retry.+After selecting **Update**, the notice becomes a live status line: **Downloading…** while the new+version is fetched and verified, then **Restarting…** while the server restarts into it. The same+status appears in the conversation and in Connections, so navigating between them does not lose the+update. A failure remains visible with its error and an option to retry.**Copy update command** gives you `npx t3@<client-version>`, which relaunches the server directlyat the matching version. Add whatever startup options you normally use.