Skip to content

outliner: add move up/down to editor toolbar - #34

Merged
tiensonqin merged 5 commits into
mainfrom
devin/1790440780-outliner-move-updown
Sep 26, 2026
Merged

tiensonqin merged 5 commits into
mainfrom
devin/1790440780-outliner-move-updown

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Move up / Move down actions to the outliner editor toolbar on both hosts (Apple and Flutter), placed right after indent/outdent and wired through the existing PerformOutlinerToolbarAction → outliner-toolbar effect → Toolbar RPC path (moveUp / moveDown wire actions).

Move semantics intentionally mirror logseq's move-blocks-up-down (deps/outliner): contiguous selected roots (or the editing block) reorder within their siblings; at a boundary the selection crosses into the parent's neighbor as its first child — first-child move-up lands in the parent's previous sibling, last-child move-down lands in the parent's next sibling. Root-level edges, mixed-parent, and non-contiguous selections are no-ops (toolbar still emits the haptic, matching indent/outdent).

Also fixes an outdent divergence found while checking parity: logseq's direct outdenting re-parents the moved selection's trailing siblings as children of the last moved block — Outliner_state.outdent now emits those pending_moves too.

The toolbar now relies on scroll-leading pinning: hide-keyboard stays fixed at the trailing edge while the remaining buttons scroll horizontally (LUI change in logseq/lui#57, pinned here as 912829b9 on both Package.swift and pubspec).

New move/toolbar_reorder in outliner_state.ml; new Move_up/Move_down variants in outliner_toolbar; SF Symbols arrow.up/arrow.down and Material arrow_upward/arrow_downward icons; OCaml tests cover sibling reorder, selection preservation, boundary crossing, and no-op edges.

Testing: dune build @shared/native/runtest + @shared/test/runtest — 720 tests pass; verified in iPhone 17 simulator (native simctl recording in review comment).

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

Add Move up / Move down actions to the outliner editor toolbar on both
Apple and Flutter hosts, next to the existing indent/outdent buttons.

Move semantics follow logseq's move-blocks-up-down: contiguous selected
roots reorder within their siblings; at a boundary the selection crosses
into the parent's neighbor as its first child (first-child move-up ->
parent's previous sibling, last-child move-down -> parent's next
sibling); root-level edges and mixed-parent selections are no-ops.

Outdent now also adopts the moved selection's trailing siblings as
children of the last moved block, matching logseq direct outdenting.
@devin-ai-integration

Copy link
Copy Markdown

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

Copy link
Copy Markdown

Manual iOS verification — Move up/down editor toolbar

Verified on iPhone 17 simulator against local db-sync (feature/native-mobile-app), build at 7fa33b8.

Editor toolbar with Move up/down and final block structure after boundary-crossing moves

Tested on journal fixture A, B[b1, b2], C:

  • ↑/↓ buttons render on the editor toolbar after outdent/indent (arrow.up/arrow.down SF Symbols)
  • Mid-sibling reorder: B ↑ → above A, ↓ → back; children move along, edit focus kept
  • Root edges no-op: ↑ on top block, ↓ on bottom block change nothing
  • Boundary crossing matches logseq: first-child ↑ → becomes first child of parent's previous sibling (b1 → under A); last-child ↓ → first child of parent's next sibling (b2 → under C)
Note / possible follow-up Multi-select (long-press) shows the separate selection toolbar, which has no move buttons — multi-block move is supported in the core but not reachable via toolbar UI. Also, toolbar buttons expose no accessibility names in the iOS AX tree (pre-existing pattern, same for indent/outdent).

@devin-ai-integration

Copy link
Copy Markdown

Manual iOS verification — pinned hideKeyboard + move up/down (lui b4aca63c)

Verified on iPhone 17 simulator against local db-sync. The toolbar now keeps ⌨ pinned at the trailing edge while the rest of the buttons scroll inside the fused capsule.

Portrait: scroll capsule clipped at 📷, ⌨ pinned at right edge

  • ✅ ⌨ capsule pinned at trailing edge in portrait at rest
  • ✅ Scrolling the capsule: content scrolls inside (☑…📷 ↔ ↑…[[]]), ⌨ never moves; task ☑ reachable by scrolling back
  • ✅ Tapping pinned ⌨ dismisses editing
  • ✅ ↑/↓ reorder blocks (incl. boundary crossing into the parent's neighbor)
  • ✅ Landscape: full capsule + pinned ⌨

Requires logseq/lui#58 (scrollCapsule fix) — the lui pin here tracks that branch until it lands.

@tiensonqin
tiensonqin merged commit 555bbeb into main Sep 26, 2026
2 checks passed
@tiensonqin
tiensonqin deleted the devin/1790440780-outliner-move-updown branch September 26, 2026 18:28
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.

1 participant