Name pill held its full 1000 ms once faded in, as the docs and openpanel count it

This commit is contained in:
Melvin Strobl
2026-10-15 10:04:07 +02:00
parent 300d9017fd
commit e5a953c11c
2 changed files with 7 additions and 3 deletions
@@ -13,7 +13,7 @@ import { flushSync } from "react-dom"
import { ErrorBoundary } from "react-error-boundary"
import type { WidgetDef } from "@/client"
import { slotsFor } from "@/components/Common/UplotChart"
import { fadeIn } from "@/lib/motion"
import { duration, fadeIn } from "@/lib/motion"
import { useShortcuts } from "@/lib/shortcuts"
import { useClock } from "./ClockWidget"
import type { Dashboard } from "./DashboardView"
@@ -441,7 +441,11 @@ export function RoundView({
useEffect(() => {
if (!announce) return
const timer = setTimeout(() => setAnnounce(false), ANNOUNCE_MS)
// Held for its whole time once faded in, as the docs and openpanel count it.
const timer = setTimeout(
() => setAnnounce(false),
duration.base * 1000 + ANNOUNCE_MS,
)
return () => clearTimeout(timer)
}, [announce])
@@ -133,7 +133,7 @@ export const turnsPage = (by: number, speed: number, size: number) =>
Math.sign(speed) === Math.sign(by) &&
Math.abs(speed) >= PAGE_FLING)
/** How long a change of dashboard shows which one it landed on. */
/** How long a change of dashboard holds its name, once faded in. */
export const ANNOUNCE_MS = 1000
/**