ENG-1976 Add schema export to Obsidian - #1263
Open
trangdoan982 wants to merge 23 commits into
Open
Conversation
…export/import. Adds DiscourseSchemaFile and DiscourseSchemaTemplate type definitions, plus getDgSchemaFileName and DG_SCHEMA_EXPORT_VERSION — the minimal shared primitives needed by both the schema export (ENG-1976) and import (ENG-1977) features. 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.
|
This was referenced Jul 29, 2026
trangdoan982
force-pushed
the
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
branch
from
July 29, 2026 02:53
1e624f3 to
f8e4b8d
Compare
…h export and import)
trangdoan982
force-pushed
the
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
branch
from
July 29, 2026 02:58
f8e4b8d to
e9132f3
Compare
trangdoan982
force-pushed
the
eng-1976-add-schema-export-command-to-obsidian
branch
from
July 29, 2026 02:58
3af9adf to
f364d5a
Compare
… types - Delete ReactRootModal.tsx (no callers yet; DRY savings too small to justify the abstraction layer) - Annotate each sub-schema with z.ZodType<T> so TypeScript verifies schema coverage against the authoritative types in types.ts at compile time - Drop the `as DiscourseSchemaFile` cast from parseDgSchemaFile — no longer needed once dgSchemaFileSchema is typed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…panel UI, not foundation)
trangdoan982
force-pushed
the
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
branch
from
July 29, 2026 19:45
e9132f3 to
6eefcca
Compare
trangdoan982
force-pushed
the
eng-1976-add-schema-export-command-to-obsidian
branch
from
July 29, 2026 19:45
f364d5a to
09bb0e7
Compare
trangdoan982
force-pushed
the
eng-1976-add-schema-export-command-to-obsidian
branch
from
July 30, 2026 03:18
5119839 to
cfff9bf
Compare
…port) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
trangdoan982
force-pushed
the
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
branch
from
July 30, 2026 16:54
bc97511 to
55f5f58
Compare
trangdoan982
changed the base branch from
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
to
main
July 30, 2026 16:56
Contributor
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:
|
trangdoan982
changed the base branch from
main
to
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
July 30, 2026 16:56
trangdoan982
force-pushed
the
eng-1976-add-schema-export-command-to-obsidian
branch
from
July 30, 2026 17:01
cfff9bf to
3820532
Compare
vaultName is not unique — two vaults can share a name — so it cannot identify the source space. Recording vaultId (the Obsidian appId) lets an importer rebuild the source RID as orn:obsidian.schema:<appId>/<localId>, which is what the existing Supabase import path already generates. Schema imported from a file and content imported from that same vault over Supabase then resolve to the same importedFromRid. Required rather than optional: the export command that produces these files has not shipped, so no version 1 files exist to stay compatible with. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…gs with selection panel)
…emplateToNodeTypeNames double-pass - Remove `emptyTemplateText` prop from SchemaSelectionPanel and SchemaSelectionModalBody; hardcode "No template files found." - Remove `beforePanel` and `afterPanel` props from SchemaSelectionModalBody (afterPanel had no callers; beforePanel is now composed as a sibling at the call site) - Collapse templateToNodeTypeNames two-pass sort into a single sorted source array + single map-build pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…discourseRelationIds Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…otModal abstraction)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…csModal constructor, fix type guard, batch warnings - specExport.ts: drop SpecExportSelection, import SchemaSelection from ~/types; add type guard on selectedRelationTypes - ExportSpecsModal.tsx: constructor takes only plugin (extracts app internally); remove plugin.app from useMemo deps; pass payload directly to exportSchemaSelection; batch warnings into one Notice - registerCommands.ts: simplify callback to single expression - GeneralSettings.tsx: remove redundant void cast Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rectly Replace asMap + map + filter with Set membership filter over settings arrays. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ifetime Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ortSchemaSelection Removes SpecExportResult and buildSchemaExportPayload; exportSchemaSelection now returns Promise<string> and surfaces warnings via onWarning callback, eliminating the three-hop pass-through. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The field is part of the schema file contract defined in ENG-1975; this fills it from the vault's appId so importers can rebuild the source RID. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
5 tasks
trangdoan982
force-pushed
the
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
branch
from
July 30, 2026 18:12
55f5f58 to
07ccd44
Compare
trangdoan982
force-pushed
the
eng-1976-add-schema-export-command-to-obsidian
branch
from
July 30, 2026 18:12
31a387c to
83e0548
Compare
mdroidian
approved these changes
Aug 13, 2026
Base automatically changed from
eng-2083-add-schema-selection-panel-ui-for-obsidian-exportimport
to
main
August 25, 2026 22:29
Resolve conflicts with ENG-2083 (#1262), which landed the shared schema selection panel on main. Main's SchemaSelectionPanel/ModalBody inline the same Notice this branch routed through onDependencyViolation and adds node type sorting, so take main's version and drop the now-redundant prop from ExportSpecsModal. GeneralSettings and registerCommands conflicts were additive (export modal vs. help menu / feedback command) — keep both. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://www.loom.com/share/38ffe52d5c5e410282e962079103513d
https://www.loom.com/share/45b49cc16d7b498482643edcc68e4a4c
Summary
Adds the schema export command and settings entry point.
specExport.ts— serializes the vault's selected node types, relation types, relation triples, and templates into theDiscourseSchemaFileJSON formatExportSpecsModal.tsx— modal that rendersSchemaSelectionModalBody+SchemaSelectionPanel; user selects items to export then saves to a filesystem location via the native save dialogGeneralSettings.tsx— adds "Export discourse graph schema" entry to the settings UIregisterCommands.ts— registersexport-dg-schemacommand in the command palettePopulating
vaultIdspecExport.tsfillsvaultIdfrom the vault's ObsidianappIdviagetVaultId(plugin.app).The field itself — the type and the Zod validation — is defined in #1180, since it is part of the schema file contract. This PR only populates it. The reason it exists:
vaultNameis not unique across vaults, so it cannot identify a source space;vaultIdlets the importer in #1264 rebuild the source RID asorn:obsidian.schema:<appId>/<localId>, matching what the existing Supabase import path generates.Stack
PR 3 of 5 for FEE-840. Stacks on #1262.
Test plan
pnpm --filter @discourse-graphs/obsidian check-typespassesdg-schema-<vault>.jsonto the chosen filesystem locationvaultIdmatching the vault'sappIdvaultNameproduce differentvaultIdvalues