Skip to content

Commit 4ffba05

Browse files
committed
fix(web): warn before silent Windows updates
- Explain that Windows installation may keep T3 Code closed for several minutes. - Tell users that no installer window may appear and the app will reopen automatically. - Apply the warning to every desktop update entry point and add focused platform coverage.
1 parent fbd7742 commit 4ffba05

5 files changed

Lines changed: 37 additions & 3 deletions

File tree

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3608,7 +3608,7 @@ export default function Sidebar() {
36083608

36093609
if (desktopUpdateButtonAction === "install") {
36103610
const confirmed = window.confirm(
3611-
getDesktopUpdateInstallConfirmationMessage(desktopUpdateState),
3611+
getDesktopUpdateInstallConfirmationMessage(desktopUpdateState, navigator.platform),
36123612
);
36133613
if (!confirmed) return;
36143614
void bridge

‎apps/web/src/components/desktopUpdate.logic.test.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,32 @@ describe("desktop update UI helpers", () => {
225225
}),
226226
).toContain("Install update and restart T3 Code?");
227227
});
228+
229+
it("warns Windows users that a silent installation can take several minutes", () => {
230+
const message = getDesktopUpdateInstallConfirmationMessage(
231+
{
232+
availableVersion: "1.1.0",
233+
downloadedVersion: "1.1.0",
234+
},
235+
"Win32",
236+
);
237+
238+
expect(message).toContain("may remain closed for several minutes");
239+
expect(message).toContain("no installer window may appear");
240+
expect(message).toContain("will reopen automatically");
241+
});
242+
243+
it("keeps the additional silent installation warning Windows-specific", () => {
244+
const message = getDesktopUpdateInstallConfirmationMessage(
245+
{
246+
availableVersion: "1.1.0",
247+
downloadedVersion: "1.1.0",
248+
},
249+
"MacIntel",
250+
);
251+
252+
expect(message).not.toContain("may remain closed for several minutes");
253+
});
228254
});
229255

230256
describe("canCheckForUpdate", () => {

‎apps/web/src/components/desktopUpdate.logic.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DesktopUpdateActionResult, DesktopUpdateState } from "@t3tools/contracts";
2+
import { isWindowsPlatform } from "../lib/utils";
23

34
export type DesktopUpdateButtonAction = "download" | "install" | "none";
45

@@ -78,9 +79,13 @@ export function getDesktopUpdateButtonTooltip(state: DesktopUpdateState): string
7879

7980
export function getDesktopUpdateInstallConfirmationMessage(
8081
state: Pick<DesktopUpdateState, "availableVersion" | "downloadedVersion">,
82+
platform = "",
8183
): string {
8284
const version = state.downloadedVersion ?? state.availableVersion;
83-
return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.`;
85+
const windowsInstallWarning = isWindowsPlatform(platform)
86+
? "\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."
87+
: "";
88+
return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.${windowsInstallWarning}`;
8489
}
8590

8691
export function getDesktopUpdateActionError(result: DesktopUpdateActionResult): string | null {

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ function AboutVersionSection() {
233233
const confirmed = window.confirm(
234234
getDesktopUpdateInstallConfirmationMessage(
235235
updateState ?? { availableVersion: null, downloadedVersion: null },
236+
navigator.platform,
236237
),
237238
);
238239
if (!confirmed) return;

‎apps/web/src/components/sidebar/SidebarUpdatePill.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export function SidebarUpdatePill() {
110110
}
111111

112112
if (action === "install") {
113-
const confirmed = window.confirm(getDesktopUpdateInstallConfirmationMessage(state));
113+
const confirmed = window.confirm(
114+
getDesktopUpdateInstallConfirmationMessage(state, navigator.platform),
115+
);
114116
if (!confirmed) return;
115117
void bridge
116118
.installUpdate()

0 commit comments

Comments
 (0)