[ENG-1855] Add Roam shared-node import discovery#1162
Conversation
Read-only Roam command (DG: Import - Discover shared nodes) listing group-visible shared nodes from other spaces — source app, space, title, modified time — via the existing my_contents/my_spaces RLS views and the ENG-1847 cross-app contract. Already-imported marking flows through an empty getImportedSourceRids() seam (ENG-1856 fills it; ENG-1859 wires the join). Gated behind a new "Cross-app node import enabled" feature flag, off by default. Pure assembly logic covered by unit tests.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
PR size/scope checkThis PR is over our review-size guideline.
Please split this into smaller PRs unless there is a clear reason the changes need to land together. If keeping it as one PR, please add a brief justification covering:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 797e34e7f0
ℹ️ 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".
Summary
Adds a read-only Roam command DG: Import - Discover shared nodes that lists group-visible shared nodes from other spaces — source app, source space, title, and upstream modified time — so a Roam user can see what's available to import from Obsidian/Roam. Discovery only; the import action itself is ENG-1859.
Part of the Roam↔Obsidian push-pull project, Milestone 2 (Bidirectional node import). Extends the existing Obsidian↔Obsidian discovery reference rather than building a new path.
What it does
discoverSharedNodesreads the RLS-scopedmy_contentsview, excludes the current space, groups by(space_id, source_local_id), prefers thedirectvariant for the title, and resolves space metadata viamy_spaces.CrossAppNodecontract (sourceApp,sourceSpaceId/Name,sourceNodeId,sourceNodeRid,title,sourceModifiedAt,alreadyImported).Design notes (the why)
fullvariant (the ENG-1848 shared/published marker) so the list shows genuinely importable nodes, not every synced title — a deliberate scoping choice (diverges slightly from Obsidian's list-all discovery).alreadyImportedflows through an emptygetImportedSourceRids()seam. Roam has no imported-node store yet (that's ENG-1856), so nothing is imported and nothing is marked; ENG-1859 wires this to ENG-1856's reader. Keys on source RID.my_*views + own-space exclusion, not app-side access logic.getPublishedNodesForGroups/getMyGroups(app-specific client + return shape); not promoted to a shared package yet (future-extraction candidate).Cross-app node import enabledfeature flag (off by default; AdminPanel toggle "Cross-app node import"), mirroringAdvanced node search enabled— the feature is incomplete (no import until ENG-1859), so it stays hidden from users by default. Later M2 commands reuse the same flag.Testing
assembleDiscoveredNodes(variant merge, full-variant filter, RID round-trip, already-imported marking, sorting).tsxharness (all cases pass). eslint / prettier / tsc green.Linear: ENG-1855