Skip to content

fix: keep the bar running when a package's widget and its popup are removed together - #39

Merged
Seb-GRAF merged 1 commit into
mainfrom
fix/popup-after-removal
Oct 16, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
fix/popup-after-removal

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

Disabling a widget package crashed the bar. A package such as calendar-agenda defines a named popup (popups) and a widget that opens it with popupName, so disabling the package removes both in one edit. SwiftUI then redraws the old widget view once more against the new configuration, and widgetPopup force-unwrapped store.configuration!.popups[name]!, which no longer exists:

Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value
widgetPopup(_:store:)  BarView.swift:218
WidgetView.body.getter BarView.swift:256

The lookup dates from the widget packages work (42713bc), and a crash report from 0.1.0 shows the same failure in the older popup lookup. The store makes it easy to hit: four of its five packages that contain no commands use named popups.

Changes

  • widgetPopup returns no popup when the named popup isn't in the current configuration, instead of crashing. The stale view disappears with the next redraw.

Testing

  • swift test: all tests pass.
  • The crash comes from SwiftUI redrawing a removed view, which the tests can't drive; the report above is from the maintainer's bar after disabling calendar-agenda.

Merging

Either style; it's one commit.

Claude Opus 5.5 via Claude Code.

@Seb-GRAF
Seb-GRAF merged commit fca08a6 into main Oct 16, 2026
4 checks passed
@Seb-GRAF
Seb-GRAF deleted the fix/popup-after-removal branch October 16, 2026 11:06
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.5.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