Lesson 049: Drag-and-Drop as the Simplest Viable Interaction

Lesson 049: Drag-and-Drop as the Simplest Viable Interaction

The Lesson

When the user's mental model is "put this thing in that slot," drag-and-drop is less code and more intuitive than alternatives like dropdowns, search dialogs, or multi-step wizards. The key is spatial co-visibility: the source pool and target slots must be on screen simultaneously so the user can see both what's available and where it goes.

Context

A calendar selection tool needed to let users assign images to 13 monthly slots. The original implementation required navigating to a separate candidates page, clicking "use as starting point" to copy a preset into sessionStorage, then navigating to the selection page. There was no way to browse the full image collection and assign individual images to specific months. The user wanted to drag images from a browsable pool directly into calendar slots.

What Happened

  1. The original selection page had a 13-slot grid and a sidebar with scores. Slots could only be populated by loading a candidate method or a saved selection. No direct image-to-slot assignment was possible.

  2. Rebuilt with a two-column layout: calendar slots on the left, scrollable image pool on the right. Both visible simultaneously — no tab switching, no modals, no page navigation.

  3. Used the HTML5 Drag and Drop API directly:

    • Pool images: draggable=true, dragstart sets dataTransfer with image metadata as JSON
    • Slot targets: dragover (preventDefault to allow drop), dragleave, drop (parse JSON, assign to slot)
    • Slots with images: the image itself is also draggable, enabling rearrangement between slots
  4. Added a method dropdown at the top to pre-populate all 13 slots from a candidate method (A–E), giving users a starting point they can then modify by dragging.

  5. Added per-slot controls: an × button to remove an image, and a cover checkbox (radio-like — at most one checked across all slots) to designate which month's image is the calendar cover.

  6. Scores update live after each drop — the user sees immediately how adding or rearranging an image changes the objective function, diversity, month fit, etc.

Key Insights

Applicability

Drag-and-drop is the right interaction when:

Does NOT apply when:

Related Lessons