Repository navigation
fix(player): keyboard seek on the meditation player, a working muted volume slider, and playlist rows without a nested link - #298
Merged
Conversation
Each playlist row was a <button> wrapping the track's credit <Link>: one tab stop carrying two actions, which axe reports as nested-interactive (serious, one node per track) on /music-for-meditation. A screen reader also heard the credit and the duration folded into the button's name. The row is now two siblings, as #289 decided ("two tab stops rather than one nested in the other"): a button covering the whole row, named by the track's <h4>, and the credit link positioned above it. A click anywhere else on the row still plays the track, the focus outline still wraps the row, and the link no longer needs to stop the click reaching the button. The a11y gate cannot carry this target yet: a music page there also fails `label` on AudioPlayer's seek input, which waits on the upstream media.a11y.progress key (SahajCloud#1222). The fail-first test is the Playlist's own spec instead: axe nested-interactive over a rendered Playlist, plus the row and credit clicks. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
AudioPlayer's volume slider reads 0 while the player is muted and only called setVolume when moved. Howler's volume() never clears a mute, so the player stayed muted, the controlled input snapped back to 0, and the slider did nothing until the listener found the mute button. MeditationPlayer already unmutes its voice channel from the slider. PlaylistAudioPlayerControls now exposes the core hook's idempotent unmute, and the slider calls it after setting the volume, so moving it is enough to make a muted playlist audible again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
…yboard MeditationPlayer's seek handle was a <div> with only onMouseDown and onTouchStart: no tab stop, no role and no value, so a keyboard or screen reader user could play and pause but never move through a meditation. The handle is now a focusable role="slider" reporting the position in seconds (aria-valuemin/max/now) and as the player's own M:SS readout (aria-valuetext, from formatDuration). Arrow keys move 5 seconds, PageUp and PageDown 30, Home and End go to either end; each seeks at once and stops the key scrolling the page. Focus draws the focus-ring utility. No animation is added, so there is no motion to gate. No existing key names a seek slider, and the upstream one, media.a11y.progress (sydevs/SahajCloud#1222), has not merged. Until it does, aria-labelledby points at the player's visible "Meditation" label — the player draws no track title — and a shortcut comment marks the swap. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
MeditationPlayer and MusicLibrary each wrapped their real component in react-use-audio-player's AudioPlayerProvider, and the AudioPlayer story did the same. In react-use-audio-player 4.0.2 the library's useAudioPlayer keeps its player in a ref per call and never reads the context; only useAudioPlayerContext does, and nothing in the repo calls it. Each provider only built one more idle player that nothing used. The wrappers go, each Inner component becomes the export, and the doc lines telling a caller to use the hook inside a provider now say none is needed. The Ladle Vite comment no longer names the provider: the React dedupe it explains is still needed, for the library's hooks themselves. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
useAudioPlayer had no test of its own: every spec that renders a player replaces it with a recorder, so the contracts the playlist and the meditation player lean on were asserted nowhere. This pins them against a recorder of react-use-audio-player instead: the url option loads as html5 and reloads only on a new url, a caller's onEnd replaces the hook's, play starts one sound and resumes that same sound rather than overlapping a second, seek targets that sound and reports the time at once, the 100ms poll runs only while playing, and unmute passes through. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The play button now covers the whole row, and it marked keyboard focus with nothing but the browser's default outline. It draws `focus-ring`, the treatment docs/rules/design-system.md names for every interactive element. The list is an `overflow-y-auto` scroll container, which clips at its padding box, and each row fills its width: a ring 4px outside the row lost its left, right and top edges. `p-1` gives the ring that room, and `-m-1` keeps every row where it was. Measured in Ladle (Playlist and MusicLibrary stories, headless Chrome): row boxes identical before and after, 4px between the focused button and the clip edge on the left, right and top. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The block above the progress handle restated its handlers, its role and its hit area, and the step table's comment restated what Home and End do. What is left is the one gotcha (a hidden label still names the slider when it is referenced directly) and a one-line `shortcut:` for the interim name. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 4ceb592 | Commit Preview URL Branch Preview URL |
Nov 19 2026, 09:12 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 4ceb592 | Commit Preview URL Branch Preview URL |
Nov 19 2026, 09:12 PM |
This was referenced Nov 19, 2026
Ardnived
requested changes
Nov 19, 2026
Contributor
Author
Contributor
Author
|
No commits this run. Both threads are answered with evidence and left open for you to settle.
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Ardnived
approved these changes
Nov 20, 2026
sydevs-bot
pushed a commit
that referenced
this pull request
Nov 20, 2026
…ofix `hooks/audio/usePlaylistAudioPlayer.test.ts` conflicted. Both sides broke the one-line `vi.hoisted` recorder into a multi-line object: this branch for prettier, #298 to add `unmute: vi.fn()`. Main's side carries both, so it stands. The 14 files main brought in need no second mechanical commit: `pnpm lint` exits 0 on the merge as it stands. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXQQg5YdpdZ46P9pXp
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.
Summary
AudioPlayerProviderwrappers are gone (nothing ever read their context), and the coreuseAudioPlayerhook has its first tests.Findings addressed
F8c, credit link nested in the play button (axe
nested-interactive, serious; shape decided in fix(components): live pages outside the axe gate's fixtures still fail it #289). On main,PlaylistItem's<button>wrapped both the<h4>and the credit<Link>. Each row is now arelativewrapper (components/molecules/Playlist/Playlist.tsx:75) that holds two siblings:<button>positionedabsolute inset-0, carryingaria-currentand named by the<h4>througharia-labelledby(:82-87)<Link>, maderelativeso it paints above the button (:93)The link's
stopPropagationis gone. Measured in Ladle: each row is still 448×64 and the button covers all of it. A click on the title or the duration reaches the button, and a click on the credit reaches the link.Tests:
components/molecules/Playlist/Playlist.test.tsx, "Playlist rows — the play button and the credit link" (jsdom). It runs axenested-interactiveover a rendered Playlist, checks the link is not inside the button, checks a row click callsonTrackClick(4)for a filtered row, and checks a credit click does not play. The first two fail on main.MusicLibrary.test.tsxwas adjusted for the new accessible name.focus-ring(Playlist.tsx:85). The list is anoverflow-y-autoscroll container, and each row fills its width, so the scroll container cut off the ring's left, right and top edges.-m-1 p-1on the list (:172) gives the ring 4px of room and leaves every row exactly where it was. Measured in a headless Chrome against the Ladle Playlist and MusicLibrary stories: the row boxes are identical with and without the two classes (for example 676,152 540×64 in MusicLibrary), and the gap between the focused button and the clip edge is 4px on the left, right and top. Pinned by the test "draws the focus ring on the play button", which fails without the class.F8e, volume slider inert while muted.
react-use-audio-player4.0.2'ssetVolumecallshowl.volume()only, which never clears mute, and the slider renders 0 while muted.PlaylistAudioPlayerControlsgainsunmute(components/molecules/AudioPlayer/types.ts:70-71), wired to the core hook inhooks/audio/usePlaylistAudioPlayer.ts:198. The volume slider callssetVolumeand thenunmute(components/molecules/AudioPlayer/AudioPlayer.tsx:183-186), the same order as MeditationPlayer's voice row.Tests:
AudioPlayer.test.tsx"unmutes when it moves while muted" andusePlaylistAudioPlayer.test.ts"unmutes the core player". Both fail on main.F8f, seek handle unreachable by keyboard. On main the handle was a
<div>with onlyonMouseDownandonTouchStart. It is nowrole="slider"withtabIndex={0}(components/organisms/MeditationPlayer/MeditationPlayer.tsx:790-818). It sets:aria-valuemin0 andaria-valuemaxthe rounded durationaria-valuenowthe clamped, rounded positionaria-valuetextfromformatDurationThe keys come from
SEEK_KEY_STEPSandseekTargetForKey(:74-90). Each key seeks through the existinghandleSeek, is clamped to the track, and callspreventDefault. Other keys such as Tab and Enter pass through. The handle drawsfocus-ring; checked in headless Chrome,:focus-visiblematches after a Tab and the ring draws around the 44×44 handle. No existing key fits the name, soaria-labelledbypoints at the player's visible "Meditation" label (t('meditation.general.label'),:662). A one-lineshortcut:marks the swap tomedia.a11y.progress.Tests:
MeditationPlayer.seek.test.tsx(jsdom) covers the named slider and its values, all 8 keys withpreventDefault, clamping at both ends, and that Tab and Enter are left alone. All 12 tests fail on main.F15d, no-op
AudioPlayerProviderwrappers. Innode_modules/[email protected]/dist/index.js,useAudioPlayerkeeps its player inuseRefplususeSyncExternalStoreand never callsuseContext. OnlyuseAudioPlayerContextreads the context, and nothing in this repo calls it. Each provider only built one more idle player. The wrappers were removed fromMeditationPlayer.tsx,MusicLibrary.tsxandAudioPlayer.stories.tsx. The doc lines inAudioPlayer.tsx,usePlaylistAudioPlayer.ts:27and.ladle/vite.config.tswere corrected; the React dedupe that config explains is still needed. Nothing visible changes, so there is no fail-first test. The existing MusicLibrary and MeditationPlayer suites and the axe gate pass without the providers.F12a, audio-hook coverage. New
hooks/audio/useAudioPlayer.test.ts(jsdom, 9 tests) runs against a recorder of the library. It covers:onEndreplaces the hook's owncurrentTimeand firesonPlaybackTimeUpdate; before a sound starts, seek falls back to the libraryunmutepasses throughThese cover existing behaviour, so they pass on main by design.
useCircularProgressis left to thetestsbundle.Review follow-up (comments): the seek handle's 7-line comment and the step table's comment restated the code. What remains is the one gotcha (a label hidden by the wide layout still names the slider when it is referenced directly) and the one-line
shortcut:.Not in this PR
media.a11y.progress, with the wording declared upstream in feat(translations): add a name for the audio player's progress slider SahajCloud#1222 (not merged). The same key replaces the interimaria-labelledbyon the meditation player's progress slider. Until it lands, a music-library target intests/a11y/page-types.test.tsxwould still fail axelabel(critical) on that input. That is why F8c's fail-first test lives inPlaylist.test.tsxand not in the page-types gate. Tried locally: with a temporary music target, main reportedlabelplusnested-interactive(2 nodes); after this change onlylabelremains.useAudioPlayerexposesstate.error, but nothing reads it. Showing it needs a new visitor-facing string, which is not hand-added here. Needed upstream:media.general.load_error, English "This audio could not be loaded.", shown with a status or alert role byAudioPlayer(music library) andMeditationPlayerwhenstate.erroris set.Reconciled with open PRs
git merge-tree --write-treeof this branch against every open PR branch reports no conflicts.MeditationPlayer.tsx, in the upsell region,WEMEDITATE_DOMAINand the voice-volume handlers. This branch's hunks there are the import removal, the seek constants (placed afterPLACEHOLDER_IMAGE, away fromWEMEDITATE_DOMAIN), the label id, the handle and the wrapper removal. None touches feat(server): switch wemeditate.com over to the new site #288's regions.tests/a11y/fixtures.tsandtests/a11y/page-types.test.tsx; this branch leaves both untouched.lib/translations.en.json; this branch does not touch it and adds no translation key.Test results
The lean gate (
.claude/skills/pr-prep/check.sh) ran on the final head and exited 0:tsc --noEmit: passed.pnpm build: not run, because this bundle is not marked BUILD.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw