fix: repair tree editor drag-to-reorder (6 bugs) #48

Merged
chihlasm merged 2 commits from fix/tree-editor-drag-reorder into main 2026-02-09 14:50:33 +00:00
chihlasm commented 2026-02-09 04:59:00 +00:00 (Migrated from github.com)

Summary

Fixed 6 bugs in the tree editor's drag-to-reorder functionality that made it effectively non-functional.

Bugs Fixed

  1. Grip-only drag — Only the grip handle icon now initiates drags (was: entire row, conflicting with click-to-select)
  2. Ghost state cleanuponDragEnd on each draggable item prevents stale drag indicators after failed drops
  3. Drop-to-last-position — Trailing drop zone after last child enables dropping at the end of a sibling list
  4. Cross-parent suppression — Drag indicators no longer show for cross-parent drags (which aren't supported)
  5. Drag leave cleanuponDragLeave handler clears drop indicators when cursor exits drop zones
  6. Source parent trackingdragSourceParentId threaded through components for accurate same-parent checks

Files changed

  • frontend/src/components/tree-editor/NodeList.tsx — all fixes (+67/-5 lines)

Test plan

  • Frontend build succeeds
  • 61 frontend tests pass
  • Store logic (reorderNodes) unchanged and correct

🤖 Generated with Claude Code

## Summary Fixed 6 bugs in the tree editor's drag-to-reorder functionality that made it effectively non-functional. ## Bugs Fixed 1. **Grip-only drag** — Only the grip handle icon now initiates drags (was: entire row, conflicting with click-to-select) 2. **Ghost state cleanup** — `onDragEnd` on each draggable item prevents stale drag indicators after failed drops 3. **Drop-to-last-position** — Trailing drop zone after last child enables dropping at the end of a sibling list 4. **Cross-parent suppression** — Drag indicators no longer show for cross-parent drags (which aren't supported) 5. **Drag leave cleanup** — `onDragLeave` handler clears drop indicators when cursor exits drop zones 6. **Source parent tracking** — `dragSourceParentId` threaded through components for accurate same-parent checks ## Files changed - `frontend/src/components/tree-editor/NodeList.tsx` — all fixes (+67/-5 lines) ## Test plan - [x] Frontend build succeeds - [x] 61 frontend tests pass - [x] Store logic (reorderNodes) unchanged and correct 🤖 Generated with [Claude Code](https://claude.com/claude-code)
railway-app[bot] commented 2026-02-09 04:59:09 +00:00 (Migrated from github.com)

🚅 Deployed to the patherly-pr-48 environment in selfless-grace

Service Status Web Updated (UTC)
patherly Success (View Logs) Feb 9, 2026 at 5:14 am
hopeful-liberation Success (View Logs) Feb 9, 2026 at 5:14 am
<!-- railway-bot-comment-version=2 --> <!-- railway-project-id="22b9b58c-271b-42e5-a10e-6fdec8d00134" railway-project-name="selfless-grace" --> 🚅 Deployed to the [patherly-pr-48](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134?environmentId=3f32d092-2a1c-4945-b7b9-681c9f1d3a05) environment in **[selfless-grace](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134)** | **Service** | **Status** | **Web** | **Updated** (UTC) | | :--- | :--- | :--- | :--- | | patherly | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/95f556ff-5264-4116-a0c2-618a2fc53ba4?id=e2e7f889-65b8-4e67-9826-d30e33c46c76&environmentId=3f32d092-2a1c-4945-b7b9-681c9f1d3a05)) | | Feb 9, 2026 at 5:14 am | | hopeful-liberation | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/e1db2ee3-d241-4f45-abe4-c9c5fdf483d5?id=8c6b6895-132f-485f-8fc0-747dd0af7d15&environmentId=3f32d092-2a1c-4945-b7b9-681c9f1d3a05)) | | Feb 9, 2026 at 5:14 am |
Sign in to join this conversation.