Fix radial visuals payload handling#145
Conversation
✅ Deploy Preview for wyrrdmaek ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
| if ( | ||
| !this.center || | ||
| typeof this.center.x !== 'number' || | ||
| Number.isNaN(this.center.x) || | ||
| typeof this.center.y !== 'number' || | ||
| Number.isNaN(this.center.y) | ||
| ) { | ||
| if (!this.didWarnInvalidCenter) { | ||
| console.warn('[RadialUrchin] invalid center point, skipping render', this.center); | ||
| this.didWarnInvalidCenter = true; | ||
| } | ||
| this.updateSelectionOverlay(); | ||
| this.updateScrubOverlay(); | ||
| return; |
There was a problem hiding this comment.
Guard still dereferences missing canvas center
The new guard in render() (lines 666‑679) is supposed to skip drawing when this.center hasn’t been computed yet, but the guard immediately calls updateSelectionOverlay() and updateScrubOverlay() which both assume a valid this.center. updateScrubOverlay() in particular unconditionally accesses this.center.x/y (lines 918‑925), so whenever the guard is hit—e.g., right after constructing RadialUrchin before the first ResizeObserver callback sets this.center in handleResize—it still throws Cannot read properties of undefined. This means the “skip render when center is unavailable” change never actually prevents the crash and the radial visual continues to fail to initialize if the mount hasn’t been measured. The guard needs to bail out without invoking code that uses this.center, or those helpers need their own null checks.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task