1→// 2→// ContentView.swift 3→// KortexOS 4→// 5→// Main navigation with TabView (iPhone) and NavigationSplitView (iPad) 6→// 7→ 8→import SwiftUI 9→ 10→struct ContentView: View { 11→ @StateObject private var dataManager = DataManager.shared 12→ @Environment(\.horizontalSizeClass) private var horizontalSizeClass 13→ 14→ @State private var selectedTab: Tab = .dashboard 15→ 16→ enum Tab: String, CaseIterable { 17→ case dashboard = "Dashboard" 18→ case ritual = "Ritual" 19→ case lifeMap = "Life Map" 20→ case journal = "Journal" 21→ case ai = "ZAIROS" 22→ case settings = "Settings" 23→ 24→ var icon: String { 25→ switch self { 26→ case .dashboard: return "square.grid.2x2" 27→ case .ritual: return "sunrise.fill" 28→ case .lifeMap: return "map" 29→ case .journal: return "book.fill" 30→ case .ai: return "brain.head.profile" 31→ case .settings: return "gearshape.fill" 32→ } 33→ } 34→ 35→ var color: Color { 36→ switch self { 37→ case .dashboard: return .blue 38→ case .ritual: return .orange 39→ case .lifeMap: return .purple 40→ case .journal: return .green 41→ case .ai: return .indigo 42→ case .settings: return .gray 43→ } 44→ } 45→ } 46→ 47→ var body: some View { 48→ Group { 49→ if horizontalSizeClass == .regular { 50→ // iPad: NavigationSplitView 51→ iPadNavigationView 52→ } else { 53→ // iPhone: TabView 54→ iPhoneTabView 55→ } 56→ } 57→ .environmentObject(dataManager) 58→ .onReceive(NotificationCenter.default.publisher(for: .openRitualFromNotification)) { _ in 59→ selectedTab = .ritual 60→ } 61→ .onReceive(NotificationCenter.default.publisher(for: .openJournalFromNotification)) { _ in 62→ selectedTab = .journal 63→ } 64→ } 65→ 66→ // MARK: - iPhone TabView 67→ 68→ private var iPhoneTabView: some View { 69→ TabView(selection: $selectedTab) { 70→ MissionControlView() 71→ .tabItem { 72→ Label(Tab.dashboard.rawValue, systemImage: Tab.dashboard.icon) 73→ } 74→ .tag(Tab.dashboard) 75→ 76→ RitualView() 77→ .tabItem { 78→ Label(Tab.ritual.rawValue, systemImage: Tab.ritual.icon) 79→ } 80→ .tag(Tab.ritual) 81→ 82→ LifeMapView() 83→ .tabItem { 84→ Label(Tab.lifeMap.rawValue, systemImage: Tab.lifeMap.icon) 85→ } 86→ .tag(Tab.lifeMap) 87→ 88→ JournalView() 89→ .tabItem { 90→ Label(Tab.journal.rawValue, systemImage: Tab.journal.icon) 91→ } 92→ .tag(Tab.journal) 93→ 94→ AIChatView() 95→ .tabItem { 96→ Label(Tab.ai.rawValue, systemImage: Tab.ai.icon) 97→ } 98→ .tag(Tab.ai) 99→ 100→ SettingsView() 101→ .tabItem { 102→ Label(Tab.settings.rawValue, systemImage: Tab.settings.icon) 103→ } 104→ .tag(Tab.settings) 105→ } 106→ .tint(.kortexAccent) 107→ } 108→ 109→ // MARK: - iPad NavigationSplitView 110→ 111→ private var iPadNavigationView: some View { 112→ NavigationSplitView { 113→ // Sidebar 114→ List { 115→ ForEach(Tab.allCases, id: \.self) { tab in 116→ Button { 117→ selectedTab = tab 118→ } label: { 119→ Label(tab.rawValue, systemImage: tab.icon) 120→ .foregroundColor(selectedTab == tab ? tab.color : .kortexText) 121→ } 122→ .listRowBackground(selectedTab == tab ? tab.color.opacity(0.1) : Color.clear) 123→ } 124→ } 125→ .navigationTitle("KortexOS") 126→ } detail: { 127→ // Detail view 128→ switch selectedTab { 129→ case .dashboard: 130→ MissionControlView() 131→ case .ritual: 132→ RitualView() 133→ case .lifeMap: 134→ LifeMapView() 135→ case .journal: 136→ JournalView() 137→ case .ai: 138→ AIChatView() 139→ case .settings: 140→ SettingsView() 141→ } 142→ } 143→ } 144→} 145→ 146→// MARK: - Preview 147→ 148→#Preview { 149→ ContentView() 150→} 151→ Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.