polish: debounce search + low-severity roundup - #36
Merged
Merged
Conversation
#16: feed the fuzzy search a useDeferredValue(query) so fast typing over a large library doesn't drop input frames (React can skip intermediate list renders). #19 roundup: - formatTime now shows hours (3661 → "1:01:01") instead of "61:01". - Replace the biased `[...a].sort(() => Math.random() - 0.5)` shuffle (Library + Playlist "Shuffle") with a shared uniform Fisher–Yates `shuffle()` helper. - Revoke the last object URL when PlayerProvider unmounts (the per-track effect only revoked the previous one on the next load). - MediaMetadata artwork: use sizes 'any' + type 'image/jpeg' (ytimg thumbnails are JPEG) instead of a false hardcoded 512x512/png. - Attach .catch to the fire-and-forget mutations (toggleStar in TrackRow/Player/ sheet, bumpPlayCount, seed/removeSamples) so a rejected transaction doesn't become an unhandled rejection. Verified: formatTime + shuffle unit-tested (hours, edge cases, permutation); search still filters and shows the no-match hint in-browser; build clean. Fixes #16. Fixes #19. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkDKh1Uo1a4D7n5wCKdcKF
Review follow-up: the "Nothing matches" hint used the immediate `q` while `results` derives from the deferred query, so switching from a no-match to a match term could flash the wrong hint for a frame. Drive the list/hint off the deferred query (`dq`) so they always agree; the clear button stays on immediate `q`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkDKh1Uo1a4D7n5wCKdcKF
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.
Fixes #16. Fixes #19.
#16 — search debounce
Feed the fuzzy search
useDeferredValue(query)so fast typing over a large library doesn't drop input frames (React can skip intermediate list renders and catch up when idle).#19 — low-severity roundup
3661 → "1:01:01"instead of"61:01"(sub-hour unchanged).[...a].sort(() => Math.random() - 0.5)(Library + Playlist "Shuffle") with a shared Fisher–Yatesshuffle()helper.PlayerProviderunmounts (the per-track effect only revoked the previous one on the next load).sizes: 'any'+type: 'image/jpeg'(ytimg thumbnails are JPEG) instead of a false hardcoded512x512/png..catchon the fire-and-forget mutations (toggleStarin TrackRow/Player/sheet,bumpPlayCount, seed/removeSamples).The remaining #19 checklist item — auditing 44×44pt tap targets — is left as a visual pass on-device (no measurable defect found in code).
Verification
formatTime3661/605/73/0/NaN/3600shufflereturns a valid permutation🤖 Generated with Claude Code
Generated by Claude Code