Skip to content

fix(radio): unmute always sounds, play state follows the audio element, ignore modifier chords - #2257

Open
mahmutyum wants to merge 1 commit into
4gray:masterfrom
mahmutyum:fix/radio-mute-play-state-modifiers
Open

mahmutyum wants to merge 1 commit into
4gray:masterfrom
mahmutyum:fix/radio-mute-play-state-modifiers

Conversation

@mahmutyum

Copy link
Copy Markdown
Contributor

Summary

Three radio player bugs in libs/ui/playback/src/lib/audio-player/audio-player.component.ts:

  1. Unmute could stay silent. Mute toggled audio.muted and also set the volume to 0. With a stored volume of 0 (which a mute persists to the shared volume key), Unmute restored 0. A slider or arrow change made while audio.muted was set stayed silent.
  2. The play state never followed the <audio> element. A media-key pause, an OS pause or a station that failed to load still showed LIVE and a Pause button.
  3. Modified keys triggered radio shortcuts. Cmd/Ctrl+M muted the radio (Cmd+M minimizes on macOS), and Ctrl/Alt+arrows changed its volume.

Changes

  • Mute now follows the shared controls (ControlsVolume, LegacyMuteMemory):
    • Mute sets the volume to 0.
    • Unmute restores the last audible volume, or 0.5 when none is known.
    • isMuted is volume() === 0, so raising the volume is also an unmute.
    • audio.muted is no longer used.
  • The badge and play button follow the element's play, pause, ended and error events. A rejected play() shows paused only while the element is actually paused, so a late AbortError from the previous station cannot flip a station that is now playing.
  • The keyboard handler ignores Ctrl, Cmd and Alt chords. Shift is still accepted for M.
  • The synthetic Stalker radio setup moves out of dialog-accessibility.e2e.ts into stalker-radio-player.fixture.ts (playSyntheticStalkerRadio), so the new web E2E can reuse it. That test is otherwise unchanged.

Docs

  • docs/architecture/player-controls-contract.md, radio section: the mute model, the play-state source and modifier chords.
  • Release note: .changes/radio-mute-play-state.md.

Validation

  • New unit tests fail on the old component (10 cases) and pass with the fix:
    • unmute from a stored zero
    • raising the volume while muted
    • unmute after a slider drag to zero, and after the host pushed zero
    • pause/ended/error/play events
    • a refused play() and a late rejection
    • Ctrl/Cmd/Alt chords
  • ui-playback 1769/1769.
  • New web E2E stalker-radio-controls.e2e.ts (Chromium):
    • an element pause shows Paused, and resuming shows LIVE
    • chords leave the volume alone
    • after the volume is taken to zero, Unmute is audible
    • raising the volume while muted is heard
      It fails on the old component.
  • Existing E2E: web dialog-accessibility 4/4 (Chromium), with the refactored radio setup. Electron remote-control 6/6, which drives the radio volume through the host input.
  • Lint: no errors and no new warnings. typecheck:web is clean. release:notes:validate and agents:validate pass.

…t, ignore modifier chords

- Mute sets the volume to zero and unmute restores the last audible
  volume (0.5 when none is known), as in the shared player controls; a
  stored volume of zero no longer leaves Unmute silent, and raising the
  volume while muted is heard.
- The Live/Paused badge and play button follow the <audio> element's
  play, pause, ended and error events, so media-key pauses and failed
  stations show; a refused play() shows paused unless a newer one plays.
- Ctrl, Cmd and Alt chords are not radio shortcuts.
- The synthetic Stalker radio setup moves to the radio fixture so a new
  web E2E can reuse it.
@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The radio player now restores an audible volume when unmuted, updates its badge after audio events, and leaves modified shortcuts alone.

  • Radio unmute restores sound even when its saved volume is zero.
  • Radio status now matches what its audio stream is doing.
  • Radio shortcuts leave Ctrl, Cmd, and Alt chords alone.

Reviews (1) · Last reviewed commit: "fix(radio): unmute always sounds, play s..." · Reviewed by Greptile

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.99%. Comparing base (ff90ccb) to head (6b1b60e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2257    +/-   ##
========================================
  Coverage   81.98%   81.99%            
========================================
  Files        1921     1921            
  Lines      102911   102909     -2     
  Branches    24419    25189   +770     
========================================
+ Hits        84376    84377     +1     
+ Misses      11112    11111     -1     
+ Partials     7423     7421     -2     
Flag Coverage Δ
unit 81.99% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant