Skip to content

feat(ui): add drag-and-drop reordering for segment rules#2581

Draft
steveninhle wants to merge 1 commit into
mainfrom
feat/ui-segment-rule-drag-and-drop
Draft

feat(ui): add drag-and-drop reordering for segment rules#2581
steveninhle wants to merge 1 commit into
mainfrom
feat/ui-segment-rule-drag-and-drop

Conversation

@steveninhle
Copy link
Copy Markdown
Collaborator

Summary

  • Install @dnd-kit/core and @dnd-kit/sortable for drag-and-drop support
  • Wrap the segment rule list in DndContext + SortableContext; each card
    uses useSortable and shows a grip handle (GripVertical) when there are
    multiple rules
  • Add DragOverlay so the dragged card follows the cursor with a shadow;
    the original card fades to 30% opacity while dragging
  • Keep up/down arrow buttons as an accessible fallback for keyboard users
  • Add segmentRulesMove (from useFieldArray) alongside the existing swap,
    and handleMoveSegmentRule in the targeting page to sync both form state
    and featureRef on drag end

@steveninhle steveninhle force-pushed the feat/ui-segment-rule-drag-and-drop branch from 0c02cf6 to 32834df Compare May 15, 2026 02:31
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