Skip to content

Name imported tag pages from title - #13307

Merged
tiensonqin merged 1 commit into
masterfrom
logseq/imported-tag-page-name-21c7
Sep 19, 2026
Merged

tiensonqin merged 1 commit into
masterfrom
logseq/imported-tag-page-name-21c7

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1212

Problem

Importing a :graph-human EDN export created every user tag page with :block/name derived from the tag's :db/ident instead of from its title. User tag idents carry a random suffix, so a tag titled warning was imported as warning-a04sq4ln. Tags created in the app keep :block/name as the sanitized title (warning).

Change

build-classes-tx now names class/tag pages from :block/title when present, falling back to the ident name only for title-less class defs. This matches build-new-property and in-app tag creation. Existing exports that omit :block/name import correctly.

Tests

Added build-class-page-name-from-title covering:

  • sqlite.build of a user tag whose ident has a random suffix
  • :graph-human import of the same shape

Both assert :block/name equals the human title.

Verified with nbb-logseq:

  • focused regression test: 4 assertions, 0 failures
  • logseq.db.sqlite.build-test + export-test: 54 tests, 225 assertions, 0 failures
  • deps/db unit tests (-e long): 154 tests, 550 assertions, 0 failures
  • LOGSEQ_EXPORT_HUMAN=1 export tests (-e long): 37 tests, 164 assertions, 0 failures
  • clj-kondo on the changed files: 0 errors, 0 warnings
Open in Web Open in Cursor 

@tiensonqin
tiensonqin marked this pull request as ready for review September 19, 2026 11:26
Copilot AI lite review requested due to automatic review settings September 19, 2026 11:26

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.

User tag idents include a random suffix. Import was using that ident
name for :block/name, so a tag titled "warning" became
"warning-a04sq4ln". Derive the page name from :block/title instead,
matching in-app tags and imported properties.

Co-authored-by: Tienson Qin <[email protected]>
@tiensonqin
tiensonqin force-pushed the logseq/imported-tag-page-name-21c7 branch from ef740aa to d3a2d2d Compare September 19, 2026 11:51
@tiensonqin
tiensonqin merged commit 274eae1 into master Sep 19, 2026
25 checks passed
@tiensonqin
tiensonqin deleted the logseq/imported-tag-page-name-21c7 branch September 19, 2026 11:51
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.

Imported tag pages are named after the tag's ident, not its title

3 participants