Skip to content

fix(outliner): outdenting a selection over 2 levels never moves a block deeper - #13608

Closed
yuxi-liu-wired wants to merge 1 commit into
logseq:masterfrom
yuxi-liu-wired:fix/outdent-two-levels
Closed

yuxi-liu-wired wants to merge 1 commit into
logseq:masterfrom
yuxi-liu-wired:fix/outdent-two-levels

Conversation

@yuxi-liu-wired

@yuxi-liu-wired yuxi-liu-wired commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1319.

On a page with blocks a (children a1; a2 with child a2x), b, c, d: click a2x, Shift+click b, press Shift+Tab. Expected: a2x goes out 1 level, after a2 under a; b, c and d stay. Actual: the page reads a (a1, a2, a2x, b (c, d)): b goes 1 level deeper, into a, and c and d, which were not selected, 2 levels deeper, under b. With "Logical outdenting" on, b still goes into a.

indent-outdent-blocks in deps/outliner/src/logseq/outliner/core.cljs takes the blocks to outdent with a take-while that stops only at a block whose parent is the target's parent. b is above that level, so it is taken too and moved after a2; default outdenting then moves b's old right siblings, c and d, under it.

The take-while now takes only the selected blocks under the first one's parent (both the default and the parent-original branch). A selected block already above that level stays where it is: Shift+Tab never moves a block deeper.

New test test-outdent-selection-over-2-levels (default and logical outdenting): it fails on master and passes with the change. frontend.modules.outliner.core-test (with its ^:long random indent/outdent test), frontend.worker.undo-redo-test and frontend.handler.editor-test pass.


Devin Review

@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: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

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
…ck deeper

indent-outdent-blocks outdented the selected blocks with a take-while
that stopped only at a block whose parent is the target's parent. A
selected block already above the first one's level (a2x and b, b at
the top) was taken too and moved after a2, one level deeper; default
outdenting then moved b's old right siblings c and d under it, 2 levels
deeper (db-test logseq#1319).

Only the selected blocks under the first one's parent go out a level.
@yuxi-liu-wired

Copy link
Copy Markdown
Contributor Author

Combined with the other PRs that change the same files into #13783.

@yuxi-liu-wired
yuxi-liu-wired deleted the fix/outdent-two-levels branch October 21, 2026 18:02
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.

Outdenting a selection that spans 2 levels moves blocks deeper

1 participant