Phase 3B: iOS Navigation Foundation & Auth Deferral
Date: 2025-11-20 Status: Complete (pivoted from original scope) Week: 29
Overview
Phase 3B was originally scoped as “Google Sign-In implementation” building on Phase 3A’s shared authentication foundation. However, during implementation, critical infrastructure gaps were discovered that made authentication implementation premature.
The session pivoted to:
- Implement proper iOS tab navigation architecture
- Defer authentication to Phase 5
- Reorder iOS phases to prioritize features with proven KMP code
Result: iOS app now has professional navigation foundation, ready for Phase 2 feature implementation.
What Was Originally Planned
Original Phase 3B Scope
Goal: Implement Google Sign-In on iOS
Planned Tasks:
- Wire up shared
FirebaseAuthRepositoryto iOS - Implement Google Sign-In UI flow
- Handle auth state in SwiftUI
- Test sign-in/sign-out flows
Expected Outcome: Working Google Sign-In on iOS using shared KMP auth logic
Estimated Effort: 1 week
What Was Discovered
Infrastructure Gaps
During implementation, several critical issues were identified:
1. Missing Kotlin iosMain Dependency Injection
Problem:
// This doesn't exist yet:
// iosMain/.../IosDependencies.kt
// Swift cannot do:
// let authRepo = IosDependencies.shared.authRepositoryImpact:
- Cannot instantiate
FirebaseAuthRepositoryfrom Swift - No bridge between KMP services and iOS app
- Blocks all shared code consumption
2. GitLive Firebase KMP Not Configured for iOS
Problem:
- Library added to dependencies but not properly configured
- No Swift-Kotlin bridging for Firebase types
- Auth state flows not exposed
Impact:
- Shared auth logic inaccessible from iOS
- Would require duplicating auth code in Swift (defeats KMP purpose)
3. KMP-NativeCoroutines Not Set Up
Problem:
- Kotlin
Flowtypes cannot be consumed in Swift as async sequences - No coroutine bridging configured
- Auth state updates blocked
Impact:
- Real-time auth state changes unusable from iOS
- Async patterns don’t bridge properly
Root Cause
Core Issue: Phase 1 infrastructure was Android-first, iOS KMP bridge layer never established.
Should Have Existed: Basic iOS DI setup and KMP bridging should have been part of Phase 1.
The Pivot Decision
Decision Point
When infrastructure gaps were discovered, two options existed:
Option A: Stop and Build Infrastructure First
- Spend 1-2 weeks building iosMain DI
- Configure GitLive Firebase + KMP-NativeCoroutines
- Then implement Google Sign-In
- Problem: Delays all feature work by 2-3 weeks
Option B: Defer Auth, Ship Features First
- Reorder phases to prioritize proven KMP features
- Build navigation foundation for iOS app
- Come back to auth in Phase 5
- Benefit: Ship user value immediately, infrastructure when needed
Decision: Option B - Defer Auth to Phase 5
Rationale:
- Authentication is not required for core features (rounds, equipment, tournaments)
- Proven KMP code exists for rounds/equipment/tournaments (90-95% shared)
- Can ship features to users immediately
- Auth infrastructure can be built when not blocking features
Approved By: User (project owner)
What Phase 3B Delivered
iOS Tab Navigation Architecture
Phase 3B pivoted to implementing professional iOS navigation foundation:
Implementation
Pattern: Standard iOS bottom tab bar navigation
Entry Point: MainTabView.swift
Tabs: 4 main sections
TabView {
RoundsView()
.tabItem {
Label("Rounds", systemImage: "target")
}
EquipmentView()
.tabItem {
Label("Equipment", systemImage: "figure.archery")
}
TournamentsView()
.tabItem {
Label("Tournaments", systemImage: "trophy")
}
SettingsView()
.tabItem {
Label("Settings", systemImage: "gear")
}
}Tab Details
Tab 1: Rounds (Phase 2 Target)
- Professional “Coming Soon” placeholder
- Target: Phase 2 implementation (next)
- Shared code: 90-95% KMP
Tab 2: Equipment (Phase 3 Target)
- Professional “Coming Soon” placeholder
- Target: Phase 3 implementation
- Shared code: 90%+ KMP
Tab 3: Tournaments
- ✅ Already working (from original iOS spike)
- Proof point: KMP integration successful
- Full tournament list and scoring UI
Tab 4: Settings
- Sign-in UI shell (buttons non-functional)
- Will wire up in Phase 5
- Access to app settings and authentication
Benefits Delivered
User Experience:
- Professional, polished navigation
- Clear feature roadmap visibility
- No broken or half-working features
- Standard iOS patterns (familiar)
Development:
- Clean foundation for feature additions
- Easy to swap placeholders for real features
- Auth accessible but not blocking
- Simplified app architecture
Technical:
- Single app entry point
- iOS-standard navigation
- No complex routing
- Ready for Phase 2 features
iOS Plan Reordering
Why Reorder?
Problem: Authentication blocked feature development due to infrastructure gaps.
Solution: Reorder phases to prioritize features with proven KMP code, defer infrastructure-heavy work.
Previous Phase Order
- Phase 1: Infrastructure ✅
- Phase 2: Authentication & Settings ← BLOCKED
- Phase 3: Round Scoring
- Phase 4: Equipment
- Phase 5: Analytics & Tournaments
- Phase 6: Polish & Release
New Phase Order (2025-11-20)
- Phase 1: Infrastructure ✅
- Phase 2: Round Scoring MVP ← NEXT (90-95% shared KMP)
- Phase 3: Equipment Management (90%+ shared KMP)
- Phase 4: Tournaments & Analytics (85-90% shared KMP)
- Phase 5: Authentication & Settings ← MOVED (complex infrastructure)
- Phase 6: Polish & Release
Strategic Benefits
Faster User Value:
- Ship round scoring immediately (high-value feature)
- Equipment and tournaments follow quickly
- Users get working app sooner
Leverage Proven Code:
- Rounds: Existing KMP code, Android proven
- Equipment: Existing KMP code, Android proven
- Tournaments: Already working on iOS
Reduced Risk:
- Known patterns
- Proven implementations
- Minimal iOS-specific work
Flexible Auth:
- Not required for core features
- Can be optional in MVP
- Add in later update
Technical Details
Code Structure
iosApp/ArcheryApprentice/
├── ArcheryApprentice/
│ ├── MainTabView.swift ← New entry point
│ ├── Screens/
│ │ ├── RoundsView.swift ← Phase 2 placeholder
│ │ ├── EquipmentView.swift ← Phase 3 placeholder
│ │ ├── TournamentsView.swift ← Working ✅
│ │ └── SettingsView.swift ← Sign-in shell
│ └── SignIn/
│ └── SignInView.swift ← UI only (Phase 5)
App Launch Flow
Before Phase 3B:
App → ContentView → ?
After Phase 3B:
App → MainTabView → [Rounds|Equipment|Tournaments|Settings]
Benefits:
- Single entry point
- Clear navigation hierarchy
- Easy to reason about
- Standard iOS pattern
What’s Deferred to Phase 5
The following work is explicitly moved to Phase 5:
Kotlin iosMain Infrastructure (1 week)
Tasks:
- Create
IosDependenciessingleton - Set up dependency injection module
- Wire up KMP services for Swift
- Create proper bridging layer
GitLive Firebase KMP Integration (3-4 days)
Tasks:
- Configure GitLive Firebase for iOS
- Expose Firebase services to Swift
- Set up auth state flow bridging
- Test end-to-end auth flows
KMP-NativeCoroutines Setup (2-3 days)
Tasks:
- Configure compiler plugin
- Add
@NativeCoroutinesannotations - Test Swift async sequence consumption
- Verify coroutine scope bridging
Real Authentication Implementation (1 week)
Tasks:
- Wire up real
FirebaseAuthRepository - Implement Google Sign-In flow
- Implement Apple Sign-In flow
- Add auth state persistence
- Handle sign-out
Total Phase 5 Effort: ~2 weeks (as originally estimated)
Lessons Learned
1. Infrastructure Validation Needs Platform Parity
Problem: “Phase 1 complete” didn’t validate iOS bridge layer.
Lesson: Infrastructure phases need platform parity checks:
- ✅ Does it build?
- ✅ Does it run?
- ❌ Can it access shared code? ← Should have validated
Future: Add platform parity to Phase 1 acceptance criteria.
2. Break Complex Phases into Substeps
Problem: “Phase 3B: Google Sign-In” hid infrastructure prerequisite.
Better Breakdown:
- Phase 3B-1: Kotlin iosMain DI infrastructure
- Phase 3B-2: iOS UI integration
Future: Break phases into infrastructure + implementation substeps.
3. Match Agent Workflow to Feedback Loops
Problem: Multi-agent handoff added friction when real-time Xcode feedback needed.
Lesson:
- Android: Agent can test → Agent-led OK ✅
- iOS: Requires Xcode → Direct orchestrator-user better ✅
Future: Assign agents based on feedback loop requirements.
4. Plan Changes are Engineering Intelligence
Problem: Viewing plan changes as “failure.”
Lesson: Reordering phases based on discovered blockers is smart engineering:
- Maximizes delivered value
- Reduces risk
- Improves efficiency
Future: Embrace plan changes as project intelligence.
Success Metrics
Phase 3B Delivered (Achieved)
✅ iOS app builds and runs ✅ Tab navigation functional ✅ Sign-in UI displays (non-functional buttons) ✅ Tournaments feature still works ✅ Professional placeholders for future phases
Phase 5 Targets (Future)
⏳ Kotlin iosMain DI infrastructure working ⏳ GitLive Firebase KMP wired for iOS ⏳ KMP-NativeCoroutines configured ⏳ Google Sign-In working end-to-end ⏳ Apple Sign-In working end-to-end ⏳ Auth state persistence implemented
Related Documentation
Internal Sessions
- Phase 3B Session Documentation - Full session details
iOS Guides
- iOS Development Roadmap - Updated phase order
- Phase 3A: Auth Foundation - Shared authentication setup
GitHub References
- PHASE_3B_OUTCOME.md - Detailed outcome analysis
- IOS_DEV_STATUS.md - Current iOS status
- PR #283 - iOS tab navigation implementation
Next Steps
Immediate: Phase 2 - Round Scoring MVP
Target: 4 weeks Shared Code: 90-95% KMP Focus: Get core round scoring working on iOS
Tasks:
- Wire up existing round repository to iOS
- Implement round list view
- Implement scoring interface
- Test end-to-end round creation and scoring
Blocker Status: ✅ None - shared code proven on Android
Future: Phase 5 - Authentication
Target: ~12-16 weeks from now (after Phases 2-4) Effort: 2 weeks Focus: Build iOS infrastructure, wire up authentication
Prerequisite: Phases 2-4 features shipped to users first
Conclusion
Phase 3B represents a smart architectural pivot. By discovering infrastructure gaps early and reordering the plan, the project is now positioned to:
- Ship high-value features immediately (Phases 2-4)
- Leverage proven shared KMP code (90-95% code reuse)
- Defer complex infrastructure work to appropriate phase
- Get working app in users’ hands faster
The iOS app now has a professional navigation foundation and clear path to feature development. Authentication will be added in Phase 5 when it doesn’t block feature delivery.
Status: ✅ Foundation complete, ready for Phase 2 features