Skip to content

feat: canvas readiness#192

Merged
Felix Frank (feliopterix) merged 18 commits intotrunkfrom
feat/canvas-readiness
Apr 16, 2026
Merged

feat: canvas readiness#192
Felix Frank (feliopterix) merged 18 commits intotrunkfrom
feat/canvas-readiness

Conversation

@feliopterix
Copy link
Copy Markdown
Contributor

1. Why is this change necessary?

The current implementation can lead to unrecovarable canvas states where webgpu/webgl cannot be initialized by dive.

2. What does this change do, exactly?

Introduce a proper canvas lifecycle manager class that watches over the canvas' readiness.

@feliopterix Felix Frank (feliopterix) added the service/shopping-experience Issues and PRs related to this service. label Apr 15, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.23%. Comparing base (5b81007) to head (0ef2bb2).
⚠️ Report is 20 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk     #192      +/-   ##
==========================================
+ Coverage   99.14%   99.23%   +0.09%     
==========================================
  Files         135      135              
  Lines        7123     7313     +190     
  Branches     1623     1686      +63     
==========================================
+ Hits         7062     7257     +195     
+ Misses         61       56       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@feliopterix Felix Frank (feliopterix) marked this pull request as ready for review April 15, 2026 09:09
Comment on lines +273 to +277
return setInterval(() => {
if (canvas.parentElement) {
observeParent(canvas.parentElement);
}
}, 16);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey. Just a question. Why do we have this separate interval in here?
Would it be possible to check if we are still observing the right parent, before every frame instead, so we do it in the requestAnimationFrame loop we already have.

Also instead of having a resize observer, and checking regularly if the observed parent is still the actual parent. Could we not just directly check every frame if the dimensions have changed instead? Or am i missing something?

@feliopterix Felix Frank (feliopterix) merged commit 3c30a41 into trunk Apr 16, 2026
12 checks passed
@feliopterix Felix Frank (feliopterix) deleted the feat/canvas-readiness branch April 16, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

service/shopping-experience Issues and PRs related to this service.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants