Repository navigation
fix(notes): stop SwiftUI resizing notes mid-layout, which crashed rolled-up bars - #23
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.NSHostingViewresizes 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 = []inNotePanel, so onlyNoteWindowManagersizes 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 themove_noteMCP tool.CLAUDE.mdno 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_noteallowed 120pt; both are now 156pt. A note saved narrower opens at 156pt.Testing
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 buildandswift testpass (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 thatsizingOptions = []stops that path too. This PR usesRefs #22rather than closing the issue, so the reporter can confirm on a build first.