Fix query embed rendering with Roam React components#327
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR upgrades the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/Kanban.tsx`:
- Line 34: The module currently assumes window.roamAlphaAPI.ui.react.Block is
always present by assigning const { Block: RenderRoamBlock } =
window.roamAlphaAPI.ui.react; — change this to a defensive access that checks
window, roamAlphaAPI, ui and react exist before extracting Block (e.g., set
RenderRoamBlock to null/undefined if not present) and update any usage-sites of
RenderRoamBlock in this file (Kanban.tsx) to guard/render a fallback when
RenderRoamBlock is missing so the module can load in tests or older roamjs
versions.
In `@src/components/ResultsTable.tsx`:
- Around line 33-34: The module currently destructures RenderRoamBlock and
RenderRoamPage from window.roamAlphaAPI.ui.react at module scope which will
throw if the Roam React API is missing; change this to a defensive access: check
window.roamAlphaAPI && window.roamAlphaAPI.ui && window.roamAlphaAPI.ui.react
(or use optional chaining) before destructuring, and fall back to safe defaults
(e.g., null or no-op components) or perform the destructure inside the component
render/initialization so the module can load even when the API is unavailable;
update references to RenderRoamBlock and RenderRoamPage in ResultsTable to
handle the fallback.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 88e429f8-700d-4c9c-a94e-fb1bd75f748b
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (6)
package.jsonsrc/components/Export.tsxsrc/components/Kanban.tsxsrc/components/ResultsTable.tsxsrc/index.tssrc/utils/getExportTypes.ts
💤 Files with no reviewable changes (1)
- src/index.ts
Summary by CodeRabbit
Bug Fixes
Improvements
Chores