Collapsing a NavigationSplitView sidebar from the toolbar button terminates the process in a right-to-left window — but only when the detail column's content carries a padding modifier. Remove the padding and it never crashes. Switch the window to left-to-right and it never crashes.
AppKit raises an uncaught exception from -[NSWindow _postWindowNeedsUpdateConstraints] (the window is asked to update its constraints more times than it has views) while a SwiftUI NSHostingView re-invalidates its layout without ever settling.
Environment: macOS 27.0 beta (26A5388g), MacBook Pro with Apple M5; Xcode 27.0 (27A5228h); Swift 6.4.
Complete reproducer This is the whole app — no dependencies, no model, no table, no timer, no toolbar items of my own.
@main
struct PaddedDetailCrashApp: App {
@State private var columns: NavigationSplitViewVisibility = .all
var body: some Scene {
Window(Text(verbatim: "Padded Detail"), id: "main") {
NavigationSplitView(columnVisibility: $columns) {
List {
Text(verbatim: "Projects")
Text(verbatim: "Archived")
Text(verbatim: "Trash")
}
} detail: {
Color.gray
.padding(40) // <-- remove this and the crash goes with it
}
.environment(\.layoutDirection, .rightToLeft)
}
.defaultSize(width: 900, height: 600)
}
}
Steps to reproduce:
1 - Build and run the code above, launched with the arguments that mirror the window itself: -AppleTextDirection YES -NSForceRightToLeftWritingDirection YES
2 - Click the toolbar's sidebar toggle repeatedly and quickly — roughly four clicks a second.
3 - The process terminates, in my measurements after about 8 toggles.
The timing is essential. Each click has to land while the previous collapse is still animating. Clicking slowly, or scripting it so each click completes before the next begins, never reproduces it. Driving the toggle from the View menu (which changes the same state without animating) also never reproduces it.