Build S6: outliner interaction II — drag-reorder + zoom-in/focus-subtree #112

Closed
opened 2026-10-15 14:08:52 +02:00 by AlexKucera · 1 comment
Owner

Part of #110

Question

Build S6: outliner interaction II — drag-reorder + zoom-in/focus-subtree (ADR-0013 surface, #102's deferred scope). Drag-reorder: pointer drag of a block (with subtree) to a new position — drop targets = sibling gaps within/between parents and ONTO a block to nest as its child; uses the existing path-addressed structural ops (OutlineTree.move/siblingMove semantics extended to arbitrary destinations); batch moves must respect the sibling-only batch ceiling or promote to a single-subtree move when a multi-block drag is detected. Zoom-in/focus-subtree: a command/affordance (e.g. ⌘. or ⌥click per prototype verdict) roots the presenter's visible projection at a node (breadcrumb shows the path back; zoom-out pops one level); folds stay session-scoped view state, folding of the zoom root's subtree unchanged. Interaction details (drop indicators, auto-expand on hover-dwell, zoom chrome) land per P1's calibrated prototype; LogSeq is the adopted interaction reference.

[Generated by AI]

Part of #110 ## Question **Build S6: outliner interaction II — drag-reorder + zoom-in/focus-subtree** (ADR-0013 surface, #102's deferred scope). Drag-reorder: pointer drag of a block (with subtree) to a new position — drop targets = sibling gaps within/between parents and ONTO a block to nest as its child; uses the existing path-addressed structural ops (`OutlineTree.move`/`siblingMove` semantics extended to arbitrary destinations); batch moves must respect the sibling-only batch ceiling or promote to a single-subtree move when a multi-block drag is detected. Zoom-in/focus-subtree: a command/affordance (e.g. ⌘. or ⌥click per prototype verdict) roots the presenter's visible projection at a node (breadcrumb shows the path back; zoom-out pops one level); folds stay session-scoped view state, folding of the zoom root's subtree unchanged. Interaction details (drop indicators, auto-expand on hover-dwell, zoom chrome) land per P1's calibrated prototype; LogSeq is the adopted interaction reference. [Generated by AI]
AlexKucera added the wayfinder:task label 2026-10-15 14:08:52 +02:00
AlexKucera added a new dependency 2026-10-15 14:09:14 +02:00
AlexKucera self-assigned this 2026-10-16 11:02:45 +02:00
Author
Owner

Resolution — S6 landed

Built per the P1 verdict (variant A "fat gaps"), interaction-for-interaction:

Drag-reorder

  • ⋮⋮ grip in the 20pt left margin (hover-revealed, open-hand cursor) — batch when the row is in the block selection, solo when not; body-drag on already-selected static rows; 4px threshold so clicks never drag; Esc cancels.
  • Hit zones per visible row: top 30% = seam above, middle 40% = onto (last child, ring), bottom 30% = seam below; seam resolves as insert-before-following-row at ITS depth (a deeper follower nests under the row above), end-of-list seam = after the last row at its depth. Line indicator's left edge = the future bullet column (20 + d·18 + 11); onto = 2px rust ring; invalid targets (own subtree) = dashed + muted, drop no-ops, storage untouched.
  • Multi-block runs land as one contiguous run — selection rides deduped (a selected ancestor carries its descendants), extraction reverse-doc-order, anchor re-resolved by node id after extraction (the applyBatch discipline). A drop can never steal siblings (line-insertion semantics). After a drop the moved run IS the selection (anchor = first, focus = last). Origin no-ops restore the snapshot.
  • No system dragging session: monitor-owned tracking (local + global for capture) — an Esc-cancel can never resolve as a drop. Live row geometry = an AppKit view-tree walk per pointer event (SwiftUI 27 removed the .window coordinate space; cached frames go stale on scroll).

Zoom-in / focus-subtree

  • Double-click any bullet roots the projection at that node's CHILDREN (depths re-based to 0; the zoom root's own fold ignored while it is the root). Breadcrumb above the rows: "⟵ zoom out" = full out, ancestor crumbs zoom to that node, current crumb inert. Esc climbs one level. Selection survives only fully visible; focus falls to the projection's first row when it leaves. Zoom is view-only state, reset on every load.

