From bdbccb77b8410dc2b5dd30312632455b0471cdb5 Mon Sep 17 00:00:00 2001 From: Dawid Buszta <344369893+MF-DEEV@users.noreply.github.com> Date: Fri, 23 Oct 2026 18:52:32 +0200 Subject: [PATCH 1/2] fix(sessions): scroll Claude's questions on the enlarged page Several questions ran taller than the island, so the last ones, the answer buttons, the conversation and the reply field fell off the page. The card keeps its own height up to 60% of the page and scrolls past it. --- .../Notch/NotchClaudeSessionLargeView.swift | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift b/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift index 26edb9f58..3b3a4c6c7 100644 --- a/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift +++ b/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift @@ -24,8 +24,11 @@ struct NotchClaudeSessionLargeView: View { @State private var allTools = false @State private var allAgents = false @State private var handleHovered = false + @State private var pageHeight: CGFloat = 0 private static let thinkingRow = -1 + /// The most of the page a request or Claude's questions take before they scroll. + static let cardShare: CGFloat = 0.6 static let sidebarWidth: CGFloat = 330 /// The handle's column, which stays when the details fold away. static let handleWidth: CGFloat = 38 @@ -37,7 +40,12 @@ struct NotchClaudeSessionLargeView: View { TimelineView(.periodic(from: .now, by: 1)) { context in VStack(alignment: .leading, spacing: 12) { header(now: context.date) - if session.phase.isWaiting { NotchClaudeSessionPermissionCard(session: session, text: text, open: open) } + if session.phase.isWaiting { + // Several questions run taller than the page; past most of + // it they scroll, leaving the conversation and the reply. + NotchClaudeSessionPermissionCard(session: session, text: text, open: open) + .modifier(NotchClaudeFittedScroll(maxHeight: pageHeight > 0 ? pageHeight * Self.cardShare : 360)) + } // Text that changes width on every frame breaks its lines on // every frame. So the conversation takes its new width at // once, breaking its lines a single time under a short fade, @@ -67,6 +75,7 @@ struct NotchClaudeSessionLargeView: View { .frame(maxHeight: .infinity) NotchClaudeSessionComposer(session: session, text: text, size: size) } + .onGeometryChange(for: CGFloat.self) { $0.size.height } action: { pageHeight = $0 } } .background { // ⌘+ and ⌘- change the text size, as in a browser. @@ -545,6 +554,22 @@ struct NotchClaudeSessionComposer: View { } } +/// Content at its own height until it would pass `maxHeight`, and scrolled +/// from there. +struct NotchClaudeFittedScroll: ViewModifier { + let maxHeight: CGFloat + @State private var height: CGFloat = 0 + + func body(content: Content) -> some View { + ScrollView { + content.onGeometryChange(for: CGFloat.self) { $0.size.height } action: { height = $0 } + } + .scrollIndicators(.automatic) + .scrollBounceBehavior(.basedOnSize) + .frame(height: min(height, maxHeight)) + } +} + /// When text breaks its lines anew, as the details fold, the conversation /// grows or shrinks; held at its end, the place being read stays put rather /// than the view landing elsewhere in the conversation. From 06234b33a496055fca74eb3a61e638f20b67c944 Mon Sep 17 00:00:00 2001 From: Dawid Buszta <344369893+MF-DEEV@users.noreply.github.com> Date: Fri, 23 Oct 2026 19:01:23 +0200 Subject: [PATCH 2/2] fix(sessions): open each request at its top and keep the reply on short screens The card's scroll outlived the request it showed, so the next request, or another waiting session's, opened where the last one was left. A new request now opens at its top. The card also gives way to the header, the reply and some of the conversation, so large text or added images cannot push the reply off a short screen. --- .../Notch/NotchClaudeSessionLargeView.swift | 42 +++++++++++++++---- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift b/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift index 3b3a4c6c7..79d633d73 100644 --- a/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift +++ b/Sources/Vorssaint/UI/Notch/NotchClaudeSessionLargeView.swift @@ -25,10 +25,16 @@ struct NotchClaudeSessionLargeView: View { @State private var allAgents = false @State private var handleHovered = false @State private var pageHeight: CGFloat = 0 + /// The header's and the reply's heights, which never give way to the card. + @State private var headerHeight: CGFloat = 0 + @State private var composerHeight: CGFloat = 0 private static let thinkingRow = -1 /// The most of the page a request or Claude's questions take before they scroll. static let cardShare: CGFloat = 0.6 + /// What the card leaves the conversation, and keeps for itself, on a short page. + static let conversationFloor: CGFloat = 80 + static let cardFloor: CGFloat = 120 static let sidebarWidth: CGFloat = 330 /// The handle's column, which stays when the details fold away. static let handleWidth: CGFloat = 38 @@ -40,11 +46,14 @@ struct NotchClaudeSessionLargeView: View { TimelineView(.periodic(from: .now, by: 1)) { context in VStack(alignment: .leading, spacing: 12) { header(now: context.date) + .onGeometryChange(for: CGFloat.self) { $0.size.height } action: { headerHeight = $0 } if session.phase.isWaiting { // Several questions run taller than the page; past most of // it they scroll, leaving the conversation and the reply. + // The next request, or another session's, opens at its top. NotchClaudeSessionPermissionCard(session: session, text: text, open: open) - .modifier(NotchClaudeFittedScroll(maxHeight: pageHeight > 0 ? pageHeight * Self.cardShare : 360)) + .modifier(NotchClaudeFittedScroll(maxHeight: cardLimit, + start: [session.id, session.permission?.requestID ?? ""])) } // Text that changes width on every frame breaks its lines on // every frame. So the conversation takes its new width at @@ -74,6 +83,7 @@ struct NotchClaudeSessionLargeView: View { .clipped() .frame(maxHeight: .infinity) NotchClaudeSessionComposer(session: session, text: text, size: size) + .onGeometryChange(for: CGFloat.self) { $0.size.height } action: { composerHeight = $0 } } .onGeometryChange(for: CGFloat.self) { $0.size.height } action: { pageHeight = $0 } } @@ -89,6 +99,15 @@ struct NotchClaudeSessionLargeView: View { } } + /// Most of the page, but never so much that large text or added images + /// push the reply off a short screen. + private var cardLimit: CGFloat { + guard pageHeight > 0 else { return 360 } + // The page's three gaps around the card and the conversation. + let room = pageHeight - headerHeight - composerHeight - 3 * 12 - Self.conversationFloor + return max(Self.cardFloor, min(pageHeight * Self.cardShare, room)) + } + private func toggleSidebar() { let hiding = !sidebarHidden storedSidebarHidden = hiding @@ -555,18 +574,25 @@ struct NotchClaudeSessionComposer: View { } /// Content at its own height until it would pass `maxHeight`, and scrolled -/// from there. -struct NotchClaudeFittedScroll: ViewModifier { +/// from there. A new `start` brings it back to its top. +struct NotchClaudeFittedScroll: ViewModifier { let maxHeight: CGFloat + let start: Start @State private var height: CGFloat = 0 + private static var top: String { "fitted.top" } func body(content: Content) -> some View { - ScrollView { - content.onGeometryChange(for: CGFloat.self) { $0.size.height } action: { height = $0 } + ScrollViewReader { proxy in + ScrollView { + content + .id(Self.top) + .onGeometryChange(for: CGFloat.self) { $0.size.height } action: { height = $0 } + } + .scrollIndicators(.automatic) + .scrollBounceBehavior(.basedOnSize) + .frame(height: min(height, maxHeight)) + .onChange(of: start) { proxy.scrollTo(Self.top, anchor: .top) } } - .scrollIndicators(.automatic) - .scrollBounceBehavior(.basedOnSize) - .frame(height: min(height, maxHeight)) } }