Repository navigation
Blend previous-track skip like the forward skip - #131
Merged
Merged
Conversation
previous() hard-cut into the earlier track via startCurrentFresh(), while next() runs a smooth 5s crossfade. Route the previous-track step through the same beginTransition(isUserInitiatedSkip:) path so stepping back blends (beatmatched/harmonic/vocal-aware) instead of cutting. Preserves every existing invariant: the >3s restart-current branch stays a hard restart, the history walk still consumes exactly one entry, and the forward-skip refund still happens exactly once (a user skip blend doesn't refund again on completion). Falls back to a hard cut when audio can't start, when under a second of outgoing audio remains, or when there is no distinct earlier track (single-track queue / history points at the current track) — a self-blend would just echo. Adds a guard so a second press during an in-flight skip is a no-op, mirroring next(), with a test pinning that it neither walks history twice nor double-refunds nor builds the audio stack. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016C9cyymf6W5k6SaGiYvdXN
sanylax0
marked this pull request as ready for review
July 27, 2026 05:13
sanylax0
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
previous()hard-cut into the earlier track viastartCurrentFresh(), whilenext()runs a smooth 5-second crossfade. This routes the previous-track step through the samebeginTransition(isUserInitiatedSkip:)path, so stepping back now blends — beatmatched, harmonic-mixed, vocal-aware — instead of cutting, matching the forward skip.How
In
Player.previous(), when stepping to a distinct earlier track, compute the back-target and hand it tobeginTransition(..., isUserInitiatedSkip: true)— the exact machinerynext()uses — after materializing the outgoing deck so there's audio to fade.Existing invariants are all preserved:
finishTransitionskips the refund for user skips), so the single refund holds whether we blend or hard-cut.Hard-cut fallbacks (mirroring
next()), so nothing regresses in edge cases:A new guard makes a second press during an in-flight skip a no-op, mirroring
next(); acting on it would cancel the blend, walk history a second time (dropping the entry the first press consumed), and double-refund the skip.Behavior note for device testing
To match
next()'s "one skip per blend" semantics, a rapid double-press of previous now advances one track per completed 5s blend (the second press is ignored until the first lands) rather than jumping back several at once. If you'd prefer rapid multi-rewind, that's a easy follow-up — flag it after device testing.Testing
PlayerPreviousSkipTests.testPreviousDuringUserSkipIsIgnoredpinning that a press during an in-flight skip neither walks history twice, nor double-refunds, nor builds the audio stack.Playbackmodule imports AVFoundation, so it (and this test) build/run on macOS + simulator only — not the LinuxContinuityCoreCI. Device/blend verification is the owner's on a real iPhone.🤖 Generated with Claude Code
https://claude.ai/code/session_016C9cyymf6W5k6SaGiYvdXN
Generated by Claude Code