fix(ui): valid mini-player markup + reliable long-press - #31
Merged
Merged
Conversation
#6: the mini bar was a <button> that contained the play/next <button>s — invalid nesting that browsers "fix up" unpredictably, breaking those taps on iOS. Make the outer element a role="button" div (with Enter/Space keydown for a11y); the inner controls stay real buttons. #12: long-press was unreliable and leaky: - onTouchMove cancelled on ANY movement, so normal finger jitter killed the hold ~half the time. Now it only cancels past a 10px tolerance. - Added onTouchCancel so a system-interrupted touch doesn't leave the timer armed to fire onLongPress spuriously later. - Guarded the synthetic mouse events iOS fires after a touch (600ms window) so a touch long-press isn't followed by a phantom mouse tap that lets the tap action slip through. Verified in-browser: mini play/pause pauses without opening Now Playing, and tapping the card body opens it; no console errors. Fixes #6. Fixes #12. 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 #6. Fixes #12.
#6 — invalid nested buttons
The mini bar was a
<button>containing the play/next<button>s. That's invalid HTML; browsers "fix up" the nesting unpredictably, breaking the inner taps on iOS. Made the outer element arole="button"div (with Enter/Space keydown for a11y); the inner controls stay real<button>s and theirstopPropagationstill prevents opening Now Playing.#12 — unreliable long-press
onTouchMovecancelled on any movement, so normal finger jitter killed the hold ~half the time → now only cancels past a 10px tolerance.onTouchCancelso a system-interrupted touch doesn't leave the timer armed to fireonLongPressspuriously.Verification
Built clean; behavioral test:
Long-press timing/gesture behavior is best confirmed on a real touchscreen; the hook logic is covered by review.
🤖 Generated with Claude Code
Generated by Claude Code