Add dispatch milestone celebration#150
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 868f2112e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| window.setTimeout(() => { | ||
| milestone.classList.remove("show"); | ||
| milestone.textContent = ""; | ||
| }, 1900); |
There was a problem hiding this comment.
Cancel stale milestone cleanup timers
When the user keeps dispatching quickly, the next milestone can start before this cleanup timer from the previous one fires: the 120 ms throttle allows 10 more dispatches in about 1.2s, which is less than the 1.9s timeout. That stale timeout then removes show and clears the text for the new 20/30/... celebration partway through its animation, so store and clear the previous timeout or verify it is still cleaning up the same milestone before mutating the DOM.
Useful? React with 👍 / 👎.
Summary
Adds a milestone celebration after every 10 dispatched trains. The celebration shows the total dispatch count in the center of the page with a short pop animation and confetti burst, then cleans itself up.
Screenshots
Before 10 dispatches:
After 10 dispatches:
Mobile after 10 dispatches:
Validation
git diff --checkpnpm iattempted, but this dependency-free starter repo has nopackage.jsonnpm run devattempted, but this dependency-free starter repo has nopackage.jsonhttp://127.0.0.1:5177/