Mascot fixes - #34
Conversation
gksoriginals
commented
Aug 1, 2026
- Added fix for mascot freezing
- Fallback to sticker
Harden mascot animation fallback
✅ Deploy Preview for tinkerspace-display ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds a mascot “watchdog” + fail-safe path to prevent the mascot from getting stuck (freezing) and to fall back to a static sticker when animation/scheduling health checks fail.
Changes:
- Introduces watchdog helper utilities for asset URL versioning and failure detection.
- Adds a fail-safe mode in
TinkerHubMascotthat stops scheduling and renders a fallback sticker when assets fail to load or watchdog checks fail. - Adds CSS for the fallback layout and tests for the watchdog helpers + fail-safe lifecycle.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/index.css | Adds fallback container + sticker image styling for the fail-safe UI. |
| src/components/mascot/watchdog.js | New helpers for asset URL cache-busting and watchdog failure classification. |
| src/components/mascot/watchdog.test.js | Unit tests for watchdog helper behavior. |
| src/components/mascot/TinkerHubMascot.jsx | Adds watchdog interval, animation heartbeat tracking, and fail-safe fallback rendering. |
| src/components/mascot/TinkerHubMascot.test.jsx | Adds a regression test to ensure scheduling does not resume after fail-safe activation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const scheduleNext = useCallback((delay, trackPoseDeadline = true) => { | ||
| if (failSafeActiveRef.current) return; | ||
| window.clearTimeout(schedulerTimer.current); | ||
| if (trackPoseDeadline) poseEndsAt.current = Date.now() + delay; | ||
| schedulerTimer.current = window.setTimeout(() => { if (advanceRef.current) advanceRef.current(); }, delay); |
| watchdogTimer.current = window.setInterval(() => { | ||
| if (document.hidden) { | ||
| lastAnimationHeartbeatAt.current = Date.now(); | ||
| return; | ||
| } |