Rewrite drag/cluster system with magnetic snap and gather gesture

Refactorkamo-internal
Shipped
April 29, 2026 at 9:55 PM UTC
Author
kamo
Commit
50eec27

Replace the monolithic HexHeadGroup (847 lines) with a modular cluster engine under app/components/chat/hexheads/. Single source of truth: every head lives in a cluster (size 1+), with seats filled innermost-first. Drag detaches a head into its own cluster; on release within MAGNETIC_RADIUS of another cluster's bounding circle, it merges into the closest free seat. Wiggle/shake, circular motion, or hold-while-moving during a drag triggers a gather that pulls every other head into the dragged cluster as a single mega-cluster. Tool windows now only soft-push clusters that actually overlap them, eliminating the cascading reflow that caused heads to fly around on every window event. The home cluster re-pins to the bottom-right after any structural change. Adds a magnetic preview ghost to telegraph snap targets during drags.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing