fix(mobile): fill lyrics as smoothly as web #148

Merged
joshuafhiggins merged 1 commits from t3/mobile-lyrics-fill into main 2026-11-20 16:26:09 -05:00
Owner

Mobile lyrics animated worse than web. The fill restarted from the player's reported time on every progress update and every word boundary, so it hitched. It also had a hard edge, the playing line re-wrapped when it became active, and line color and blur changes snapped.

  • Timing: usePlaybackClock keeps playback time on the UI thread, running linearly between progress updates. It resets only when it drifts more than 150ms from the player, the same idea as web's 80ms drift check.
  • Soft edge: each word of the playing line is a MaskedView whose mask is the word, over a gradient 2.5× its width that slides from the dim end to the bright end, matching web's 40–60% gradient. This adds @react-native-masked-view/masked-view at Expo SDK 58's pinned 0.3.2, so it needs a native rebuild.
  • Layout: every timed line is laid out word by word all the time, so the playing line can't re-wrap.
  • Line changes: each line's opacity (0.35 when not playing) and blur fade over 300ms with Reanimated's CSS transitions. Text is drawn in the foreground color under that opacity, so the lyricsInactive color is gone.

Typecheck passes. Not run on a device or simulator.

Made by Claude Opus 5.5 in Claude Code (via T3 Code).

🤖 Generated with Claude Code

Mobile lyrics animated worse than web. The fill restarted from the player's reported time on every progress update and every word boundary, so it hitched. It also had a hard edge, the playing line re-wrapped when it became active, and line color and blur changes snapped. - **Timing:** `usePlaybackClock` keeps playback time on the UI thread, running linearly between progress updates. It resets only when it drifts more than 150ms from the player, the same idea as web's 80ms drift check. - **Soft edge:** each word of the playing line is a `MaskedView` whose mask is the word, over a gradient 2.5× its width that slides from the dim end to the bright end, matching web's 40–60% gradient. This adds `@react-native-masked-view/masked-view` at Expo SDK 58's pinned 0.3.2, so it needs a native rebuild. - **Layout:** every timed line is laid out word by word all the time, so the playing line can't re-wrap. - **Line changes:** each line's opacity (0.35 when not playing) and blur fade over 300ms with Reanimated's CSS transitions. Text is drawn in the foreground color under that opacity, so the `lyricsInactive` color is gone. Typecheck passes. Not run on a device or simulator. Made by Claude Opus 5.5 in Claude Code (via T3 Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
joshuafhiggins added 1 commit 2026-11-20 16:26:05 -05:00
The mobile fill restarted on every progress update and word boundary, so it
hitched; it had a hard edge, re-wrapped the playing line, and line changes
snapped. A UI-thread clock now drives fills and resets only on drift, words
fill through a gradient mask like web, lines always lay out word by word,
and opacity and blur fade between lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joshuafhiggins force-pushed t3/mobile-lyrics-fill from 55de91084c to 2c0ab711d6 2026-11-20 16:26:05 -05:00 Compare
joshuafhiggins merged commit 75f8c63911 into main 2026-11-20 16:26:09 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joshuafhiggins/otunes#148