Skip to content

Move up/down does nothing, or jumps, when blocks are Ctrl+clicked bottom first #1316

Closed
logseq/logseq
#13607

Description

@yuxi-liu-wired

Steps

  1. On a page with top-level blocks a, b, c, click into c to edit it.
  2. Ctrl+click b (Cmd+click on macOS).
  3. Press Alt+Shift+Up (Cmd+Shift+Up on macOS).

The same happens with a, b, c, d: Ctrl+click c, then Ctrl+click b, then Alt+Shift+Up or Alt+Shift+Down.

Expected

b, c move up together: b, c, a. That is what the same 2 blocks do when selected with Shift+click, as in the e2e test move-up-down (clj-e2e/test/logseq/e2e/outliner_basic_test.clj).

Actual

Neither key moves anything. With a selection whose blocks are not siblings, the blocks jump instead. Example: on a page a (children a1; a2 with child a2x), b, c (child c1), d, Ctrl+click a2x, then Ctrl+click c, and press Alt+Shift+Up. Both a2x and c become children of a1. Clicking c first, then a2x, puts a2x and c after a.

Cause

The UI sends the selected ids in click order (state/get-selection-block-ids; Ctrl+click appends with direction :down). move-blocks-up-down in deps/outliner/src/logseq/outliner/core.cljs takes the target from (first top-level-blocks) for up and (last top-level-blocks) for down, in that order. move-blocks then sorts the blocks into page order and either finds b already right after a (move-to-original-position?) or finds the target c inside the selection, and does nothing.

Found with a model-based property test of outliner operations built as the UI builds them (Ctrl+click selections in any order), replayed on upstream master 16c4ed1a0.

Activity

  1. yuxi-liu-wired commented on Oct 6, 2026

    @yuxi-liu-wired
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions