Skip to content

Fix query embed rendering with Roam React components#327

Merged
mdroidian merged 2 commits into
mainfrom
fix/query-builder-roam-react-embeds
Jun 3, 2026
Merged

Fix query embed rendering with Roam React components#327
mdroidian merged 2 commits into
mainfrom
fix/query-builder-roam-react-embeds

Conversation

@mdroidian

@mdroidian mdroidian commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Open in Devin Review

Summary by CodeRabbit

  • Bug Fixes

    • Fixed sidebar context association when shift-clicking to send results to the right sidebar—now correctly associates with page UID instead of block UID
  • Improvements

    • Block view type information is now preserved during export operations
  • Chores

    • Updated roamjs-components dependency to v0.88.1

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6afefc12-b468-4dc4-9631-d5e4dacd42f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR upgrades the roamjs-components dependency from ^0.83.4 to ^0.88.1 and refactors multiple components to use the new React component API for rendering Roam blocks and pages. The Kanban and ResultsTable components replace imperative useRef/useEffect patterns with declarative JSX rendering using window.roamAlphaAPI.ui.react components. Supporting changes include updating sidebar window configuration from block-uid to page-uid, removing a clearOnClick handler parameter from a query drawer call, and enriching the TreeNode data structure with a blockViewType field.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix query embed rendering with Roam React components' directly reflects the main changes across the PR, which involve updating query embed rendering logic to use Roam React components (RenderRoamBlock, RenderRoamPage) throughout multiple components, rather than imperative API calls.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mdroidian

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between a68d3a8 and 0802479.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • package.json
  • src/components/Export.tsx
  • src/components/Kanban.tsx
  • src/components/ResultsTable.tsx
  • src/index.ts
  • src/utils/getExportTypes.ts
💤 Files with no reviewable changes (1)
  • src/index.ts

Comment thread src/components/Kanban.tsx
Comment thread src/components/ResultsTable.tsx
@mdroidian mdroidian merged commit 224a292 into main Jun 3, 2026
2 checks passed
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