Skip to content

fix: restore property values after undoing a block move or delete - #13335

Merged
tiensonqin merged 2 commits into
masterfrom
logseq/undo-property-value-move-617c
Sep 21, 2026
Merged

tiensonqin merged 2 commits into
masterfrom
logseq/undo-property-value-move-617c

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1241

Text and URL property values are real blocks, so they can be moved with Ctrl+Shift+M or deleted like other blocks. Undo rebuilt those actions as a plain :move-blocks / :insert-blocks back to the owner, which does not reattach :logseq.property/created-from-property or the owner's property ref. The value came back as a missing property (delete) or a normal child of the page/node (move).

Changes

  • Inverse move-blocks includes :created-from-property when the moved root was a property value.
  • Inverse delete-blocks / insert-blocks uses the same opt so undo restore reattaches both the created-from-property marker and the owner's property ref.
  • move-block and insert-blocks use that opt (or a sibling property-value target) to restore the value as a property instead of a child block.

Tests

  • Move a text or URL property value, apply the derived undo op, and assert it is a property value again rather than a child block.
  • Delete a text, URL, or many-cardinality text property value, apply the derived undo op, and assert the owner still has that property value.
Open in Web Open in Cursor 

Copilot AI lite review requested due to automatic review settings September 20, 2026 16:57

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.

@tiensonqin tiensonqin self-assigned this Sep 21, 2026
@tiensonqin
tiensonqin force-pushed the logseq/undo-property-value-move-617c branch from d43966d to 0a022af Compare September 21, 2026 09:52
@cursor cursor Bot changed the title fix: restore property values after undoing a block move fix: restore property values after undoing a block move or delete Sep 21, 2026
@tiensonqin
tiensonqin force-pushed the logseq/undo-property-value-move-617c branch from 5bfae4c to 006f358 Compare September 21, 2026 10:40
cursoragent and others added 2 commits September 21, 2026 19:09
Undo of move-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not page children.

Co-authored-by: Tienson Qin <[email protected]>
Undo of delete-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not missing values.

Co-authored-by: tiensonqin <[email protected]>
@tiensonqin
tiensonqin force-pushed the logseq/undo-property-value-move-617c branch from 006f358 to 40b6ee6 Compare September 21, 2026 11:10
@tiensonqin
tiensonqin merged commit 7aa16a9 into master Sep 21, 2026
13 of 14 checks passed
@tiensonqin
tiensonqin deleted the logseq/undo-property-value-move-617c branch September 21, 2026 11:11
devin-ai-integration Bot pushed a commit that referenced this pull request Oct 1, 2026
…3335)

* fix: restore property values after undoing a block move

Undo of move-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not page children.

Co-authored-by: Tienson Qin <[email protected]>

* fix: restore property values after undoing a block delete

Undo of delete-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not missing values.

Co-authored-by: tiensonqin <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
devin-ai-integration Bot pushed a commit that referenced this pull request Oct 8, 2026
…3335)

* fix: restore property values after undoing a block move

Undo of move-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not page children.

Co-authored-by: Tienson Qin <[email protected]>

* fix: restore property values after undoing a block delete

Undo of delete-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not missing values.

Co-authored-by: tiensonqin <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
devin-ai-integration Bot pushed a commit that referenced this pull request Oct 8, 2026
…3335)

* fix: restore property values after undoing a block move

Undo of move-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not page children.

Co-authored-by: Tienson Qin <[email protected]>

* fix: restore property values after undoing a block delete

Undo of delete-blocks now reattaches :logseq.property/created-from-property
so text/url property values return as property values, not missing values.

Co-authored-by: tiensonqin <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
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.

Undoing a Block Move from a Text or URL Property Value Moves the Block to the Node's Child Blocks

3 participants