From 7578ccae60a0f1c7f14908d37c3c65b9284db0f4 Mon Sep 17 00:00:00 2001 From: Hariharan Mudaliar Date: Sun, 1 Mar 2026 01:51:49 +0530 Subject: [PATCH] Finally fixed: Stats two row --- DynamicIsland/ContentView.swift | 4 +++- DynamicIsland/components/Tabs/TabSelectionView.swift | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/DynamicIsland/ContentView.swift b/DynamicIsland/ContentView.swift index 674e0bd..bc48153 100644 --- a/DynamicIsland/ContentView.swift +++ b/DynamicIsland/ContentView.swift @@ -180,7 +180,7 @@ struct ContentView: View { } private let zeroHeightHoverPadding: CGFloat = 10 - private let statsAdditionalRowHeight: CGFloat = 110 + private let statsAdditionalRowHeight: CGFloat = statsSecondRowContentHeight + statsGridSpacingHeight private let musicControlPauseGrace: TimeInterval = 5 private let musicControlResumeDelay: TimeInterval = 0.24 @@ -398,6 +398,8 @@ struct ContentView: View { maxHeight: dynamicNotchSize.height + currentShadowPadding, alignment: .top ) + .frame(maxHeight: .infinity, alignment: .top) + .animation(nil, value: coordinator.currentView) .environmentObject(privacyManager) .onChange(of: dynamicNotchSize) { oldSize, newSize in guard oldSize != newSize else { return } diff --git a/DynamicIsland/components/Tabs/TabSelectionView.swift b/DynamicIsland/components/Tabs/TabSelectionView.swift index ff77a77..1e80585 100644 --- a/DynamicIsland/components/Tabs/TabSelectionView.swift +++ b/DynamicIsland/components/Tabs/TabSelectionView.swift @@ -110,12 +110,10 @@ struct TabSelectionView: View { let isSelected = isSelected(tab) let activeAccent = tab.accentColor ?? .white TabButton(label: tab.label, icon: tab.icon, selected: isSelected) { - withAnimation(.smooth) { - if tab.view == .extensionExperience { - coordinator.selectedExtensionExperienceID = tab.experienceID - } - coordinator.currentView = tab.view + if tab.view == .extensionExperience { + coordinator.selectedExtensionExperienceID = tab.experienceID } + coordinator.currentView = tab.view } .frame(height: 26) .foregroundStyle(isSelected ? activeAccent : .gray) @@ -134,6 +132,7 @@ struct TabSelectionView: View { } } } + .animation(.smooth, value: coordinator.currentView) .clipShape(Capsule()) }