Skip to content

perf: optimize playback state updates and recomposition frequency#1044

Merged
theovilardo merged 1 commit intomasterfrom
fix/playback-lag
Feb 12, 2026
Merged

perf: optimize playback state updates and recomposition frequency#1044
theovilardo merged 1 commit intomasterfrom
fix/playback-lag

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

  • State Management:

    • Introduced stablePlayerStateInfrequent in PlayerViewModel to decouple structural playback changes (song, play/pause) from high-frequency position updates, reducing unnecessary recompositions across most screens.
    • Added currentPlaybackPosition flow for components requiring real-time updates (seek bars, lyrics).
    • Updated PlaybackStateHolder to suppress redundant state updates when values are unchanged.
  • UI & Performance:

    • Migrated major screens (Home, Library, AlbumDetail, PlaylistDetail, etc.) to use stablePlayerStateInfrequent.
    • Refactored UnifiedPlayerSheet and LyricsSheet to use granular position flows instead of the full UI state.
    • Quantized position strings in FullPlayerContent to update only every second, minimizing UI churn.
  • Accessibility & Controls:

    • Implemented accessibility semantics for WavySliderExpressive and WavyMusicSlider, including semanticsLabel and quantized ProgressBarRangeInfo to reduce accessibility event noise.
    • Refined haptic feedback granularity in WavyMusicSlider.
  • Animations:

    • Replaced InfiniteTransition with manual Animatable loops in PlayingEqIcon to allow clean pausing/resuming of animations based on playback state.

- **State Management**:
    - Introduced `stablePlayerStateInfrequent` in `PlayerViewModel` to decouple structural playback changes (song, play/pause) from high-frequency position updates, reducing unnecessary recompositions across most screens.
    - Added `currentPlaybackPosition` flow for components requiring real-time updates (seek bars, lyrics).
    - Updated `PlaybackStateHolder` to suppress redundant state updates when values are unchanged.

- **UI & Performance**:
    - Migrated major screens (`Home`, `Library`, `AlbumDetail`, `PlaylistDetail`, etc.) to use `stablePlayerStateInfrequent`.
    - Refactored `UnifiedPlayerSheet` and `LyricsSheet` to use granular position flows instead of the full UI state.
    - Quantized position strings in `FullPlayerContent` to update only every second, minimizing UI churn.

- **Accessibility & Controls**:
    - Implemented accessibility semantics for `WavySliderExpressive` and `WavyMusicSlider`, including `semanticsLabel` and quantized `ProgressBarRangeInfo` to reduce accessibility event noise.
    - Refined haptic feedback granularity in `WavyMusicSlider`.

- **Animations**:
    - Replaced `InfiniteTransition` with manual `Animatable` loops in `PlayingEqIcon` to allow clean pausing/resuming of animations based on playback state.
@theovilardo theovilardo merged commit ad2fa89 into master Feb 12, 2026
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