Skip to content

Commit bab4b6f

Browse files
authored
fix(web): align Windows update confirmation copy (#7208)
1 parent 89c52a3 commit bab4b6f

5 files changed

Lines changed: 9 additions & 30 deletions

File tree

apps/web/src/components/LegacySidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3585,7 +3585,7 @@ export default function LegacySidebar() {
35853585
let confirmed = false;
35863586
try {
35873587
confirmed = await ensureLocalApi().dialogs.confirm(
3588-
getDesktopUpdateInstallConfirmationMessage(desktopUpdateState, navigator.platform),
3588+
getDesktopUpdateInstallConfirmationMessage(desktopUpdateState),
35893589
);
35903590
} catch (error) {
35913591
setDesktopUpdateActionPending(false);

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

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -244,30 +244,15 @@ describe("desktop update UI helpers", () => {
244244
).toContain("Install update and restart T3 Code?");
245245
});
246246

247-
it("warns Windows users that a silent installation can take several minutes", () => {
248-
const message = getDesktopUpdateInstallConfirmationMessage(
249-
{
250-
availableVersion: "1.1.0",
251-
downloadedVersion: "1.1.0",
252-
},
253-
"Win32",
254-
);
255-
256-
expect(message).toContain("may remain closed for several minutes");
257-
expect(message).toContain("no installer window may appear");
258-
expect(message).toContain("will reopen automatically");
259-
});
260-
261-
it("keeps the additional silent installation warning Windows-specific", () => {
262-
const message = getDesktopUpdateInstallConfirmationMessage(
263-
{
247+
it("keeps the same install confirmation copy across desktop platforms", () => {
248+
expect(
249+
getDesktopUpdateInstallConfirmationMessage({
264250
availableVersion: "1.1.0",
265251
downloadedVersion: "1.1.0",
266-
},
267-
"MacIntel",
252+
}),
253+
).toBe(
254+
"Install update 1.1.0 and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.",
268255
);
269-
270-
expect(message).not.toContain("may remain closed for several minutes");
271256
});
272257
});
273258

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

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

43
export type DesktopUpdateButtonAction = "download" | "install" | "none";
54

@@ -97,13 +96,9 @@ export function getDesktopUpdateButtonTooltip(state: DesktopUpdateState): string
9796

9897
export function getDesktopUpdateInstallConfirmationMessage(
9998
state: Pick<DesktopUpdateState, "availableVersion" | "downloadedVersion">,
100-
platform = "",
10199
): string {
102100
const version = state.downloadedVersion ?? state.availableVersion;
103-
const windowsInstallWarning = isWindowsPlatform(platform)
104-
? "\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."
105-
: "";
106-
return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.${windowsInstallWarning}`;
101+
return `Install update${version ? ` ${version}` : ""} and restart T3 Code?\n\nAny running tasks will be interrupted. Make sure you're ready before continuing.`;
107102
}
108103

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ function AboutVersionSection() {
284284
confirmed = await ensureLocalApi().dialogs.confirm(
285285
getDesktopUpdateInstallConfirmationMessage(
286286
updateState ?? { availableVersion: null, downloadedVersion: null },
287-
navigator.platform,
288287
),
289288
);
290289
} catch (error) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function SidebarUpdateControl() {
222222
let confirmed = false;
223223
try {
224224
confirmed = await ensureLocalApi().dialogs.confirm(
225-
getDesktopUpdateInstallConfirmationMessage(state, navigator.platform),
225+
getDesktopUpdateInstallConfirmationMessage(state),
226226
);
227227
} catch (error) {
228228
setIsActionPending(false);

0 commit comments

Comments
 (0)