mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 10:36:35 +00:00
205bb2c56e
Prior fixes (4baa3d4,9aad905,d968878) narrowed the root cause but didn't fully close the loop. Both the Chat section and the v2.3 per-project Sessions tab were still growing the window past the screen — the chat input bar ended up below the visible desktop edge, unreachable. Why the previous fixes weren't enough: - Adding `.frame(maxHeight: .infinity)` on ChatView / ProjectSessionsView / dashboardArea told each view to FILL the space they were offered, but didn't cap what they reported UP the tree as their intrinsic ideal. - `.windowResizability(.contentMinSize)` at the WindowGroup level used the content's minimum size as the window's min floor — and with VStack-based layouts (RichChatMessageList materialises every message in a plain VStack to avoid LazyVStack's whitespace bug), the minimum bubbles up as ~messages-total-height, which exceeds the screen on long sessions. This commit pins the NavigationSplitView.detail slot's reported frame explicitly. The detail column now reports: - minWidth/minHeight: 500×300 — big enough for toolbars + chat input to always fit, small enough to work on any Mac screen - idealWidth/idealHeight: 900×600 — reasonable first-launch size that fits under `.contentMinSize`'s floor without pushing past the screen - maxWidth/maxHeight: infinity — user-resizable, no ceiling With this bound intercepting the size-reporting chain, NavigationSplitView's ideal becomes 500×300 ± idealWidth/Height regardless of what ChatView or ProjectSessionsView's children want internally. The window's content-derived minimum stays bounded to a sensible value. Views still fill the offered space because their `.frame(maxHeight: .infinity)` modifiers continue to claim whatever the detail column hands them. This is a window-layout-level fix that sits above the per-view clamps in earlier commits — those stay in as defensive intra- view layout, and the new frame here handles the outer coupling to the window. 80/80 Swift tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>