Skip to content

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): warn before silent Windows updates (#4350)

Yukun Shanb41e89eba9cd
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx
index 4b4093e21..35bdb451d 100644
--- a/apps/web/src/components/Sidebar.tsx
+++ b/apps/web/src/components/Sidebar.tsx
@@ -3608,7 +3608,7 @@ export default function Sidebar() {
if (desktopUpdateButtonAction === "install") {
const confirmed = window.confirm(
- getDesktopUpdateInstallConfirmationMessage(desktopUpdateState),
+ getDesktopUpdateInstallConfirmationMessage(desktopUpdateState, navigator.platform),
);
if (!confirmed) return;
void bridge
diff --git a/apps/web/src/components/desktopUpdate.logic.test.ts b/apps/web/src/components/desktopUpdate.logic.test.ts
index 65083b5b0..b07ae99c0 100644
--- a/apps/web/src/components/desktopUpdate.logic.test.ts
+++ b/apps/web/src/components/desktopUpdate.logic.test.ts
@@ -225,6 +225,32 @@ describe("desktop update UI helpers", () => {
}),
).toContain("Install update and restart T3 Code?");
});
+
+ it("warns Windows users that a silent installation can take several minutes", () => {
+ const message = getDesktopUpdateInstallConfirmationMessage(
+ {
+ availableVersion: "1.1.0",
+ downloadedVersion: "1.1.0",
+ },
+ "Win32",
+ );
+
+ expect(message).toContain("may remain closed for several minutes");
+ expect(message).toContain("no installer window may appear");
+ expect(message).toContain("will reopen automatically");
+ });
+
+ it("keeps the additional silent installation warning Windows-specific", () => {
+ const message = getDesktopUpdateInstallConfirmationMessage(
+ {
+ availableVersion: "1.1.0",
+ downloadedVersion: "1.1.0",
+ },
+ "MacIntel",
+ );
+
+ expect(message).not.toContain("may remain closed for several minutes");
+ });
});
describe("canCheckForUpdate", () => {
diff --git a/apps/web/src/components/desktopUpdate.logic.ts b/apps/web/src/components/desktopUpdate.logic.ts
index 38983c810..11c34777a 100644
--- a/apps/web/src/components/desktopUpdate.logic.ts
+++ b/apps/web/src/components/desktopUpdate.logic.ts
@@ -1,4 +1,5 @@
import type { DesktopUpdateActionResult, DesktopUpdateState } from "@t3tools/contracts";
+import { isWindowsPlatform } from "../lib/utils";
export type DesktopUpdateButtonAction = "download" | "install" | "none";
@@ -78,9 +79,13 @@ export function getDesktopUpdateButtonTooltip(state: DesktopUpdateState): string
export function getDesktopUpdateInstallConfirmationMessage(
state: Pick<DesktopUpdateState, "availableVersion" | "downloadedVersion">,
+ platform = "",
): string {
const version = state.downloadedVersion ?? state.availableVersion;
- return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.`;
+ const windowsInstallWarning = isWindowsPlatform(platform)
+ ? "\n\nOn Windows, T3 Code may remain closed for several minutes while the update installs, and no installer window may appear. T3 Code will reopen automatically when installation finishes."
+ : "";
+ return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.${windowsInstallWarning}`;
}
export function getDesktopUpdateActionError(result: DesktopUpdateActionResult): string | null {
diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx
index ebf4aed62..01eba9125 100644
--- a/apps/web/src/components/settings/SettingsPanels.tsx
+++ b/apps/web/src/components/settings/SettingsPanels.tsx
@@ -233,6 +233,7 @@ function AboutVersionSection() {
const confirmed = window.confirm(
getDesktopUpdateInstallConfirmationMessage(
updateState ?? { availableVersion: null, downloadedVersion: null },
+ navigator.platform,
),
);
if (!confirmed) return;
diff --git a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx
index fc15862fa..0603a9da0 100644
--- a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx
+++ b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx
@@ -110,7 +110,9 @@ export function SidebarUpdatePill() {
}
if (action === "install") {
- const confirmed = window.confirm(getDesktopUpdateInstallConfirmationMessage(state));
+ const confirmed = window.confirm(
+ getDesktopUpdateInstallConfirmationMessage(state, navigator.platform),
+ );
if (!confirmed) return;
void bridge
.installUpdate()