Skip to content

A script widget turned off and on again shows nothing until its script runs again #949

Done

Description

@M4n0x

What happens

When a script widget is turned off ("enabled": false) and then turned on again, it starts from nothing. It shows no output until its command has run again. For a widget that a profile turns on only while one app is in front, this happens every time that app comes back to the front. A script that asks a network service for its data, such as the Store's AI usage package (three requests, up to 12 seconds each), then takes seconds to come back.

Steps to reproduce

  1. Add a script widget whose command takes a few seconds, such as sleep 3; date +%T.
  2. Add a profile that turns it off while another app is in front:
    {"name": "Elsewhere", "when": {"app": "com.apple.finder"},
     "configuration": {"widgetOverrides": {"slow": {"enabled": false}}}}
  3. Bring Finder to the front, then another app.

Expected

The widget comes back at once with what it last showed, then updates when its script finishes.

Environment

StableBar 0.19.1-beta, macOS 27.2.

Evidence

Found while setting up an AI usage widget for one app. Hiding it with "display": [] instead of enabled: false brings it back at once, because the script keeps running.

Diagnosis

WidgetScripts.run (Sources/StableBar/DataSources/WidgetScripts.swift) compares each script widget with the next configuration's enabled widget of that ID. A widget that is turned off has none, so its ScriptWidget is stopped and removed, together with its output, samples and diagnostics. Turning it on again creates a new ScriptWidget, which shows nothing until its first output.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    bug
    on Nov 27, 2026
  2. stablebar-releases commented on Nov 29, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.20.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

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions