CxWebApp/swift-app/Sources/CxWebAppMac/CxWebAppMacApp.swift
CxAI Agent 055e350108
Some checks are pending
build-and-push / image (push) Waiting to run
feat: initial CxWebApp (macOS shell + swift-app wired to CxLLM-SDK)
2026-05-16 14:32:01 -05:00

38 lines
1.4 KiB
Swift

import SwiftUI
import Combine
@main
struct CxWebAppMacApp: App {
@StateObject private var settings = AppSettings()
private let webAction = PassthroughSubject<WebView.WebAction, Never>()
var body: some Scene {
WindowGroup("CxWebApp") {
ContentView(webAction: webAction)
.environmentObject(settings)
}
.windowToolbarStyle(.unified)
.commands {
CommandGroup(after: .toolbar) {
Button("Reload") { webAction.send(.reload) }
.keyboardShortcut("r", modifiers: [.command])
Button("Back") { webAction.send(.back) }
.keyboardShortcut("[", modifiers: [.command])
Button("Forward") { webAction.send(.forward) }
.keyboardShortcut("]", modifiers: [.command])
Divider()
Button("Home") { webAction.send(.home) }
.keyboardShortcut("h", modifiers: [.command, .shift])
Button("Copy URL") { webAction.send(.copyURL) }
.keyboardShortcut("c", modifiers: [.command, .shift])
Button("Open in Browser") { webAction.send(.openInBrowser) }
.keyboardShortcut("o", modifiers: [.command, .shift])
}
}
Settings {
SettingsView().environmentObject(settings)
}
}
}