Skip to content

Resolve namespace page roots as top-level pages - #13502

Open
tiensonqin wants to merge 3 commits into
masterfrom
logseq/fix-namespace-root-lookup-17a6
Open

tiensonqin wants to merge 3 commits into
masterfrom
logseq/fix-namespace-root-lookup-17a6

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1348

Creating Foo/Baz after Bar/Foo no longer nests Baz under Bar's Foo. The first namespace segment now resolves only a top-level page (Library or parentless) or a Root-extending tag, then later segments look up children on that resolved parent.

Same path is used for tags, so #foo/bar then #Bar/Foo keeps two case-distinct trees.

Tests

  • create-namespace-pages-root-is-order-independent covers Bar/Foo then Foo/Baz, the reverse order, reuse of a standalone Foo, and Foo/Baz/Qux after Bar/Foo/Baz
  • create-namespace-tags-root-is-case-and-order-independent covers the tag case-variant sequence and reuse of a shared parent tag
  • logseq.outliner.page-test: 19 tests, 113 assertions
  • Full deps/outliner suite: 137 tests, 701 assertions

Link to Devin session: https://app.devin.ai/sessions/3a4208ad1b644845abf6880feaf0be3d
Open in Devin Desktop: https://app.devin.ai/desktop/session/3a4208ad1b644845abf6880feaf0be3d?variant=devin
Requested by: @megayu

cursoragent and others added 2 commits October 2, 2026 12:17
First path segment of a namespaced page or tag now looks up only a
top-level page or Root-extending tag, so Bar/Foo then Foo/Baz creates
a Library Foo instead of nesting Baz under Bar/Foo.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Reuse of an existing top-level tag no longer writes a nil extends.
Tag create still rejects a property or top-level page as the first
segment so mixed-parent validation stays fail-fast.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the logseq/fix-namespace-root-lookup-17a6 branch from eb37bff to da0eac2 Compare October 2, 2026 12:17
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 2, 2026 13:16

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating a namespace page takes a nested page with the root's name as its root

3 participants