Repository navigation
fix(page): a namespace root and a page with no parent share one name space - #13620
Closed
yuxi-liu-wired wants to merge 1 commit into
Closed
yuxi-liu-wired wants to merge 1 commit into
yuxi-liu-wired wants to merge 1 commit into
Conversation
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 6, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 8, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
…space A page created by name has no parent, a namespace root has the Library as parent; the uniqueness check compared by raw parent, so renaming the root "Foo" to an existing "Baz" gave 2 top-level pages named Baz (db-test logseq#1346). Pages with no parent or the Library as parent are now checked against each other.
yuxi-liu-wired
force-pushed
the
fix/rename-top-level-scope
branch
from
October 16, 2026 18:34
b14ff35 to
21431bb
Compare
Contributor
Author
|
Combined with the other PRs that change the same files into #13786. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of logseq/db-test#1346 (its second case; the first, a rename there and back being refused, no longer happens on master since #13516).
Create the page "Baz", then "Foo/Bar" (the Library now holds "Foo"). On the page "Foo", change the title to "Baz": it is accepted, and the graph has 2 top-level pages named "Baz", one of them in the Library. Renaming "Baz" to "Foo" is accepted the same way. Renaming any other page with no parent to "Baz" is refused, and Cmd+K on "Baz" opens the existing page.
validate-unique-for-pageindeps/outliner/src/logseq/outliner/validate.cljsscopes the name check by the raw parent: a page with no parent is compared with other pages with no parent, a page with a parent only with its siblings. Top-level pages come in 2 kinds: a page created by name has no parent, a namespace root has the Library as its parent. So a namespace root and a page with no parent never meet in the check.Both kinds now count as top-level: a page whose parent is the Library is compared with pages with no parent and pages under the Library, and the other way around. Pages inside a namespace keep being compared with their siblings only, so a top-level page may still share a name with a namespace child ("Baz" and "Foo/Baz").
New test
rename-is-checked-among-top-level-pagesindeps/outliner/test/logseq/outliner/page_test.cljs: a namespace root renamed to a top-level page's name and a top-level page renamed to a namespace root's name are refused (both accepted on master); a top-level page renamed to a namespace child's name and back, and siblings in a namespace, behave as before. The outliner tests indeps/outliner(158 tests) andfrontend.handler.db-based.page-test,frontend.modules.outliner.pipeline-test,frontend.worker.undo-redo-test,frontend.worker.outliner-undo-property-test,frontend.worker.db-sync-test,frontend.worker.db-sync-sim-test(with its ^:long tests),frontend.worker.db-listener-test,logseq.api.editor-testpass.