Skip to content

feat: slide the highlight when switching modes - #7

Merged
emakko merged 1 commit into
mainfrom
feat/mode-switch-animation
Sep 24, 2026
Merged

emakko merged 1 commit into
mainfrom
feat/mode-switch-animation

Conversation

@emakko

@emakko emakko commented Sep 24, 2026

Copy link
Copy Markdown
Owner

What

The Swipe · Remove duplicates switch in the playlist picker now animates. The white highlight slides to the chosen mode and resizes to fit it, and the label colours fade, over 0.25 s.

  • PlaylistPicker.tsx: a .seg-pill element sits behind the buttons. A layout effect measures the active button when the mode changes, and the pill moves there with transform and width.
  • styles.css: the buttons no longer draw their own highlight; the pill does. The animation is turned off under prefers-reduced-motion.

Notes for review

  • The pill first renders already in place, so the page doesn't animate on load. It only animates when you switch.
  • Buttons stay native <button>s with aria-pressed. The pill is aria-hidden.

Testing

  • npm test: 129 passed. npm run build: succeeds.
  • Checked in the browser on a temporary page that rendered the picker with fake data, not committed. At 100 ms the pill was mid-slide. It then lined up with the chosen button, including the extra width from the bold label, in both directions.

🤖 Generated with Claude Code

@emakko
emakko merged commit 2112443 into main Sep 24, 2026
2 checks passed
@emakko
emakko deleted the feat/mode-switch-animation branch September 24, 2026 22:39
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