The previous pass listened to mousemove ON the content element and
cleared the seam on mouseleave. The "+" button lives at left:-28px
of the content (in the gutter), so the moment the cursor reached the
button it triggered mouseleave on content → seam cleared → button
vanished → cursor was over content again → mousemove → button shown
→ loop. That was the constant flicker.
Three fixes, smallest to largest:
1. **Listen on document, not content.** A single document-level
mousemove handler with manual bounds checking. No more
mouseleave/mouseout firing as the cursor crosses element edges.
2. **Hold steady when over the inserter itself.** If `e.target` is
under `[data-words-block-inserter]`, return early — don't recompute
or clear the seam. The button can stay reachable forever.
3. **Memoize the seam.** Reuse the existing Seam object whenever the
snap target (`insertIndex`) is unchanged. Cursor jitter within
the same snap window no longer triggers re-renders.
Bounds-check buffer: 48px to the left (so the "+" button at -28 is
safely inside the keep-alive zone), 16px on the right, 12px top/bottom.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>