Skip to content

fix: Play/Pause on the queue slot's playbar resumes Spotify instead of pausin... - #383

Merged
LargeModGames merged 2 commits into
LargeModGames:mainfrom
yhay81:agent/issue-374
Jul 18, 2026
Merged

LargeModGames merged 2 commits into
LargeModGames:mainfrom
yhay81:agent/issue-374

Conversation

@yhay81

@yhay81 yhay81 commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #374.

Summary

Play/Pause on the queue slot's playbar resumes Spotify instead of pausing the queued track

Validation

  • Mechanical gate: +71/-48, tests passed
  • Adversarial review: approved

🤖 AI-authored PR, operated by @yhay81.

Summary by CodeRabbit

  • Bug Fixes
    • Improved play/pause handling for the Spotify native queue-slot, including correct pause vs “bare resume” behavior.
    • Prevented incorrect fallthrough into decoded-source toggling paths during Spotify queue-slot transport controls.
    • Ensured Internet Radio transport controls don’t trigger unintended streaming resume logic.
    • Preserved the Spotify queue context while consuming transport controls and updating playback state.
  • Tests
    • Expanded coverage for Spotify queue-slot transport control dispatch and playback-state transitions.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 01a965e4-5993-4fb3-850a-7d8217e2ca06

📥 Commits

Reviewing files that changed from the base of the PR and between 80a1439 and 0d5576b.

📒 Files selected for processing (1)
  • src/core/app.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/core/app.rs

📝 Walkthrough

Walkthrough

Spotify queue-slot playback toggles now dispatch native pause or resume events before streaming fallback logic. The Spotify queue router consumes those events, updates native_is_playing, and preserves the suspended queue context. Regression tests cover both dispatch and routing behavior.

Changes

Spotify queue playback control

Layer / File(s) Summary
Queue-slot toggle dispatch
src/core/app.rs
App::toggle_playback dispatches PausePlayback or bare StartPlayback for Spotify queue slots, while decoded-source branches retain direct playback control. The regression test verifies both pause and resume events and their optimistic state changes.
Native transport consumption
src/infra/queue/dispatch.rs
Spotify queue routing conditionally pauses or resumes the streaming player, consumes both transport events, updates native_is_playing, and verifies that the queue slot and suspended Spotify context remain active.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant QueueRouter
  participant StreamingPlayer
  App->>App: Toggle native_is_playing
  App->>QueueRouter: Dispatch PausePlayback or bare StartPlayback
  QueueRouter->>StreamingPlayer: Pause or play
  QueueRouter-->>App: Consume transport event
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required fix: prefix and describes the Spotify play/pause queue-slot bug addressed by the PR.
Linked Issues check ✅ Passed The changes match #374 by handling queue-slot pause and bare resume through librespot and preventing the unhandled Spotify resume path.
Out of Scope Changes check ✅ Passed The diff stays focused on the Spotify queue-slot playback fix and its tests, with no clear unrelated code changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/app.rs`:
- Around line 4597-4603: Update the queue-toggle logic in the visible playback
handler and its corresponding implementation near the alternate location so
native_is_playing is optimistically flipped before dispatching the event. Use
the updated value to choose between PausePlayback and StartPlayback, and add or
adjust a test that performs two toggles without draining the channel to verify
they dispatch opposite actions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a1993d51-4c35-4483-b29e-c51a347c5b25

📥 Commits

Reviewing files that changed from the base of the PR and between 9af8e7e and 80a1439.

📒 Files selected for processing (2)
  • src/core/app.rs
  • src/infra/queue/dispatch.rs

Comment thread src/core/app.rs Resolved
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.

Play/Pause on the queue slot's playbar resumes Spotify instead of pausing the queued track

2 participants