Skip to content

StableBar crashes opening a widget's tooltip or hover controls after editing the bar in place #595

Closed

Description

@Seb-GRAF

What happens

StableBar quits with EXC_BREAKPOINT (Trace/BPT trap: 5) on the main thread when a widget's tooltip or hover controls open after the hover delay. It happened twice:

  • 0.14.0-beta (922): right after finishing Edit Bar in Place, through the hover controls of a battery widget with a hoverLayout.
  • 0.14.0-beta (932): through a widget's plain tooltip. What preceded this one isn't known.
0  StableBar  specialized WidgetPopup.openTooltip<A>(id:style:defaults:store:anchor:maxWidth:alignment:ignoresMouseEvents:content:) + 4020
2  StableBar  closure #3 in WidgetView.hoverChanged(_:tooltip:output:) + 572
4  StableBar  closure #1 in WidgetPopup.hover(_:store:anchor:show:) + 1
8  libswift_Concurrency.dylib  completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1

Steps to reproduce

Worked out from the code, not reproduced in the app:

  1. Have a widget with hover controls (hoverLayout) or a tooltip.
  2. Choose Edit Bar in Place.
  3. Finish editing and move the pointer over that widget's tile while the edit bar fades out.
  4. After the hover delay, StableBar quits.

Expected

No crash, and nothing opens for a widget that is no longer on screen.

Environment

  • StableBar 0.14.0-beta (922 and 932)
  • macOS 27.2.1 (26B131), Mac15,6

Evidence

  • In both builds, the disassembly shows the trap right after -[NSView window] returns nil (cbz x0 to brk #1): anchor.window! failed.
  • A test that hovers an anchor in no window stops with WidgetPopup.swift:440: Fatal error: Unexpectedly found nil while unwrapping an Optional value.

Diagnosis

On main (09f1ab1):

  • WidgetPopup.openTooltip starts with let window = anchor.window! (Sources/StableBar/WidgetPopup.swift:440), and open does the same (:505).
  • The hover task in WidgetPopup.hover (WidgetPopup.swift:320-329) checks for cancellation and barEditing.allowsWidgetActions after its delay, but not that the anchor is still in a window.
  • While the bar is edited in place, its tiles draw real WidgetViews (Sources/StableBar/BarEditView.swift:365). A widget's PopupAnchor only joins the view hierarchy when widget actions are allowed (Sources/StableBar/BarView.swift:702), so a tile's anchor is never in a window, and removeAnchor, which cancels a pending hover, never runs for it.
  • When editing ends, the edit bar fades out (BarView.swift:59-61), and hoverChanged reads allowsWidgetActions when the hover arrives. A tile hovered during the fade then schedules a hover with an anchor in no window. This step is inferred from the code.

Skipping the hover when anchor.window is nil covers popups, tooltips, hover controls and rows, which all unwrap it.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

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

    @stablebar-releases

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