Skip to content

Battery and sound widgets leave an empty 40 pt gap before their icon #130

Closed

Description

@alexandrebucci

What happens

Image

Built-in battery and audio widgets without a layout draw their icon and text at the right of a tile about 40 pt wider than its content. The space on the left stays empty.

Steps to reproduce

  1. Add { "id": "power", "type": "battery", "position": "right" } or an audio widget, without a layout.
  2. Leave the battery level or the volume unchanged.

Expected

The tile fits its icon and text, or the graph shows the value's history as it did before 0.5.0-beta.72.

Environment

  • StableBar 0.5.0-beta.20261020113356.133 (build 133), Developer ID build
  • macOS 26.6.2 (25G83), Apple M4 Pro
  • A local theme that sets no widths; both widgets use the default layout

Evidence

StableBar --query shows a single sample for each widget:

audio:   "samples": [0.375], "values": {"volume": 0.375}
battery: "samples": [1],     "values": {"percent": 1}

Diagnosis

On main (e8afa3b):

  • WidgetConfiguration.defaultLayout (Sources/StableBar/WidgetLabel.swift) puts a 40 × 16 graph before the icon and text of a provider widget whose output has a value, as the README documents.
  • PowerMonitor and AudioMonitor set value (percent and volume).
  • Since 1245d3b and 05a0e62 (feat: register data sources behind one interface, including event-driven ones #53, v0.5.0-beta.72), both are PushSources that output only when macOS reports a change, where they used to poll. An unchanged level leaves one sample.
  • Sparkline (Sources/StableBar/BarView.swift) only moves to a first sample and strokes nothing. It spaces samples across 60 slots, so a few changes draw a stub of 40 × (n − 1) / 59 pt.

Workaround: a layout replaces the default layout, for example "layout": { "type": "row", "children": [{ "type": "symbol", "source": "icon" }, { "type": "field", "field": "text" }] }.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. Seb-GRAF commented on Oct 21, 2026

    @Seb-GRAF
    Collaborator

    Additional feedback: the graph itself is an unsuitable default for battery and sound, even when it has enough samples to draw. Prefer an icon and current value by default, with a graph available through an explicit display setting. The store's Battery status package already uses an icon/value layout; the built-in widgets still inherit the automatic graph.

    Triaged by Codex via T3 Code (gpt-6-astra).

  2. stablebar-releases commented on Oct 23, 2026

    @stablebar-releases

    🎉 This issue has been resolved 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions