Skip to content

fix(web): stop tick countdown freeze and stray theme flips - #9

Merged
404GH0ST merged 1 commit into
mainfrom
fix/tick-countdown-theme-flip
Jun 21, 2026
Merged

404GH0ST merged 1 commit into
mainfrom
fix/tick-countdown-theme-flip

Conversation

@404GH0ST

Copy link
Copy Markdown
Owner

Countdown clamped to 0 and waited on the backend to publish the next nextTickAt, leaving the timer stuck at 0s for ~15s before snapping to ~245s. Project past the boundary by whole tick intervals so it rolls over to the next interval, and key the recovery refresh on an overdue flag instead of timeLeft === 0.

Theme followed the OS prefers-color-scheme for users who never used the toggle, so an OS day/night switch flipped the theme on reload. Pin the resolved theme to localStorage on first visit so it stays sticky.

Countdown clamped to 0 and waited on the backend to publish the next
nextTickAt, leaving the timer stuck at 0s for ~15s before snapping to
~245s. Project past the boundary by whole tick intervals so it rolls
over to the next interval, and key the recovery refresh on an overdue
flag instead of timeLeft === 0.

Theme followed the OS prefers-color-scheme for users who never used the
toggle, so an OS day/night switch flipped the theme on reload. Pin the
resolved theme to localStorage on first visit so it stays sticky.
Copilot AI review requested due to automatic review settings June 21, 2026 16:07
@404GH0ST
404GH0ST merged commit f1cc2de into main Jun 21, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the participant dashboard experience by preventing the tick countdown UI from freezing at 0 while waiting for backend updates, and by making the resolved theme choice stable across reloads even when the OS color scheme changes.

Changes:

  • Updates the tick countdown logic to project the next tick boundary and triggers recovery refreshes based on an overdue flag.
  • Persists the initially resolved theme to localStorage on first visit to avoid unexpected theme flips on reload.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/web/components/dashboard/control-center-sections.tsx Adjusts tick countdown calculation and refresh triggering to avoid 0s freezes.
apps/web/app/layout.tsx Pins the initially resolved theme to localStorage to prevent OS-driven flips on reload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +170 to +175
let projected = target;
if (intervalMs > 0) {
while (projected <= now) {
projected += intervalMs;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants