mirror of
https://github.com/BigMarc/grammargem.git
synced 2026-10-13 17:01:55 +02:00
- LiveMonitor: menu-bar–resident; reads the focused field via the Accessibility API, runs the offline grammar engine, and shows live suggestions + a "Fix all". - Menu-bar icon now reflects status (issue count / paused); added Pause/Resume. - Page Blocker: exclude apps + websites (Safari domain detection) where GrammaGem stays out of the way; hotkeys + monitoring suppressed there. - build.sh now produces a universal (arm64 + x86_64) bundle; sign-notarize.sh is a turnkey codesign→notarize→staple flow reading creds from env/keychain (no secrets). - Clean entitlements plist (AMFI-compatible). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
35 lines
1.0 KiB
Swift
35 lines
1.0 KiB
Swift
import SwiftUI
|
|
import AppKit
|
|
|
|
/// App entry point. A menu-bar (`LSUIElement`) SwiftUI app: the only persistent
|
|
/// scene is the `MenuBarExtra`; Settings uses the standard scene; Onboarding and
|
|
/// Ask are AppKit-hosted windows opened on demand (see `AppState`).
|
|
@main
|
|
struct GrammaGemApp: App {
|
|
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
|
@StateObject private var app = AppState.shared
|
|
|
|
var body: some Scene {
|
|
MenuBarExtra {
|
|
MenuBarContent()
|
|
.environmentObject(app)
|
|
} label: {
|
|
MenuBarLabel()
|
|
}
|
|
.menuBarExtraStyle(.window)
|
|
|
|
Settings {
|
|
SettingsView()
|
|
.environmentObject(app)
|
|
.frame(width: 560, height: 520)
|
|
}
|
|
}
|
|
}
|
|
|
|
/// Runs launch-time wiring (hotkeys, permissions, license validation).
|
|
final class AppDelegate: NSObject, NSApplicationDelegate {
|
|
func applicationDidFinishLaunching(_ notification: Notification) {
|
|
AppState.shared.start()
|
|
}
|
|
}
|