From 8fe2b6d8048de50406f57c52e33baa091f0e0f68 Mon Sep 17 00:00:00 2001 From: Shingo Sato Date: Tue, 31 Mar 2026 21:03:23 +0900 Subject: [PATCH 1/2] fix: auto-scroll sidebar to follow workspace selection When switching workspaces with Ctrl+Cmd+[ / Ctrl+Cmd+], the sidebar now scrolls to keep the selected tab visible when sessions exceed the screen height. Co-Authored-By: Claude Opus 4.6 (1M context) --- Sources/ContentView.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 99ada7b9f796..e11c86a3b968 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -8724,6 +8724,7 @@ struct VerticalTabsSidebar: View { VStack(spacing: 0) { GeometryReader { proxy in + ScrollViewReader { scrollProxy in ScrollView { VStack(spacing: 0) { // Space for traffic lights / fullscreen controls @@ -8827,6 +8828,13 @@ struct VerticalTabsSidebar: View { } .background(Color.clear) .modifier(ClearScrollBackground()) + .onChange(of: tabManager.selectedTabId) { newId in + guard let newId else { return } + withAnimation(.easeOut(duration: 0.15)) { + scrollProxy.scrollTo(newId, anchor: nil) + } + } + } } SidebarFooter(updateViewModel: updateViewModel, onSendFeedback: onSendFeedback) .frame(maxWidth: .infinity, alignment: .leading) From 86bf7560f1b68e19f578b74c42f2179e48a99cef Mon Sep 17 00:00:00 2001 From: Shingo Sato Date: Tue, 31 Mar 2026 21:18:34 +0900 Subject: [PATCH 2/2] fix: address review comments on sidebar scroll - Use two-argument onChange API (deprecated single-arg form on macOS 14+) - Add dlog for sidebar scroll event in DEBUG builds Co-Authored-By: Claude Opus 4.6 (1M context) --- Sources/ContentView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index e11c86a3b968..aaa4d12499f8 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -8828,8 +8828,11 @@ struct VerticalTabsSidebar: View { } .background(Color.clear) .modifier(ClearScrollBackground()) - .onChange(of: tabManager.selectedTabId) { newId in + .onChange(of: tabManager.selectedTabId) { _, newId in guard let newId else { return } + #if DEBUG + dlog("sidebar.scroll.selectedTab id=\(newId.uuidString.prefix(5))") + #endif withAnimation(.easeOut(duration: 0.15)) { scrollProxy.scrollTo(newId, anchor: nil) }