Skip to content

feat(outline): PROG-86 drag-to-reorder issues in the Outline view#55

Open
exe-dev-github-integration[bot] wants to merge 2 commits into
mainfrom
iss/PROG-86
Open

feat(outline): PROG-86 drag-to-reorder issues in the Outline view#55
exe-dev-github-integration[bot] wants to merge 2 commits into
mainfrom
iss/PROG-86

Conversation

@exe-dev-github-integration

Copy link
Copy Markdown
Contributor

Closes the work for PROG-86 — drag issues up/down in the Outline, using the same backend rank as the board so a drag in either view moves the issue in the other.

How

The Outline already sorted each sibling group by the fractional-index rank (PROG-43) the board uses to order a status column. So this needs no backend change: a drop mints a key strictly between the two drop neighbours (rankForReorderrankBetween) and fires one optimistic updateIssue({ rank }) — the exact write the board makes. Shared key ⇒ bidirectional sync for free.

Decisions

  • Reorder within a sibling group only. A drop onto a row under a different parent/arc is a no-op; reparenting stays on Tab/Shift+Tab — matches the board's rank-only semantics and the issue's "move up or down in the rank".
  • Dedicated grip handle, not whole-row drag — the row has an editable title input, so a setActivatorNodeRef grip in the left gutter starts drags while tapping/typing the input and the ⋯ open-link keep working.
  • Whole subtree is the sortable block (a dragged parent carries its children); one DndContext per product, a SortableContext per group.
  • PointerSensor (distance 4) + KeyboardSensor — one pointer path for mouse + touch from the grip (touch-none so a grip drag reorders rather than scrolls); the focused handle is arrow-key reorderable for accessibility.

Testing

  • outlineReorder.test.ts — 7 unit tests on the rank math (up/down/top/bottom/no-op/invalid).
  • Browser (Chromium + WebKit): dragging a row's grip reordered its siblings and the new order persisted across a reload (the rank PATCH landed). Mobile (390px): grip renders, rows stay aligned.
  • Full suite: 91 unit tests pass, tsc -b clean.

Docs

docs/REFERENCE.md (Outline) + docs/DECISIONS.md (### PROG-86).

The Outline already sorted each sibling group by the fractional-index rank
(PROG-43) the board orders a status column by. So dragging a row to reorder
needs no backend change: the drop mints a key strictly between the two
neighbours (rankForReorder / rankBetween) and fires one optimistic
updateIssue({ rank }) — the same write the board makes. Because the rank is
shared, a drag in the Outline moves the card on the board and vice-versa,
which is what the issue asks for.

- Reorder within a sibling group only; a drop under a different parent/arc is
  a no-op. Reparenting stays on Tab/Shift+Tab (rank-only, like the board).
- A dedicated grip handle starts drags, so the title input and the open-link
  keep working; the whole subtree is the sortable block so a parent carries
  its children. One DndContext per product, a SortableContext per group.
- PointerSensor (distance 4) covers mouse + touch from the grip (touch-none so
  a grip drag reorders, not scrolls); KeyboardSensor makes the handle
  arrow-key reorderable.
- Math is unit-tested (outlineReorder.test.ts); drag wiring verified in a
  browser (reorder persisted across reload).
REFERENCE (Outline section) + a PROG-86 DECISIONS entry covering the
shared-rank reuse and the reorder-within-siblings / grip-handle decisions.
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