Repository navigation
fix(web): stop tick countdown freeze and stray theme flips - #9
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
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
localStorageon 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; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.