Skip to content

toolkit: add first-class drag-and-drop event kinds#13

Merged
tannevaled merged 1 commit into
mainfrom
toolkit-dnd-events
Jul 10, 2026
Merged

toolkit: add first-class drag-and-drop event kinds#13
tannevaled merged 1 commit into
mainfrom
toolkit-dnd-events

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Formalises the drag lifecycle the widget model was missing — the first of the pre-1.0 "model edge" items from the README's Next section.

  • Events (appended to the enum, additive/non-breaking): EventDragStart / EventDragMove / EventDragLeave / EventDrop.
  • Interfaces: DragSource (DragData() string) and DropTarget (AcceptsDrop(payload) bool) — the host contract for discovering which widgets participate.
  • Payloads: SplitDropPayload / JoinDropPayload for multi-item drops carried newline-separated in Event.Code.
  • DropZone drops its acknowledged synthetic-EventChar seam and now drives its hover cue + OnDrop from the formal events as a DropTarget, delivering every dropped item.

The only ecosystem consumer (svg gallery) uses DropZone for a static render only, so the behaviour change is contained. 100% coverage; go vet clean; builds on all 6 arches + js/wasm.

🤖 Generated with Claude Code

Formalises the drag lifecycle the widget model was missing: EventDragStart /
EventDragMove / EventDragLeave / EventDrop (appended to the event enum), plus
a DragSource / DropTarget interface pair and SplitDropPayload / JoinDropPayload
for multi-item payloads carried in Event.Code.

DropZone drops its acknowledged synthetic-EventChar seam and now drives its
hover cue + OnDrop from the formal events as a DropTarget (accepting any
non-empty payload, delivering all newline-separated items). 100% coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 6cbcc84 into main Jul 10, 2026
1 check passed
@tannevaled
tannevaled deleted the toolkit-dnd-events branch July 10, 2026 12:38
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