Skip to content

fix(notes): stop SwiftUI resizing notes mid-layout, which crashed rolled-up bars - #23

Merged
kasvith merged 1 commit into
mainfrom
fix/rolled-up-bar-crash
Nov 8, 2026
Merged

kasvith merged 1 commit into
mainfrom
fix/rolled-up-bar-crash

Conversation

@kasvith

@kasvith kasvith commented Nov 8, 2026

Copy link
Copy Markdown
Owner

A 0.11.0 user on macOS 27.2 reported a crash after pinning or unpinning a note (#22).

The crash report shows a layout-loop abort in a borderless window (NSNextStepFrame), and the only borderless note is a rolled-up bar. NSHostingView resizes the window from inside a layout pass when the content's minimum size changes, and the hover controls that hold the pin button raise that minimum. AppKit aborts when a window needs more layout passes than it has views, and a bar has only 6–9.

Changes

  • hosting.sizingOptions = [] in NotePanel, so only NoteWindowManager sizes a note.
  • NoteLayout.minWidth (156pt) replaces the minimum width the hosting view was enforcing. It applies to user resizes (windowWillResize), when a note opens, and in the move_note MCP tool.
  • Comments and CLAUDE.md no longer describe the hosting view as driving window size.

Behaviour change

156pt was already the limit while hovering an open note. Bars could previously be 128pt wide and move_note allowed 120pt; both are now 156pt. A note saved narrower opens at 156pt.

Testing

  • New test hoverLeavesBarSize: hovers a real 60pt bar and checks its size doesn't change. It failed before the fix (SwiftUI grew the bar to 128pt).
  • swift build and swift test pass (207 tests) on macOS 26.5.

Not confirmed on macOS 27.2

The crash itself didn't reproduce on 26.5. On 27.2 the resize goes through a different SwiftUI function, updateAnimatedWindowSize, and I couldn't check that sizingOptions = [] stops that path too. This PR uses Refs #22 rather than closing the issue, so the reporter can confirm on a build first.

…led-up bars

The hosting view resized the window from inside a layout pass whenever the
content's minimum size changed, which the hover controls do. AppKit aborts
when a window needs more layout passes than it has views, and a rolled-up
bar has only 6-9.

Set sizingOptions to [] so only NoteWindowManager sizes a note, and move the
minimum width it was enforcing into NoteLayout.minWidth (156pt).

Refs #22
@kasvith
kasvith merged commit 39de56f into main Nov 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant