Make visuals init safe without data#130
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".
| function maybeCreateUrchinInstance(payload) { | ||
| if (visualsState.useLegacy || visualsState.urchin || !visualsState.mount || !hasVisualEvents(payload)) { | ||
| return; | ||
| } | ||
| const instance = createRadialUrchin(visualsState.mount, { |
There was a problem hiding this comment.
Allow RadialUrchin to initialize for empty schedules
The new guard in maybeCreateUrchinInstance (and the identical check inside createRadialUrchin) now refuses to construct the visual unless the payload contains at least one event. However, web_v1_calendar payloads are valid even when events is an empty array (e.g., freshly generated schedules or weeks that only carry metadata), and the RadialUrchin.update() implementation already handles that case by clearing its layout and rendering the "No activities available" legend. Because of this guard the component never hydrates for empty schedules, so the visuals panel stays blank forever and the user cannot interact with the controls or flip back from the legacy preview even though data was loaded. Please instantiate the urchin whenever a payload object exists and let RadialUrchin deal with empty event lists so that the empty‑state UI can render.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task