Repository navigation
fix(player): don't restart the finished track on play/pause after the queue ends - #339
loreofmin-ux wants to merge 2 commits into
Conversation
… queue ends When the last track of the queue ends, the engine clears the current track and the player bar hides, but the audio element keeps its source. Pressing Space (or the media play key) then called the runtime resume, which played that source again from the start with the bar still hidden and no way to control it. resume() now does nothing when there is no current track.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Guard resume and test ended-queue behavior src/features/player/engine/playerEngine.ts, src/features/player/engine/playerStateMachine.test.ts |
resume() returns when no current track exists. The test checks that togglePlayPause and resume do not restart playback after the only track ends with repeat off. |
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix
Suggested reviewers: feralbureau
Merge Risk: 
Minimal · up to 3619a
-
The change prevents finished tracks from restarting after the queue ends and preserves normal resume behavior when a track is selected.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: play/pause and resume no longer restart the finished track after the queue ends. The raw summary and objectives match this. The engine's resume() now returns early when no current track exists, and a state-machine test covers the ended-queue case. The title is specific, uses the conventional fix(player) prefix, and fits the changeset.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
What
When the queue has ended and the player bar is gone, Space and the media play key no longer start the last track again in the background.
Why
At the end of the queue the engine clears the current track, so the player bar hides, but the audio element keeps the last source. Pressing Space called
playerRuntime.resume(), which played that source again from the start. The track played with no bar on screen and no way to pause or skip it except pressing Space again.Recording of the bug on 0.2.10:
How
playerEngine.resume()returns early when there is no current track. Every play entry point goes through it: the Space shortcut, the media sessionplayaction, the overlay and the Touch Bar.playerStateMachine.test.ts: a single track ends, then play/pause and resume must not reach the runtime and the status staysidle.Checklist
pnpm checkpasses (lint, build and tests; format:check only flags CONTRIBUTING.md, controls.tsx and Notch.tsx, which already fail onmain)anyen.json(none)Summary by CodeRabbit