// // RootView.swift // Focale // // Author: Simon-Pierre Boucher // Contact: contact@spboucher.ai // import SwiftUI struct RootView: View { @Environment(AppModel.self) private var app var body: some View { Group { if app.hasFullPhotoAccess { mainTabs } else if app.hasLimitedPhotoAccess { LimitedAccessView() } else { OnboardingView() } } .onAppear { app.refreshPhotoAccess() } } private var mainTabs: some View { TabView { Tab("Appareil", systemImage: "camera.fill") { CaptureView() } Tab("Bibliothèque", systemImage: "photo.on.rectangle") { LibraryView() } Tab("Recherche", systemImage: "magnifyingglass") { SearchView() } } .task(priority: .utility) { // Recent photos become searchable right away; the deep // backfill still runs at night on the charger. await app.indexPipeline.indexRecentInForeground() } } }