Repository navigation
Closed
Description
What happens
On a Mac with two displays, StableBar quits while editing the bar in place. Dropping a widget on one display's edit bar makes the other display's edit bar abort the app a moment later (here 0.35 s after the drop).
Steps to reproduce
- Connect a second display, so each display has a bar.
- Choose Edit Bar in Place.
- Drag a widget to another position on one display's bar and drop it.
Expected
The widget moves, and both edit bars show it in its new place.
Environment
- StableBar 0.15.0-beta.20261113164833.1031 (
mainat dc73d5d, with feat: keep widgets in place while editing the bar and scroll a crowded side #635) - macOS 27.2.1 (26B131)
- Two displays: a Dell U2722D (main) and a MacBook Pro's built-in display
Evidence
The crash report's main thread, abridged:
__assert_rtn
NSCGSizeApplyInverseAffineTransform
-[NSView convertSizeFromBacking:]
NSHostingView.minSize()
NSHostingView.SizeConstraints.update(from:)
NSHostingView._willUpdateConstraintsForSubtree()
…
-[NSView layoutSubtreeIfNeeded]
-[NSView _setDefaultKeyViewLoop]
AppKitPlatformViewHost.viewDidMoveToSuperview()
-[NSView addSubview:positioned:relativeTo:]
_AppKitAddSubview
DisplayList.ViewUpdater.updateItemView(container:from:localState:)
…
NSHostingView.layout()
A test that edits the bar on two displays and drops a widget on the first aborts on current main with:
Assertion failed: (determinant != 0), function NSCGSizeApplyInverseAffineTransform, file NSView.m, line 6271.
Diagnosis
Sources/StableBar/BarEditView.swift:90draws a unit the edit bar hasn't measured yet at.scaleEffect(0), so it grows in from nothing (added in feat: keep widgets in place while editing the bar and scroll a crowded side #635).- Each tile is a
BarEditDragSource, anNSViewRepresentablewhose view holds anNSHostingView(WidgetHostingView). When SwiftUI adds that view under a scale of 0, AppKit lays out the inner hosting view and inverts the scale to get its minimum size. A scale of 0 has no inverse, so AppKit aborts. - With two displays: while the widget is over the first display,
BarEditing.arranged(Sources/StableBar/BarEditing.swift:181) leaves it out of the other display's edit bar, whose measuring copy then drops its width (widths = $0,BarEditView.swift:148). Once the move is saved, the widget comes back there unmeasured, at scale 0. - Any unit that appears unmeasured takes the same path, so adding a widget may crash too (not checked).
- A standalone SwiftUI program with the same nesting aborts at a scale of 0 and runs at 0.01.
Related
- Editing the bar in place moves widgets, wraps a crowded side and makes drops hard to land #634 / feat: keep widgets in place while editing the bar and scroll a crowded side #635 added the grow-in from nothing.
- StableBar crashes opening a widget's tooltip or hover controls after editing the bar in place #595 / fix: stop hover tooltips crashing StableBar after editing the bar in place #596 was a different crash after editing in place (a tooltip's nil unwrap).
Triaged by Claude Code (Claude Opus 5.5).
Activity
chore(release): 0.15.0 [skip ci]
stablebar-releases commentedon Nov 14, 2026
🎉 This issue has been resolved in version 0.15.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
fix: stop the edit bar crashing when a widget comes back on another d…