Skip to content

fix(canvas): harden Safari WebGL and video playback - #452

Open
ignmandagaran wants to merge 1 commit into
mainfrom
ignmandagaran/safari-webgl-video-errors
Open

fix(canvas): harden Safari WebGL and video playback#452
ignmandagaran wants to merge 1 commit into
mainfrom
ignmandagaran/safari-webgl-video-errors

Conversation

@ignmandagaran

@ignmandagaran ignmandagaran commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Recover blocked Safari video autoplay after user interaction.
  • Stop render storms from lost WebGL contexts and avoid context eviction during boot.
  • Addresses Sentry issues WEBSITE-2K25-3F and WEBSITE-2K25-4B.

Validation

  • pnpm build
  • Targeted ESLint on changed files

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website-2k25 Ready Ready Preview Aug 17, 2026 12:27pm

@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Greptile Summary

This PR hardens Safari rendering and media behavior by delaying WebGL context allocation, detecting lost contexts, and retrying blocked video playback. It also introduces a contact-worker readiness handshake, but one existing message path still bypasses that handshake.

  • Defers the contact offscreen canvas until the loading WebGL context is released.
  • Adds polling and render guards for lost WebGL contexts.
  • Retries video playback after user interaction and visibility changes.
  • Adds screen-dimensions as the contact scene readiness signal.

Confidence Score: 4/5

The contact readiness race should be fixed before merging because normal open and close actions can still bypass the new worker-readiness gate.

ContactCanvas delays its worker update until the scene is ready, but the contact store still sends the same message immediately and can leave animation state stranded when the worker scene has not installed its listener.

Files Needing Attention: src/components/contact/contact-canvas.tsx and src/components/contact/contact-store.ts

Prompt To Fix All With AI
### Issue 1
src/components/contact/contact-canvas.tsx:191-198
**Readiness gate leaves direct sends open**

When contact is opened or closed before `ContactScene` installs its worker listener, the store sends `update-contact-open` directly without waiting for `sceneReady`. The message is dropped after `isAnimating` is set, leaving contact interaction stuck until another state change.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(canvas): harden Safari WebGL and vid..." | Re-trigger Greptile

Comment on lines 191 to +198
useEffect(() => {
if (worker) {
worker.postMessage({
type: "update-contact-open",
isContactOpen: isContactOpen
})
}
}, [worker, isContactOpen])
if (!worker || !sceneReady) return

worker.postMessage({
type: "update-contact-open",
isContactOpen: isContactOpen
})
}, [worker, sceneReady, isContactOpen])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Readiness gate leaves direct sends open

When contact is opened or closed before ContactScene installs its worker listener, the store sends update-contact-open directly without waiting for sceneReady. The message is dropped after isAnimating is set, leaving contact interaction stuck until another state change.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/contact/contact-canvas.tsx
Line: 191-198

Comment:
**Readiness gate leaves direct sends open**

When contact is opened or closed before `ContactScene` installs its worker listener, the store sends `update-contact-open` directly without waiting for `sceneReady`. The message is dropped after `isAnimating` is set, leaving contact interaction stuck until another state change.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

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.

1 participant