Tab Bar Load Animation

Nucleic-Session: EEC60FAE-8368-49CA-9202-7026C12E7F8C
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-05 19:05:24 -07:00
co-authored by Nucleic
parent 5916919790
commit 311f7e2237
@@ -120,12 +120,27 @@ struct CompactRootView: View {
}
/// A preference carrying the floating bar's measured height up to `CompactRootView`, which feeds it
/// back into the bottom safe-area inset so content sits exactly above the bar.
/// back into each tab's bottom inset so content sits exactly above the bar.
private struct BarHeightKey: PreferenceKey {
static var defaultValue: CGFloat = 72
static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { value = nextValue() }
}
/// Per-tab chrome for the compact shell: suppress the system tab bar (we draw our own) and reserve
/// `height` at the bottom of this tab's content so its scroll view lays out above the floating bar.
/// Applied to each tab rather than the `TabView`, whose container-level inset doesn't reach the tab
/// pages' scroll content.
private struct TabBarInset: ViewModifier {
let height: CGFloat
func body(content: Content) -> some View {
content
.toolbar(.hidden, for: .tabBar)
.safeAreaInset(edge: .bottom, spacing: 0) {
Color.clear.frame(height: height)
}
}
}
/// Our own bottom tab bar for the compact shell — a floating Liquid Glass capsule of four items
/// (Home, Sessions, Projects, Settings), standing in for the system tab bar so `CompactRootView`
/// can animate its visibility itself (see that view for why) while keeping the iOS 26 floating-glass