Files
platform/ios
Yusuf Suleman 583138fbe2
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
fix: stabilize view tree for zoom transition recovery
ROOT CAUSE: @State TripsViewModel inside TripsHomeView was recreated
during navigation transitions. Each recreation set isLoading=true,
flipping the Group conditional, destroying the ScrollView + namespace.
The zoom transition's matchedTransitionSource evaporated.

FIXES (matching Apple's Wishlist pattern):
1. ViewModel owned by MainTabView (like ReaderVM) — survives
   view recreation. Pre-loaded on app launch.
2. Loading state rendered INSIDE ScrollView — no conditional
   Group wrapper that swaps the entire view tree.
3. Single @Namespace in TripsHomeView, passed to both
   UpcomingTripsPageView and PastTripsSection.
4. Zoom transition restored on all NavigationLinks.

Why Apple's sample works: they use @Environment(DataSource.self)
which is app-level stable. Our equivalent: @State at MainTabView.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 14:43:46 -05:00
..