The file /Users/neog/Apps/macOS/GhostWriter/GhostWriter/App/GhostWriterApp.swift has been updated. Here's the result of running `cat -n` on a snippet of the edited file: 1→import SwiftUI 2→import SwiftData 3→ 4→@main 5→struct GhostWriterApp: App { 6→ @StateObject private var dataManager = DataManager.shared 7→ 8→ private let modelContainer: ModelContainer? 9→ private let initializationError: Error? 10→ 11→ init() { 12→ let schema = Schema([ 13→ StyleProfile.self, 14→ ContentDraft.self, 15→ ContentPipeline.self, 16→ Hook.self, 17→ Theme.self, 18→ DistributionChecklist.self, 19→ DistributionChecklistStep.self, 20→ WeeklyContentSchedule.self 21→ ]) 22→ let modelConfiguration = ModelConfiguration( 23→ schema: schema, 24→ isStoredInMemoryOnly: false 25→ ) 26→ 27→ do { 28→ self.modelContainer = try ModelContainer(for: schema, configurations: [modelConfiguration]) 29→ self.initializationError = nil 30→ } catch { 31→ self.modelContainer = nil 32→ self.initializationError = error 33→ } 34→ } 35→ 36→ var body: some Scene { 37→ WindowGroup { 38→ if let container = modelContainer { 39→ ContentView() 40→ .onAppear { 41→ dataManager.setModelContext(container.mainContext) 42→ dataManager.seedHooksIfNeeded() 43→ dataManager.seedNEOGStyleProfileIfNeeded() 44→ dataManager.seedGeneratedContentIfNeeded() 45→ dataManager.seedThemesIfNeeded() 46→ } 47→ .modelContainer(container) 48→ } else { 49→ DatabaseErrorView(error: initializationError) 50→ } 51→ } 52→ .defaultSize(width: 1200, height: 800) 53→ .commands { 54→ CommandGroup(replacing: .newItem) { 55→ Button("New Content") { 56→ // TODO: Navigate to generator 57→ } 58→ .keyboardShortcut("n", modifiers: .command) 59→ } 60→ 61→ CommandMenu("Generate") { 62→ Button("Generate for All Platforms") { 63→ // TODO: Trigger generation 64→ } 65→ .keyboardShortcut("g", modifiers: [.command, .shift]) 66→ 67→ Divider() 68→ 69→ ForEach(Platform.allCases) { platform in 70→ Button("Generate for \(platform.rawValue)") { 71→ // TODO: Generate for specific platform 72→ } 73→ } 74→ } 75→ } 76→ 77→ Settings { 78→ SettingsView() 79→ } 80→ } 81→} 82→ 83→// MARK: - Database Error View 84→ 85→struct DatabaseErrorView: View { 86→ let error: Error? 87→ 88→ var body: some View { 89→ VStack(spacing: 20) { 90→ Image(systemName: "exclamationmark.triangle.fill") 91→ .font(.system(size: 64)) 92→ .foregroundStyle(.yellow) 93→ 94→ Text("Database Initialization Failed") 95→ .font(.title) 96→ .fontWeight(.semibold) 97→ 98→ Text("GhostWriter could not initialize its database. This may be due to a corrupted database file or insufficient permissions.") 99→ .multilineTextAlignment(.center) 100→ .foregroundStyle(.secondary) 101→ .frame(maxWidth: 400) 102→ 103→ if let error = error { 104→ GroupBox { 105→ Text(error.localizedDescription) 106→ .font(.caption) 107→ .foregroundStyle(.secondary) 108→ .frame(maxWidth: .infinity, alignment: .leading) 109→ } 110→ .frame(maxWidth: 400) 111→ } 112→ 113→ HStack(spacing: 16) { 114→ Button("Open Data Folder") { 115→ openDataFolder() 116→ } 117→ 118→ Button("Quit") { 119→ NSApplication.shared.terminate(nil) 120→ } 121→ .keyboardShortcut(.defaultAction) 122→ } 123→ .padding(.top, 10) 124→ } 125→ .padding(40) 126→ .frame(minWidth: 500, minHeight: 400) 127→ } 128→ 129→ private func openDataFolder() { 130→ let appSupport = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first 131→ if let folder = appSupport { 132→ NSWorkspace.shared.open(folder) 133→ } 134→ } 135→} 136→