[claude] Fix Timmy OFFLINE status & GPU error handling (#811) #1337

Merged
claude merged 1 commits from claude/issue-811 into main 2026-03-24 02:40:39 +00:00
Collaborator

Fixes #811

Changes

OFFLINE Status Fix (base.html)

  • Bug fix: connectStatusWs() had catch(e) { return; } which silently abandoned reconnection if the WebSocket constructor threw — leaving status permanently OFFLINE. Now schedules a retry with the existing exponential backoff.
  • UX fix: Changed "OFFLINE" label to "Reconnecting..." — more accurate since we always retry, and friendlier per the issue requirements.

WebGL Context Loss Handling (static/world/index.html)

  • WebGL detection: Checks for WebGL support before initialising Three.js. Shows a text-only fallback view (with live mood/activity data) if unsupported.
  • Mobile detection: Detects coarse-pointer small-viewport devices and shows the same friendly fallback instead of a broken 3D scene.
  • Context lost overlay: Registers webglcontextlost / webglcontextrestored event handlers. On loss, shows "Timmy is taking a quick break — back in a moment" overlay and halts the animation loop. On restore, hides the overlay and resumes rendering cleanly.
  • Live state sync: Fallback view stays in sync with the WebSocket state reader (mood + activity text).

New CSS (static/world/style.css)

  • #gpu-error-overlay — full-screen context loss overlay
  • #webgl-fallback — text-only mode for unsupported devices / mobile
Fixes #811 ## Changes ### OFFLINE Status Fix (`base.html`) - **Bug fix**: `connectStatusWs()` had `catch(e) { return; }` which silently abandoned reconnection if the WebSocket constructor threw — leaving status permanently OFFLINE. Now schedules a retry with the existing exponential backoff. - **UX fix**: Changed `"OFFLINE"` label to `"Reconnecting..."` — more accurate since we always retry, and friendlier per the issue requirements. ### WebGL Context Loss Handling (`static/world/index.html`) - **WebGL detection**: Checks for WebGL support before initialising Three.js. Shows a text-only fallback view (with live mood/activity data) if unsupported. - **Mobile detection**: Detects coarse-pointer small-viewport devices and shows the same friendly fallback instead of a broken 3D scene. - **Context lost overlay**: Registers `webglcontextlost` / `webglcontextrestored` event handlers. On loss, shows _"Timmy is taking a quick break — back in a moment"_ overlay and halts the animation loop. On restore, hides the overlay and resumes rendering cleanly. - **Live state sync**: Fallback view stays in sync with the WebSocket state reader (mood + activity text). ### New CSS (`static/world/style.css`) - `#gpu-error-overlay` — full-screen context loss overlay - `#webgl-fallback` — text-only mode for unsupported devices / mobile
claude added 1 commit 2026-03-24 02:40:15 +00:00
fix: OFFLINE status stuck + WebGL context loss handling
Some checks failed
Tests / lint (pull_request) Failing after 17s
Tests / test (pull_request) Has been skipped
f9031d8d36
- Fix WebSocket reconnect bug: catch block in connectStatusWs() returned
  without scheduling a retry, causing permanent OFFLINE on constructor
  failure. Now retries with exponential backoff.
- Change OFFLINE label to "Reconnecting..." — more accurate and friendlier
  since we always attempt to reconnect automatically.
- Add WebGL support detection before Three.js renderer init — shows
  text-only fallback view with mood/activity for unsupported browsers.
- Add mobile detection (coarse pointer + small viewport) — shows the
  same friendly fallback rather than a broken 3D scene.
- Add webglcontextlost / webglcontextrestored handlers — shows "Timmy is
  taking a quick break" overlay with auto-retry on context loss; halts
  the animation loop to avoid cascading errors and resumes cleanly on
  restore.
- Keep fallback view in sync with live state (mood/activity from WS).

Fixes #811

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit c3f1598c78 into main 2026-03-24 02:40:39 +00:00
claude deleted branch claude/issue-811 2026-03-24 02:40:40 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1337