This repository was archived by the owner on May 25, 2026. It is now read-only.
feat(picker): wire shuffle action to /api/shuffle - #79
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Replaces the picker's local shuffle stub with a real
POST /api/shuffleround-trip (backend shipped across #47, #54, #56, #58).
handleShufflenow POSTs{playlistId}, validates the response shape,and maps 8 error codes to
ErrorKindviamapShuffleError.from flashing on fast round-trips before "Done." lands.
playlists get "Pick another" (restores picker, no refetch); shuffle failures
with a
sourceset get "Try again" (re-POSTs the same playlist id); load-patherrors keep the existing
reloadKeybump.LoadState's error variant now carries optionalsource/playliststosupport the above without a refetch on either recovery path.
Why
The backend has been live against real Spotify for a week; wiring the picker
now is the natural close of the round-trip.
The source-aware retry is the meaningful design call here. The existing
reload-picker behavior makes a user re-find their playlist in a long list
after every rate-limit or transient error. Carrying
sourcethrough theerror round-trip lets "Try again" re-POST the same playlist directly.
playliststravels with the error for the same reason: "Pick another" canrestore the picker without paying a refetch.
Test plan
shuffled playlist with the expected name suffix appears in the library.
carries the correct
Shuffled YYYY-MM-DDsuffix in the Spotify app.mid-shuffle for an upstream error, or expire the session cookie) and
confirm the correct CTA renders.