Skip to content

Add drag-and-drop layer reordering in Layers panel - #23

Open
Patolord wants to merge 2 commits into
webdevcody:mainfrom
Patolord:feat/drag-drop-layer-reorder
Open

Add drag-and-drop layer reordering in Layers panel#23
Patolord wants to merge 2 commits into
webdevcody:mainfrom
Patolord:feat/drag-drop-layer-reorder

Conversation

@Patolord

Copy link
Copy Markdown

Summary

  • Adds drag-and-drop reordering for floors in the Layers panel, with a visual insertion indicator while dragging.
  • Introduces reorderLayer() to update floor order, shape/edge layer indices, active floor selection, and board rendering.
  • Commits reorder on dragend using the last valid drop target from dragover, which keeps Chrome drag behavior reliable.

Closes #21

Test plan

  • npm run build
  • npx vitest run test/reorderLayer.test.ts
  • Manual Chrome drag in the Layers panel: reorder floors and confirm canvas elevation updates immediately
  • Verify drop indicator appears between rows while dragging
  • Verify reorder is disabled when only one floor exists
  • Verify dragging from layer controls (buttons, color picker) does not start a drag

Made with Cursor

Patolord and others added 2 commits July 28, 2026 21:19
Keep floor contents and rendering synchronized when users rearrange the layer stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
Trim redundant drag target resolution and rely on the proven dragover-to-dragend commit path.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

[FEATURE]: Drag-and-drop layer reordering in the Layers Panel

1 participant