From 4baa3d4d289a524ebe79902dd166d928645c10aa Mon Sep 17 00:00:00 2001 From: Alan Wizemann Date: Thu, 23 Apr 2026 23:55:10 +0200 Subject: [PATCH] fix(projects): clamp Sessions tab height so it doesn't push the window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new Sessions tab's outer VStack had no maxHeight constraint. Its inner `List(sessions) { … }` uses intrinsic content size — which grows with the row count — and with enough sessions the enclosing VStack would push the project window past the bottom of the screen. Fixed by adding `.frame(maxWidth: .infinity, maxHeight: .infinity)` to the outer VStack in `ProjectSessionsView.body`, matching the pattern `siteTab` uses for its webview. Now the List fills the available tab area and scrolls internally as expected. Other v2.3 tabs already self-constrain (`widgetsTab` via ScrollView, `siteTab` via explicit maxHeight). This brings Sessions in line. 80/80 Swift tests still pass. Visual-only fix; no test change. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Features/Projects/Views/ProjectSessionsView.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scarf/scarf/Features/Projects/Views/ProjectSessionsView.swift b/scarf/scarf/Features/Projects/Views/ProjectSessionsView.swift index 3bb02ec..ab4c9af 100644 --- a/scarf/scarf/Features/Projects/Views/ProjectSessionsView.swift +++ b/scarf/scarf/Features/Projects/Views/ProjectSessionsView.swift @@ -20,6 +20,13 @@ struct ProjectSessionsView: View { Divider() content } + // Without this clamp the inner List's intrinsic height grows + // with its row count and the enclosing VStack pushes the + // window itself past the screen. Other tabs handle this via + // their own container (widgetsTab = ScrollView, siteTab = + // explicit maxHeight) — match the siteTab pattern here so + // the List scrolls internally. + .frame(maxWidth: .infinity, maxHeight: .infinity) .task(id: project.id) { // Rebuild the VM when the project changes so stale state // from a previously-selected project doesn't bleed