Skip to content

feat: show the volume level in the Sound widget's speaker - #160

Merged
M4n0x merged 1 commit into
mainfrom
feat/sound-level-icon
Oct 21, 2026
Merged

M4n0x merged 1 commit into
mainfrom
feat/sound-level-icon

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

Since #157 the Sound widget shows only its speaker at rest, and the speaker always had two waves, so the bar no longer says how loud it is.

Changes

  • Level in the icon: the audio source's icon is speaker at 0%, speaker.wave.1 up to 33%, speaker.wave.2 up to 66%, then speaker.wave.3. It stays speaker.slash while muted or without an output device. A device without a volume control keeps speaker.wave.2. The levels use the same rounded percentage the widget shows.
  • Steady width: the Sound widget's icon keeps the width of speaker.wave.3, with the speaker drawn at its leading edge. The widget doesn't change size between levels, and the hover slider from feat: change the volume with a slider when hovering the Sound widget #158 doesn't move under the pointer when a drag crosses a third. This uses a new internal widestSymbol on symbol blocks, set by default layouts only, like keepsLineHeight; configurations can't set it.
  • README: the Sound default layout and the audio source's icon.

Surfaces: no configuration property, so the schema, decoders and Settings are unchanged. Custom layouts that draw icon get the level icons too.

Testing

  • swift test: 275 XCTest tests pass. 387 Swift Testing tests ran, with 8 issues, all in popupResizesWithItsContentAndKeepsItsWidthAndTopEdge (both animated cases, lines 258 and 262). That's the known failure while the display is asleep, and mine was asleep and locked during the run. CI covers it.
  • New and updated tests:
    • The icon at each threshold, for muted, and without a volume control.
    • The Sound widget draws each level differently at the same width, and still matches an icon-only widget at rest.
  • Live check: the screen locked partway through, so the images are offscreen renders of the widget's blocks rather than screenshots.
Before After
after-rest.png from #157: two waves at every volume speaker-levels.png: 0%, 20%, 50%, 90%, muted

Merging

One commit, so any merge method keeps it.

Claude Opus 5.5 via Claude Code

With the volume shown only after a change, the speaker now shows how
loud it is, with no wave at zero, then one, two or three waves as the
volume passes each third, and the crossed-out speaker while muted, as
before. A device without a volume control keeps two waves.

The Sound widget's icon keeps the width of three waves, its speaker
drawn at the leading edge, so the widget doesn't change size between
levels and the hover slider doesn't move under the pointer while
dragging. Symbol blocks of default layouts can now keep the width of a
wider symbol.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 21, 2026 14:53
@M4n0x
M4n0x merged commit 1492b61 into main Oct 21, 2026
6 checks passed
@M4n0x
M4n0x deleted the feat/sound-level-icon branch October 21, 2026 15:00
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant