Skip to content

fix(import): map file templates onto Apply template to tags - #13292

Open
tiensonqin wants to merge 3 commits into
masterfrom
fix/db-test-1184-import-template-applied-to
Open

tiensonqin wants to merge 3 commits into
masterfrom
fix/db-test-1184-import-template-applied-to

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1184

Problem

When importing an OG (file) graph into DB, templates that had extra properties on the template block kept those properties on the template itself. That did not match the DB template model, where such properties should be owned by a tag via Apply template to.

Fix

During file-graph export/import:

  • Mark template roots that have extra (non-template-metadata) properties.
  • Map them onto :logseq.property/template-applied-to with a tag named after the template.
  • Attach the template's extra properties to that tag.
  • Templates without extra properties stay unmarked.

Tests

  • Exporter marks only templates with extra properties for Apply template to.
  • Async import maps those templates onto an applied-to tag that owns the extra properties.

Demo

File-to-DB import of an OG graph whose project-task template has extra properties. After import, that template shows Apply template to tags: project-task. Templates without extra properties stay unset.

import_og_graph_apply_template_to.mp4

Import File to DB graph option

Select OG graph folder upload prompt

File to DB import dialog

Imported templates with Apply template to tags

Copilot AI lite review requested due to automatic review settings September 17, 2026 17:02

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cursor

cursor Bot commented Sep 18, 2026

Copy link
Copy Markdown

UX: import OG file graph with templated properties, then confirm Apply template to on the imported template.

Source graph og-template-import:

  • project-task has extra properties status-note / owner
  • simple-title has no extra properties

After File to DB import, project-task shows Apply template to tags: project-task. simple-title stays unset.

import_og_graph_apply_template_to.mp4

Import File to DB graph
Select OG graph folder
File to DB import dialog
Imported templates with Apply template to tags

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Imported OG templates with properties can't define new properties / inconsistent with DB template model

3 participants