fix: restore local volume on unmute - #259
Conversation
#207) Component-level tests that drive the actual Mute/Unmute buttons: local restore + halfway fallback, and cast mute/unmute pushing to the Sonos device. Test-style credit to PR #259. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SwwPcrohddTUN7kmQVedQC
|
FROM @claude:
|
Summary
Restore the local player's previous non-zero volume when the speaker button unmutes from zero, instead of jumping to the hardcoded 0.8 value.
Root cause
The local volume button used
setVolume(volume > 0 ? 0 : 0.8), so any unmute from zero ignored the user's previous slider position.Changes
PlayerBaris mounted.0.5when unmuting with no previous non-zero value.Testing
corepack pnpm --filter frontend test -- PlayerBar.test.tsx(fails before the fix with 0.8, passes after: 22 tests / 123 frontend collected tests passed)corepack pnpm --filter frontend typecheck(pass)corepack pnpm --filter frontend lint:boundary(pass)corepack pnpm --filter frontend lint(pass)corepack pnpm --filter frontend test(pass: 18 files / 123 tests)git diff --check(pass)Note: the root
pnpm verifyscript cannot run directly in this environment because nested scripts call a non-executablepnpmshim, so I ran the equivalent commands throughcorepack pnpm. The unchanged hub unit suite was also checked;test/admin-routes.test.tsconsistently times out inadmin — sync > POST /api/admin/hub/sync → returns 200 with local + peers result shape, unrelated to this frontend-only volume change.Fixes #207