Skip to content

Keep the dial's colours with the pointer while dragging - #23

Merged
ericchernuka merged 2 commits into
masterfrom
ec/dial-drag-follows-pointer
Nov 14, 2026
Merged

ericchernuka merged 2 commits into
masterfrom
ec/dial-drag-follows-pointer

Conversation

@ericchernuka

@ericchernuka ericchernuka commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Dragging the ring felt sluggish on desktop. Frames held at 16.7ms; the lag was transitions (the thumb's 180ms ease, the page's 500ms background fade, the card and wordmark fades) restarting on every hue change and trailing the pointer. While a pointer moves the dial, they now switch off. Steps, picks, keys and Back still fade.

 Motion
-  held { hue }
+  held { hue, by: 'key' | 'pointer' }

 transition(aim | nudge)
-  always a new held state
+  same hue, same holder → same state (no re-render)

+followsPointer(motion)
+  held by pointer, or wheel dragged, or coasting
 <Picker>
-  <main hueTheme>
+  <main hueTheme instantMotion?>      # motion tokens → 0s while followsPointer
-  html { background-color }
+  html { background-color; transition: none? }
   <HueDial.Root>
     <Ring>
-      <Thumb>                          # 180ms ease always
+      <Thumb moving>                   # 0s while followsPointer
 <Wordmark>
-  delay: index * 45ms
+  delay: index * motion.stagger        # token, so it zeroes too

The card's "Aa" contrast sample fails contrast on purpose (it shows the pair the chip grades). It's now ::before content, still aria-hidden, so Lighthouse stops counting it.

Evidence

  • Before: four fast laps of the ring on the production build: thumb 13.6° behind the pointer, 10 transitions running mid-drag, 509 style recalcs. Lighthouse desktop accessibility 96 (color-contrast on "Aa").
    After: thumb 1.2° behind (the 5° snapping between hues), 0 transitions, 150 recalcs. Lighthouse desktop 100/100/100/100; mobile unchanged at 99/100/100/100.

  • Before: fails. After: passes.

    given the ring at 200
    when a real mouse drags it to 120
    then aria-valuenow is 120, the URL is still /200
     and the page and thumb transitions are 0s
    when the mouse lets go
    then the URL is /120, history grows by one
     and the transitions are back to 0.5s and 0.18s
    
  • Also passing: a pointer move within one hue keeps the same state; a held arrow key still eases the thumb; pnpm check (146 tests); pnpm verify shows only the known + then − finding.

  • Driven in a real browser with verify-huebo: ring drag, stepper, keys, mouse wheel, phone wheel flick and drag, contrast readout. One history entry per choice; transitions were 0s only while a pointer moved the dial.

Merge Danger

Door: two-way

No stored data or links change. Reverting the two commits restores the old easing.

Blast Radius: motion

The dial's motion reducer gained a field, so anything sending aim must say by. Held keys and mouse-wheel notches still ease. With reduced motion on, the wordmark letters lose their 45ms stagger. Browser tests now drive Playwright's real mouse through a ringPointer command.

Dragging the ring with a mouse felt sluggish. Frames weren't dropping: the
thumb's 180ms ease, the page's 500ms background fade and the card and
wordmark colour fades all restarted on every hue change, so they trailed
the pointer.

The held state now records whether a key or a pointer holds it.
followsPointer is true while the ring is dragged or the wheel is dragged or
coasting, and then the thumb, the page background and the instantMotion
theme drop their transitions. Steps, picks, keys and Back still fade.
A pointer move that stays on the same hue keeps the same state, so it no
longer re-renders the page.

The wordmark's letter stagger is now a token so it can drop to zero too,
which also removes it under reduced motion.

Browser tests drive the ring with Playwright's real mouse through a
ringPointer command, because synthetic pointer events can't take capture.
The sample shows the text colour the chip grades, so it often fails
contrast on purpose. Lighthouse counted it anyway and held desktop
accessibility at 96. Drawn with ::before, contrast audits skip it, and it
stays hidden from screen readers.
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
huebo Ready Ready Preview Nov 14, 2026 3:10pm UTC

@ericchernuka
ericchernuka merged commit a7ad46c into master Nov 14, 2026
3 checks passed
@ericchernuka
ericchernuka deleted the ec/dial-drag-follows-pointer branch November 14, 2026 15:11

This branch was successfully deployed

1 active deployment
Preview — bb431c67 Deployed Nov 14, 2026 by vercel[bot]
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