From c5c026fc968d3108f218186173ea051c95cc6808 Mon Sep 17 00:00:00 2001 From: Brian Cantoni Date: Tue, 16 Jun 2026 13:13:01 -0700 Subject: [PATCH] Fix dark/light mode appearance across app restarts This is a potential fix for issue #1491 where manually setting the dark/light mode appearance does not 'stick' across app restarts. Claude Code analyzed the problem and created the fix here to move `NSApp.appearance` setup to `applicationWillFinishLaunching`, **before** `warmUp()` and before macOS can restore any windows: --- MarkEditMac/Sources/Main/Application/AppDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MarkEditMac/Sources/Main/Application/AppDelegate.swift b/MarkEditMac/Sources/Main/Application/AppDelegate.swift index c2d6ae0a2..b4f9995fb 100644 --- a/MarkEditMac/Sources/Main/Application/AppDelegate.swift +++ b/MarkEditMac/Sources/Main/Application/AppDelegate.swift @@ -56,11 +56,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate { private var settingsWindowController: NSWindowController? func applicationWillFinishLaunching(_ notification: Notification) { + NSApp.appearance = AppPreferences.General.appearance.resolved() EditorPreloader.shared.warmUp() } func applicationDidFinishLaunching(_ notification: Notification) { - NSApp.appearance = AppPreferences.General.appearance.resolved() appearanceObservation = NSApp.observe(\.effectiveAppearance) { _, _ in Task { @MainActor in AppTheme.current.updateAppearance()