Fix: Janky Animation

This commit is contained in:
Hariharan Mudaliar 2026-03-01 02:01:02 +05:30
commit 8d7cc2ed58
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
3 changed files with 37 additions and 9 deletions

View file

@ -99,9 +99,6 @@ struct TabSelectionView: View {
)
}
}
DispatchQueue.main.async {
ensureValidSelection(with: tabsArray)
}
return tabsArray
}
var body: some View {
@ -110,10 +107,12 @@ struct TabSelectionView: View {
let isSelected = isSelected(tab)
let activeAccent = tab.accentColor ?? .white
TabButton(label: tab.label, icon: tab.icon, selected: isSelected) {
if tab.view == .extensionExperience {
coordinator.selectedExtensionExperienceID = tab.experienceID
withAnimation(.smooth(duration: 0.3)) {
if tab.view == .extensionExperience {
coordinator.selectedExtensionExperienceID = tab.experienceID
}
coordinator.currentView = tab.view
}
coordinator.currentView = tab.view
}
.frame(height: 26)
.foregroundStyle(isSelected ? activeAccent : .gray)
@ -132,8 +131,10 @@ struct TabSelectionView: View {
}
}
}
.animation(.smooth, value: coordinator.currentView)
.clipShape(Capsule())
.onAppear {
ensureValidSelection(with: tabs)
}
}
private var extensionTabsEnabled: Bool {