Skip to content

fix: undo bugs for pages, namespaced pages, tags and properties - #13449

Merged
tiensonqin merged 5 commits into
masterfrom
devin/1790403479-undo-fixes-dbtest
Nov 5, 2026
Merged

tiensonqin merged 5 commits into
masterfrom
devin/1790403479-undo-fixes-dbtest

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes five undo/redo bugs around page creation and renaming:

Regression tests added in frontend.worker.undo-redo-test and logseq.outliner.op-construct-test. Verified: frontend.worker.undo-redo-test (33 tests), frontend.undo-redo-test, outliner nbb suite (136 tests), bb lint:kondo-git-changes — all green.

Link to Devin session: https://app.devin.ai/sessions/6139319108654943bb5de5f78070ce63
Open in Devin Desktop: https://app.devin.ai/desktop/session/6139319108654943bb5de5f78070ce63?variant=devin
Requested by: @tiensonqin


Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@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 resolved all 3 findings on ea7da43

Fixed by Devin (3)

  • Slash-formatted journals lack page identity
  • Shared namespace deleted twice on undo
  • Namespaced tag redo loses identity

View all findings in Devin Review

Devin Review

@megayu
megayu force-pushed the devin/1790403479-undo-fixes-dbtest branch from ea7da43 to 3325b50 Compare October 29, 2026 12:18
@megayu megayu changed the title fix: undo bugs for pages, namespaced pages, tags and properties fix: preserve page and property identities across undo and redo Oct 29, 2026
@megayu megayu changed the title fix: preserve page and property identities across undo and redo fix: undo bugs for pages, namespaced pages, tags and properties Oct 29, 2026
@tiensonqin
tiensonqin force-pushed the devin/1790403479-undo-fixes-dbtest branch from 3325b50 to 12e52f2 Compare November 5, 2026 08:36
tiensonqin and others added 5 commits November 5, 2026 08:44
- Record the created page's uuid by matching tx-data datoms against the
  page's namespace title chain, so undo/redo of namespaced page creation
  (e.g. 'ns/child') targets the leaf page instead of an arbitrary entity
  and redo restores the recycled page's uuid.
- Replay create-page by restoring the recycled page when the recorded
  uuid still resolves to it.
- Ignore recycled pages when validating title uniqueness, so undoing a
  rename back to a title held by a recycled page succeeds.
- Resolve a created property's db/ident from tx-data before falling back
  to title lookup, so undo removes the newly created property when an
  existing one shares its name.
- Delete tags created in the same transaction when undoing create-page.
- Compare top-level blocks by document position (page id + ancestor
  order path) instead of raw :block/order, which is only unique within a
  parent, so undo/redo of outdent on a selected range doesn't reorder
  blocks.
- :create-page inverse now also deletes namespace ancestors created in
  the same transaction (walked via :block/parent or
  :logseq.property.class/extends), so undoing a namespaced create leaves
  no orphaned parent pages.
- created-page-title-match? follows the extends chain for class/tag
  pages, so namespaced tags keep their uuid through undo/redo too.
- :create-page replay restores recycled ancestors (top-down, re-reading
  entities per step) before restoring the page itself.
- created-page-title-match? accepts an exact title match, so pages whose
  title contains a slash without namespace splitting (e.g. journals like
  '2026/09/26') keep their uuid through undo/redo.
- Inverse ops dedupe [:delete-page uuid] keeping the last occurrence:
  creating a/b and a/c in one action no longer recycles their shared
  ancestor twice, which overwrote its original-parent.
@tiensonqin
tiensonqin force-pushed the devin/1790403479-undo-fixes-dbtest branch from 933a0b4 to f3ad455 Compare November 5, 2026 08:44
@tiensonqin
tiensonqin merged commit aed1f88 into master Nov 5, 2026
@tiensonqin
tiensonqin deleted the devin/1790403479-undo-fixes-dbtest branch November 5, 2026 08:44
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 13, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…age order

get-top-level-blocks used to decide a consecutive selection was reversed by
comparing the :block/order of its first 2 blocks. Order values are
comparable only between siblings, but a last child and the block after
its parent count as consecutive too; for those 2 the values are
unrelated, and a move could reverse them (db-test logseq#1297: after an undo
re-orders the second block, the redo moves it first).

Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document
order path (page, then each ancestor's order), which fixes this, so this
commit keeps only the regression test.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
A property value selected with its parent's next sibling must stay in the
move or delete. This commit used to guard the page-order sort this PR
added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that
sort with a document-order comparison that keeps every block, so only
the regression test remains.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo.

That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment