FEE-840 Add schema export for Obsidian#1163
Conversation
Adds an Export discourse graph schema command and settings entry that lets users select node types, relation types, relation triples, and templates and saves them to a dg-schema-<vault>.json file via the Electron save dialog. Includes the shared selection panel, modal shell, file dialog utility, and Zod validation schema that the upcoming import feature will also build on. Co-authored-by: Cursor <cursoragent@cursor.com>
|
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:
|
…n export Co-authored-by: Cursor <cursoragent@cursor.com>
mdroidian
left a comment
There was a problem hiding this comment.
Hey @trangdoan982 , can you split this before review? This PR is currently trying to cover both export and import groundwork in one PR, and that’s too much scope.
Our guideline is 1 PR = 1 Linear ticket, and each ticket/PR should solve one specific problem. Since this work comes from a feedback ticket, the implementation pieces should be split into separate engineering tickets as children of that feedback ticket, then each PR should map to one of those child tickets.
Suggested split:
- Child ENG ticket 1: define the schema file contract and any truly shared foundation needed by both import/export
- Child ENG ticket 2: add Obsidian schema export
- Child ENG ticket 3: add Obsidian schema import
I’d also like us to be stricter about extraction here. Some pieces look broader than the current export use case needs, especially SchemaSelectionModalBody, the large SchemaSelectionState prop surface, openJsonFromUserLocation, and parseDgSchemaFile. Per our placement heuristic, please co-locate code with its primary usage first, export it only when there is a concrete reuse need, and move it to utils/shared components only once there are multiple real call sites.
For this PR specifically, please either narrow it to one ticket’s worth of work or close/supersede it with smaller PRs. At 1,169 lines across 11 files, it’s well over the 400-line threshold, and the scope makes it hard to review responsibly.
https://www.loom.com/share/4510e9ed157a4b3395dc8083aae30770
Another export entry point I forgot to mention:

Summary
dg-schema-<vault>.jsonfile via the Electron native save dialogReactRootModal,useSchemaSelection,SchemaSelectionPanel,SchemaSelectionModalBody,specValidation, andnativeJsonFileDialogsTest plan
pnpm --filter @discourse-graphs/obsidian check-typesdg-schema-<vault>.jsonstructureStack
This is PR 1 of 2. PR 2 (import) will be stacked on this branch.
Made with Cursor