Skip to content

ENG-1977 Add schema import data layer for Obsidian - #1264

Open
trangdoan982 wants to merge 2 commits into
eng-1976-add-schema-export-command-to-obsidianfrom
eng-1977-add-schema-import-command-to-obsidian
Open

ENG-1977 Add schema import data layer for Obsidian#1264
trangdoan982 wants to merge 2 commits into
eng-1976-add-schema-export-command-to-obsidianfrom
eng-1977-add-schema-import-command-to-obsidian

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

Adds the import data layer — file parsing, match planning, and apply logic. The UI modal is in the next PR.

  • specImport.ts — three responsibilities co-located:
    • parseDgSchemaFile — lightweight version guard + cast (no Zod; export is the authoritative source)
    • buildSchemaImportMatchPlan — computes id and name/label mappings between the schema file and the local vault in one pass; id match first, name/label fallback second
    • applySchemaImportSelection — creates new items as provisional, skips existing matches; preserves template reference when template already exists locally

Stack

PR 4 of 5 for FEE-840. Stacks on #1263.

  1. Shared foundation — ENG-1975 (ENG-1975 Define schema file contract and shared foundation for Obsidian export/import #1180)
  2. Schema selection panel UI — ENG-2083 (ENG-2083 Add schema selection panel UI for Obsidian export/import #1262)
  3. Schema export command — ENG-1976 (ENG-1976 Add schema export command to Obsidian #1263)
  4. This PR — schema import data layer (ENG-1977)
  5. Schema import UI (ENG-2084)

Test plan

  • pnpm --filter @discourse-graphs/obsidian check-types passes
  • parseDgSchemaFile rejects files with wrong version with a clear error
  • buildSchemaImportMatchPlan id-matches first, name/label fallback second
  • applySchemaImportSelection creates new items as provisional, skips duplicates
  • Re-running apply on the same file creates no duplicates
  • New node type retains its template reference when template already exists locally

Open in Devin Review

@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

ENG-1977

@supabase

supabase Bot commented Jul 29, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jul 30, 2026 3:18am

Request Review

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread apps/obsidian/src/utils/specImport.ts
@trangdoan982
trangdoan982 force-pushed the eng-1976-add-schema-export-command-to-obsidian branch from 3af9adf to f364d5a Compare July 29, 2026 02:58
@trangdoan982
trangdoan982 force-pushed the eng-1977-add-schema-import-command-to-obsidian branch from 23c69c1 to d417d43 Compare July 29, 2026 02:59
@trangdoan982
trangdoan982 force-pushed the eng-1977-add-schema-import-command-to-obsidian branch from d417d43 to bc0e07d Compare July 29, 2026 19:45
@trangdoan982
trangdoan982 force-pushed the eng-1976-add-schema-export-command-to-obsidian branch from f364d5a to 09bb0e7 Compare July 29, 2026 19:45
@trangdoan982
trangdoan982 force-pushed the eng-1977-add-schema-import-command-to-obsidian branch from bc0e07d to 34254ad Compare July 30, 2026 02:17
@trangdoan982
trangdoan982 force-pushed the eng-1976-add-schema-export-command-to-obsidian branch from 5119839 to cfff9bf Compare July 30, 2026 03:18
@trangdoan982
trangdoan982 force-pushed the eng-1977-add-schema-import-command-to-obsidian branch from 34254ad to 9073b20 Compare July 30, 2026 03:18
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