| author | |
| committer | |
| log | b41e89eba9cd232cc3257b400fc30972a9b53438 |
| tree | 4aacab2ef2437fa2a9e61dd8c631a0d96f39f51f |
| parent | 4d83436415c0f6020afe84c127b88874b6f0103c |
| signature | Signed by PGP key B5690EEEBB952194 |
5 files changed, 37 insertions(+), 3 deletions(-)
apps/web/src/components/Sidebar.tsx+1-1| ... | @@ -3608,7 +3608,7 @@ export default function Sidebar() { | ... | @@ -3608,7 +3608,7 @@ export default function Sidebar() { |
| 3608 | 3608 | ||
| 3609 | if (desktopUpdateButtonAction === "install") { | 3609 | if (desktopUpdateButtonAction === "install") { |
| 3610 | const confirmed = window.confirm( | 3610 | const confirmed = window.confirm( |
| 3611 | getDesktopUpdateInstallConfirmationMessage(desktopUpdateState), | 3611 | getDesktopUpdateInstallConfirmationMessage(desktopUpdateState, navigator.platform), |
| 3612 | ); | 3612 | ); |
| 3613 | if (!confirmed) return; | 3613 | if (!confirmed) return; |
| 3614 | void bridge | 3614 | void bridge |
apps/web/src/components/desktopUpdate.logic.test.ts+26| ... | @@ -225,6 +225,32 @@ describe("desktop update UI helpers", () => { | ... | @@ -225,6 +225,32 @@ describe("desktop update UI helpers", () => { |
| 225 | }), | 225 | }), |
| 226 | ).toContain("Install update and restart T3 Code?"); | 226 | ).toContain("Install update and restart T3 Code?"); |
| 227 | }); | 227 | }); |
| 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 | }); | ||
| 228 | }); | 254 | }); |
| 229 | 255 | ||
| 230 | describe("canCheckForUpdate", () => { | 256 | describe("canCheckForUpdate", () => { |
apps/web/src/components/desktopUpdate.logic.ts+6-1| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | import type { DesktopUpdateActionResult, DesktopUpdateState } from "@t3tools/contracts"; | 1 | import type { DesktopUpdateActionResult, DesktopUpdateState } from "@t3tools/contracts"; |
| 2 | import { isWindowsPlatform } from "../lib/utils"; | ||
| 2 | 3 | ||
| 3 | export type DesktopUpdateButtonAction = "download" | "install" | "none"; | 4 | export type DesktopUpdateButtonAction = "download" | "install" | "none"; |
| 4 | 5 | ||
| ... | @@ -78,9 +79,13 @@ export function getDesktopUpdateButtonTooltip(state: DesktopUpdateState): string | ... | @@ -78,9 +79,13 @@ export function getDesktopUpdateButtonTooltip(state: DesktopUpdateState): string |
| 78 | 79 | ||
| 79 | export function getDesktopUpdateInstallConfirmationMessage( | 80 | export function getDesktopUpdateInstallConfirmationMessage( |
| 80 | state: Pick<DesktopUpdateState, "availableVersion" | "downloadedVersion">, | 81 | state: Pick<DesktopUpdateState, "availableVersion" | "downloadedVersion">, |
| 82 | platform = "", | ||
| 81 | ): string { | 83 | ): string { |
| 82 | const version = state.downloadedVersion ?? state.availableVersion; | 84 | 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}`; | ||
| 84 | } | 89 | } |
| 85 | 90 | ||
| 86 | export function getDesktopUpdateActionError(result: DesktopUpdateActionResult): string | null { | 91 | export function getDesktopUpdateActionError(result: DesktopUpdateActionResult): string | null { |
apps/web/src/components/settings/SettingsPanels.tsx+1| ... | @@ -233,6 +233,7 @@ function AboutVersionSection() { | ... | @@ -233,6 +233,7 @@ function AboutVersionSection() { |
| 233 | const confirmed = window.confirm( | 233 | const confirmed = window.confirm( |
| 234 | getDesktopUpdateInstallConfirmationMessage( | 234 | getDesktopUpdateInstallConfirmationMessage( |
| 235 | updateState ?? { availableVersion: null, downloadedVersion: null }, | 235 | updateState ?? { availableVersion: null, downloadedVersion: null }, |
| 236 | navigator.platform, | ||
| 236 | ), | 237 | ), |
| 237 | ); | 238 | ); |
| 238 | if (!confirmed) return; | 239 | if (!confirmed) return; |
apps/web/src/components/sidebar/SidebarUpdatePill.tsx+3-1| ... | @@ -110,7 +110,9 @@ export function SidebarUpdatePill() { | ... | @@ -110,7 +110,9 @@ export function SidebarUpdatePill() { |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | if (action === "install") { | 112 | if (action === "install") { |
| 113 | const confirmed = window.confirm(getDesktopUpdateInstallConfirmationMessage(state)); | 113 | const confirmed = window.confirm( |
| 114 | getDesktopUpdateInstallConfirmationMessage(state, navigator.platform), | ||
| 115 | ); | ||
| 114 | if (!confirmed) return; | 116 | if (!confirmed) return; |
| 115 | void bridge | 117 | void bridge |
| 116 | .installUpdate() | 118 | .installUpdate() |