Skip to content

Extract now-playing playback lifecycle#162

Merged
thewrz merged 2 commits into
mainfrom
feat/issue-142
Jun 24, 2026
Merged

Extract now-playing playback lifecycle#162
thewrz merged 2 commits into
mainfrom
feat/issue-142

Conversation

@thewrz

@thewrz thewrz commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Move now-playing playhead, display-progress, cache-key sync, and waveform envelope ownership into NowPlaying.
  • Delegate playback start/tick/clear and view-time envelope lookup from the app to the owner.
  • Keep AudioStore focused on decoded PCM and add owner-level lifecycle tests.

Design decisions

  • Kept playing in HonkHonk for tile highlighting and existing app flow; NowPlaying keeps its own active id only to maintain the waveform cache key.
  • NowPlaying::clear() resets active UI state but preserves per-sound envelope cache entries, matching the prior decode-cache behavior and keeping envelopes pre-volume.
  • Added PlaybackStart to group decoded PCM metadata and stay within the repo's strict clippy argument limit.

Validation

  • cargo test
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings

Closes #142

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thewrz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 4 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 56d34102-854f-434b-add2-dd5636861caa

📥 Commits

Reviewing files that changed from the base of the PR and between 9d493cb and c8af094.

📒 Files selected for processing (5)
  • src/app/mod.rs
  • src/app/playback.rs
  • src/audio/store.rs
  • src/ui/now_playing.rs
  • src/ui/now_playing/tests.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-142

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thewrz

thewrz commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Review loop transparency note: CodeRabbit did not run a real review on this cycle because it reported review limits / usage credits exhausted. Claude ultrareview was not run from this environment because the sandbox reviewer blocked the third-party cloud review call as potential off-platform code exfiltration. I manually reviewed the PR diff for src/app/mod.rs, src/app/playback.rs, src/audio/store.rs, src/ui/now_playing.rs, and src/ui/now_playing/tests.rs; found no actionable findings; and verified locally with cargo test (492 lib tests, 5 main tests, 19 decoder tests, plus zero-test integration/doc targets all passed). CI is green at head 519f345.

@thewrz

thewrz commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Claude ultrareview backup for the CodeRabbit usage block has been handled.

Addressed in c8af094:

  • Fixed the cold-play stale waveform window by marking the now-playing state as pending before async decode completes.
  • Reworked NowPlaying::sync_active to avoid cloning the active id on every frame.
  • Added regression coverage for the stale waveform cache-key case.

Local verification run after the fix:

  • git diff --check
  • cargo fmt --check
  • cargo test
  • cargo clippy --all-targets -- -D warnings

@thewrz thewrz merged commit a5a9af6 into main Jun 24, 2026
7 checks passed
@thewrz thewrz deleted the feat/issue-142 branch June 24, 2026 22:15
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.

refactor(app): extract now-playing playback state out of app.rs into a dedicated owner

1 participant