Skip to content

ENG-1377: Sync templates when syncing a node schema#993

Open
trangdoan982 wants to merge 4 commits intomainfrom
eng-1377-sync-templates-when-syncing-a-node-schema
Open

ENG-1377: Sync templates when syncing a node schema#993
trangdoan982 wants to merge 4 commits intomainfrom
eng-1377-sync-templates-when-syncing-a-node-schema

Conversation

@trangdoan982
Copy link
Copy Markdown
Member

@trangdoan982 trangdoan982 commented May 1, 2026

https://www.loom.com/share/4415ec83680545b180fa2c1e8dc7cabc

Summary

  • When syncing node schemas to Supabase, include the template file content (template_content) so it can be shared across vaults
  • When importing a node schema that carries template_content, automatically create the template file in the local Templates plugin folder
  • Respects Templates plugin state: skips template creation (and clears the template reference) if the plugin is disabled or the folder path is not configured
  • Does not overwrite existing local templates — the local file takes precedence

Test plan

  • Sync a node type that has a template → verify template_content is sent to Supabase
  • Import a node schema from another vault with template_content → verify the template file is created locally
  • Import with Templates plugin disabled → verify notice is shown and template field is not set
  • Import with Templates plugin enabled but folder not configured → same behavior as above
  • Import when template file already exists → verify local file is kept, no overwrite

🤖 Generated with Claude Code

Include template file content when pushing node schemas to Supabase, and
create the template file locally when importing a node schema that carries
template content — respecting the Templates plugin state and folder config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 1, 2026

@supabase
Copy link
Copy Markdown

supabase Bot commented May 1, 2026

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 ↗︎.

Comment thread apps/obsidian/src/utils/templates.ts Outdated
trangdoan982 and others added 3 commits May 4, 2026 00:20
Sanitize templateName before building the file path to prevent a
malicious sync payload (e.g. "../../sensitive") from writing files
outside the configured templates folder.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@trangdoan982 trangdoan982 requested a review from maparent May 4, 2026 15:00
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