@devries-cameron20 / t3code Mirror · read-only / commits / 98af8803fe
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

refactor(web): share restart countdown seconds in update capsule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 19, 2026 at 18:08 UTC 98af8803fe6b21b05320786479836b50735fb0aa
1 file changed +9 -11
apps/web/src/components/sidebar/SidebarUpdateCapsule.tsx
+9 -11
@@ -46,19 +46,20 @@ function useUpdateRunMachineViews(run: UpdateEverythingRun): ReadonlyArray<Updat
46 }));
47 }
48
49 +function restartSecondsLeft(run: UpdateEverythingRun, now: number): number | null {
50 + return run.phase === "countdown" && run.restartAt !== null
51 + ? Math.max(0, Math.ceil((run.restartAt - now) / 1000))
52 + : null;
53 +}
54 +
55 function localStatusLabel(
56 run: UpdateEverythingRun,
57 local: UpdateRunLocalState,
58 now: number,
59 resolve: MessageResolver,
60 ) {
55 - if (run.phase === "countdown" && run.restartAt !== null) {
56 - return resolve(
57 - msg("restarts in {seconds}s", {
58 - seconds: Math.max(0, Math.ceil((run.restartAt - now) / 1000)),
59 - }),
60 - );
61 - }
61 + const seconds = restartSecondsLeft(run, now);
62 + if (seconds !== null) return resolve(msg("restarts in {seconds}s", { seconds }));
63 if (run.phase === "installing") return resolve(msg("restarting"));
64 if (local?.status === "downloading") {
65 return local.percent === null
@@ -90,10 +91,7 @@ export function SidebarUpdateCapsule({
91 const updateServer = useServerUpdate();
92 const failed = machines.some(({ status }) => status === "failed");
93 const settled = !hasActiveMachine && run.localVersion === null;
93 - const restartSeconds =
94 - run.phase === "countdown" && run.restartAt !== null
95 - ? Math.max(0, Math.ceil((run.restartAt - now) / 1000))
96 - : null;
94 + const restartSeconds = restartSecondsLeft(run, now);
95
96 const actionLabel =
97 view.action === "later" ? gt("Later") : view.action === "retry" ? gt("Retry") : gt("Dismiss");