From 9979639804e2421aec23bef7ab7d5d8ec4231f94 Mon Sep 17 00:00:00 2001 From: Valdemar Lorenzen Date: Fri, 16 Oct 2026 15:06:20 +0200 Subject: [PATCH] perf: reduce launcher presentation latency --- README.md | 2 ++ Sources/Conjure/ConjureApp.swift | 9 +++++++-- Sources/Conjure/LauncherWindowController.swift | 1 + TODO.md | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee8d18c..38d3076 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Conjure searches the system and user Applications folders. Hover over a result t Conjure runs without a Dock icon. Dismissing the launcher leaves it running; reopen it from Finder or use your configured global shortcut. +The launcher opens without a window animation; Settings is constructed only when needed, not before the launcher appears. + ### Controls | Action | Control | diff --git a/Sources/Conjure/ConjureApp.swift b/Sources/Conjure/ConjureApp.swift index 2681e81..e8c6a3f 100644 --- a/Sources/Conjure/ConjureApp.swift +++ b/Sources/Conjure/ConjureApp.swift @@ -98,7 +98,13 @@ private final class ApplicationDelegate: NSObject, NSApplicationDelegate { case .command(let command): self?.launcher.toggle(command: command) } } - private lazy var settings = SettingsWindowController(shortcuts: shortcuts) + private lazy var settings = makeSettings() + + private func makeSettings() -> SettingsWindowController { + let controller = SettingsWindowController(shortcuts: shortcuts) + controller.retryUninstallRecovery = { [uninstaller] in await uninstaller.recover() } + return controller + } private var startupShortcutError: String? private var startupRecoveryMessage: String? @@ -117,7 +123,6 @@ private final class ApplicationDelegate: NSObject, NSApplicationDelegate { quitItem.target = NSApplication.shared launcher.window?.contentView?.menu = menu let loginLaunch = isLoginLaunch - settings.retryUninstallRecovery = { [uninstaller] in await uninstaller.recover() } Task { let report = await uninstaller.recover() guard !report.messages.isEmpty else { return } diff --git a/Sources/Conjure/LauncherWindowController.swift b/Sources/Conjure/LauncherWindowController.swift index 2171244..c461544 100644 --- a/Sources/Conjure/LauncherWindowController.swift +++ b/Sources/Conjure/LauncherWindowController.swift @@ -58,6 +58,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe defer: false ) window.title = "Conjure" + window.animationBehavior = .none window.appearance = NSAppearance(named: .darkAqua) window.backgroundColor = .clear window.isOpaque = false diff --git a/TODO.md b/TODO.md index 0d43de4..3a013b2 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,4 @@ -- [ ] conjure should pop up quicker when launching than it currently does. +- [x] conjure should pop up quicker when launching than it currently does. - [ ] conjure emoji selector should have an extra action (default) that both copies and tries to paste the selected emoji into the application that was focused when the conjure window was spawned. - [ ] add a notes app inspired by raycast notes - [ ] improve on the conjure translation command \ No newline at end of file