diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 99ada7b9f796..aaa4d12499f8 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,16 @@ struct VerticalTabsSidebar: View { } .background(Color.clear) .modifier(ClearScrollBackground()) + .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) + } + } + } } SidebarFooter(updateViewModel: updateViewModel, onSendFeedback: onSendFeedback) .frame(maxWidth: .infinity, alignment: .leading)