Implementation: OutlineTree.extract/insertRun primitives + OutlinePresenter.DropTarget/draggedIDs/isValidDrop/applyDrop/hitTestDrop (pure, tested) + zoom param on visibleRows/rangeIDs; surface work in OutlineEditorView.swift (handlers in a same-file extension); plumbing in new OutlineDrag.swift; the promoted row editor extracted unchanged into OutlineRowTextView.swift.

Verification: full xcodebuild test (unit + UI) green — 11 new pins (tree primitives ×2, presenter drag/zoom ×9). SwiftFormat + SwiftLint clean (0 serious). Also un-broke the test targets: 8e70f69 bumped the app to deployment target 27.0 but left tests at 26.5 — they couldn't link the module; all configs aligned to 27.0.

Known ceilings (ponytail-marked): no auto-scroll mid-drag; no floating ghost chip (lifted rows + indicators carry the feedback); caret still lands at row end on click-focus. Interaction feel was calibrated live at P1; worth a minute of dogfood in the running app.

Record: docs/devlog/20261016-issue112-outline-interaction-ii_log.md (commit pending authorization).

[Generated by AI]

## Resolution — S6 landed Built per the [P1 verdict](https://git.babylondreams.de/AlexKucera/Museion/issues/113) (variant A "fat gaps"), interaction-for-interaction: **Drag-reorder** - ⋮⋮ grip in the 20pt left margin (hover-revealed, open-hand cursor) — batch when the row is in the block selection, solo when not; body-drag on already-selected static rows; 4px threshold so clicks never drag; Esc cancels. - Hit zones per visible row: top 30% = seam above, middle 40% = onto (last child, ring), bottom 30% = seam below; seam resolves as insert-before-following-row at ITS depth (a deeper follower nests under the row above), end-of-list seam = after the last row at its depth. Line indicator's left edge = the future bullet column (20 + d·18 + 11); onto = 2px rust ring; invalid targets (own subtree) = dashed + muted, drop no-ops, storage untouched. - Multi-block runs land as one contiguous run — selection rides deduped (a selected ancestor carries its descendants), extraction reverse-doc-order, anchor re-resolved by node id after extraction (the applyBatch discipline). A drop can never steal siblings (line-insertion semantics). After a drop the moved run IS the selection (anchor = first, focus = last). Origin no-ops restore the snapshot. - No system dragging session: monitor-owned tracking (local + global for capture) — an Esc-cancel can never resolve as a drop. Live row geometry = an AppKit view-tree walk per pointer event (SwiftUI 27 removed the `.window` coordinate space; cached frames go stale on scroll). **Zoom-in / focus-subtree** - Double-click any bullet roots the projection at that node's CHILDREN (depths re-based to 0; the zoom root's own fold ignored while it is the root). Breadcrumb above the rows: "⟵ zoom out" = full out, ancestor crumbs zoom to that node, current crumb inert. Esc climbs one level. Selection survives only fully visible; focus falls to the projection's first row when it leaves. Zoom is view-only state, reset on every load. **Implementation**: `OutlineTree.extract`/`insertRun` primitives + `OutlinePresenter.DropTarget`/`draggedIDs`/`isValidDrop`/`applyDrop`/`hitTestDrop` (pure, tested) + zoom param on `visibleRows`/`rangeIDs`; surface work in `OutlineEditorView.swift` (handlers in a same-file extension); plumbing in new `OutlineDrag.swift`; the promoted row editor extracted unchanged into `OutlineRowTextView.swift`. **Verification**: full `xcodebuild test` (unit + UI) green — 11 new pins (tree primitives ×2, presenter drag/zoom ×9). SwiftFormat + SwiftLint clean (0 serious). Also un-broke the test targets: 8e70f69 bumped the app to deployment target 27.0 but left tests at 26.5 — they couldn't link the module; all configs aligned to 27.0. **Known ceilings** (ponytail-marked): no auto-scroll mid-drag; no floating ghost chip (lifted rows + indicators carry the feedback); caret still lands at row end on click-focus. Interaction feel was calibrated live at P1; worth a minute of dogfood in the running app. **Record**: docs/devlog/20261016-issue112-outline-interaction-ii_log.md (commit pending authorization). [Generated by AI]
Sign in to join this conversation.