Skip to content

Fix WavyMusicSlider progress updates while playing#287

Merged
theovilardo merged 5 commits intomasterfrom
codex/fix-wavymusicslider-time-update-bug
Oct 23, 2025
Merged

Fix WavyMusicSlider progress updates while playing#287
theovilardo merged 5 commits intomasterfrom
codex/fix-wavymusicslider-time-update-bug

Conversation

@theovilardo
Copy link
Owner

Summary

  • ensure the smooth progress sampler always invokes the latest position and playback providers
  • adjust the animation timing so the slider follows the playback cadence when playing or paused

Testing

  • not run (not requested)

https://chatgpt.com/codex/tasks/task_e_68fa21271d78832fa854532922ff6a3f

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 66 to 71
LaunchedEffect(totalDuration, sampleWhilePlayingMs, sampleWhilePausedMs) {
while (isActive) {
sampledPosition = latestPositionProvider()
val nextDelay = if (latestIsPlayingProvider()) sampleWhilePlayingMs else sampleWhilePausedMs
val safeDelay = nextDelay.coerceAtLeast(1L)
delay(safeDelay)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resume sampling immediately when play state changes

The sampling loop no longer depends on the play state, so the LaunchedEffect continues sleeping for the previous delay even after playback toggles. If the user resumes from pause while the loop is in the sampleWhilePausedMs branch, the coroutine will keep waiting up to 800 ms before noticing the new state, making the slider lag noticeably after pressing play. The old implementation restarted the effect on isPlaying changes and avoided this latency. The loop should cancel or restart when the play state flips so progress updates react immediately.

Useful? React with 👍 / 👎.

@theovilardo theovilardo merged commit 9c6100e into master Oct 23, 2025
@theovilardo theovilardo deleted the codex/fix-wavymusicslider-time-update-bug branch October 24, 2025 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant