[ENG-1848] Add Roam full markdown content variant for shared nodes#1134
[ENG-1848] Add Roam full markdown content variant for shared nodes#1134sid597 wants to merge 6 commits into
Conversation
|
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: add4831df7
ℹ️ 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".
add4831 to
43646a5
Compare
43646a5 to
b4f758c
Compare
|
Reviewer verification note: There is no Loom for this PR because ENG-1848 has no user-facing UI surface; it adds the Roam Final-branch checks run: pnpm exec prettier --check apps/roam/src/utils/convertRoamNodeToFullContent.ts apps/roam/src/utils/convertRoamNodeToFullContent.example.ts apps/roam/src/utils/syncDgNodesToSupabase.ts
pnpm --filter roam check-types
SUPABASE_USE_DB=local pnpm --filter roam buildThe representative Roam input is captured in Optional historical smoke-test reproduction: The temporary console hook used during review exists only in commit git checkout f29b4b9d
SUPABASE_USE_DB=local pnpm --filter roam buildThen load the built Roam extension in graph await window.dgSyncEng1848ReviewPage()That smoke hook writes the page's Note: the hook is not part of the final PR surface. The final branch keeps only the reusable producer/upload path, with |
| allNodes: [] as DiscourseNode[], | ||
| }; | ||
|
|
||
| export const buildFullMarkdown = ({ |
There was a problem hiding this comment.
This intentionally reuses Roam’s existing toMarkdown serializer instead of defining a new markdown format here. ENG-1848’s job is just to adapt Roam page/block content into the existing cross-app full markdown shape.
| } | ||
| }; | ||
|
|
||
| if (includeFullContent) { |
There was a problem hiding this comment.
full is opt-in because Roam should only write the full variant for shared/published nodes. Existing background embedding sync stays direct/direct-ish only.
| const fullContent = convertRoamNodeToFullContent({ | ||
| nodes: roamNodes, | ||
| }); | ||
| await uploadBatches(chunk(fullContent, BATCH_SIZE)); |
There was a problem hiding this comment.
full is uploaded before fetching embeddings so markdown persistence is not blocked by embedding service failures. Embeddings remain only on direct / direct_and_description.
| * node contract. | ||
| * | ||
| * Source Roam page: | ||
| * https://roamresearch.com/#/app/plugin-testing-akamatsulab2/page/dnHNmYwe5 |
There was a problem hiding this comment.
This example uses the real getFullTreeByParentUid(...).children shape from the linked Roam page. We also smoke-tested that page against local Supabase and read back the expected variant = "full" markdown row.
maparent
left a comment
There was a problem hiding this comment.
LGTM.
Question in a line comment.
| embeds: true, | ||
| simplifiedFilename: false, | ||
| removeSpecialCharacters: false, | ||
| maxFilenameLength: 64, |
There was a problem hiding this comment.
Curious about this value: Does it affect the title? (I expect not.) Asset filenames?
Summary
Rebases ENG-1848 on the final ENG-1847 baseline (
5954c548) and keeps the ticket focused on Roam emitting the required markdownfullcontent variant for shared nodes.convertRoamNodeToFullContentso the existing Roam sync loop uploadsfullcontent alongside the current direct content.# {title}plus the node body via the existingtoMarkdownserializer with refs/embeds inlined.CrossAppNodecontract shape:CrossAppNode["content"]["full"]with inlineformat: "text/markdown".Validation
pnpm exec prettier --check apps/roam/src/utils/convertRoamNodeToFullContent.fixture.ts apps/roam/src/utils/convertRoamNodeToFullContent.ts apps/roam/src/utils/syncDgNodesToSupabase.tspnpm --filter roam check-typespnpm --filter roam lint(0 errors; existing repo warnings remain)Manual follow-up
A real Roam graph with sync enabled still needs the Supabase smoke check: confirm a discourse node writes a
variant: "full"markdown row alongside its direct content row.