SPB Git

spb/zyquo-atlas Public License

The AI-native macOS web browser — every surface, intelligent.

Swift 75.2% JavaScript 22% Shell 2% Makefile 0.9%
1.8 KB · 56 lines swift
Raw Blame History
1//2//  ZyquoAtlasApp.swift3//  Zyquo Atlas4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//8//  The SwiftUI @main scene: the main browser WindowGroup, a private-window9//  scene (⌘⇧N), and the app menu/keyboard commands (AtlasCommands). Shared10//  services (catalog, vault, bookmarks, history) and the ThemeEngine are11//  injected into every window.12//1314import SwiftUI15import AppKit1617struct ZyquoAtlasApp: App {18    @NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate19    @StateObject private var appEnvironment = AppEnvironment()20    @StateObject private var themeEngine = ThemeEngine()2122    var body: some Scene {23        WindowGroup("Zyquo Atlas") {24            BrowserWindowView(profile: .defaultProfile)25                .environmentObject(appEnvironment)26                .environmentObject(themeEngine)27                .preferredColorScheme(themeEngine.theme.colorScheme)28        }29        .windowStyle(.hiddenTitleBar)30        .windowToolbarStyle(.unified)31        .commands { AtlasCommands() }3233        WindowGroup("Private", id: "private") {34            BrowserWindowView(profile: .privateProfile)35                .environmentObject(appEnvironment)36                .environmentObject(themeEngine)37                .preferredColorScheme(.dark)38        }39        .windowStyle(.hiddenTitleBar)40        .windowToolbarStyle(.unified)41    }42}4344/// Ensures a terminal-launched (non-bundle) process activates and shows its45/// window as a regular app rather than a background agent.46final class AppDelegate: NSObject, NSApplicationDelegate {47    func applicationDidFinishLaunching(_ notification: Notification) {48        NSApp.setActivationPolicy(.regular)49        NSApp.activate(ignoringOtherApps: true)50    }5152    func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {53        true54    }55}56