From b77d7b2183641a570c954b447f653e05b27c7842 Mon Sep 17 00:00:00 2001 From: "t3-code[bot]" <269035359+t3-code[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 15:06:25 +0000 Subject: [PATCH] fix(web): restart repeated update check spins Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com> --- apps/web/src/components/sidebar/DesktopUpdateCheckIcon.tsx | 4 ++++ apps/web/src/components/sidebar/SidebarUpdatePill.test.tsx | 5 +++++ apps/web/src/components/sidebar/SidebarUpdatePill.tsx | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/apps/web/src/components/sidebar/DesktopUpdateCheckIcon.tsx b/apps/web/src/components/sidebar/DesktopUpdateCheckIcon.tsx index 3a92f704ae..134cf07759 100644 --- a/apps/web/src/components/sidebar/DesktopUpdateCheckIcon.tsx +++ b/apps/web/src/components/sidebar/DesktopUpdateCheckIcon.tsx @@ -3,6 +3,10 @@ import type { AnimationEventHandler } from "react"; import { cn } from "../../lib/utils"; +export function nextDesktopUpdateCheckAnimationKey(key: number) { + return key + 1; +} + export function shouldContinueDesktopUpdateCheckAnimation({ isChecking, }: { diff --git a/apps/web/src/components/sidebar/SidebarUpdatePill.test.tsx b/apps/web/src/components/sidebar/SidebarUpdatePill.test.tsx index 8e59521306..7db835c65c 100644 --- a/apps/web/src/components/sidebar/SidebarUpdatePill.test.tsx +++ b/apps/web/src/components/sidebar/SidebarUpdatePill.test.tsx @@ -3,6 +3,7 @@ import { describe, expect, it } from "vite-plus/test"; import { DesktopUpdateCheckIcon, + nextDesktopUpdateCheckAnimationKey, shouldContinueDesktopUpdateCheckAnimation, } from "./DesktopUpdateCheckIcon"; @@ -34,4 +35,8 @@ describe("DesktopUpdateCheckIcon", () => { }), ).toBe(false); }); + + it("restarts the animation for each manual check", () => { + expect(nextDesktopUpdateCheckAnimationKey(2)).toBe(3); + }); }); diff --git a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx index 92fa267a8e..62b21dfacb 100644 --- a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx +++ b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx @@ -23,6 +23,7 @@ import { SidebarMenuItem } from "../ui/sidebar"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { DesktopUpdateCheckIcon, + nextDesktopUpdateCheckAnimationKey, shouldContinueDesktopUpdateCheckAnimation, } from "./DesktopUpdateCheckIcon"; @@ -114,6 +115,7 @@ export function SidebarUpdatePill() { function SidebarUpdateControl() { const state = useDesktopUpdateState(); const [isActionPending, setIsActionPending] = useState(false); + const [checkAnimationKey, setCheckAnimationKey] = useState(0); const [isCheckIconAnimating, setIsCheckIconAnimating] = useState(false); useEffect(() => { @@ -219,6 +221,7 @@ function SidebarUpdateControl() { } setIsCheckIconAnimating(true); + setCheckAnimationKey(nextDesktopUpdateCheckAnimationKey); void bridge .checkForUpdate() .then((result) => { @@ -274,6 +277,7 @@ function SidebarUpdateControl() { ) : (