From 83cb12eddc3f07b6802a17aed532668c6f2febab Mon Sep 17 00:00:00 2001 From: TZGyn Date: Sat, 26 Sep 2026 23:39:20 +0800 Subject: [PATCH] Request Accessibility at launch so the tray can populate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Menu Bar section silently stayed empty because nothing prompted for Accessibility permission until a button inside the panel was clicked, so the app looked inert. Prompt once on first launch instead. 💘 Generated with Crush Assisted-by: Crush:deepseek-v4.1-flash --- Sources/SimpleTopBar/App.swift | 9 +++++++++ build-app.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Sources/SimpleTopBar/App.swift b/Sources/SimpleTopBar/App.swift index 66122f9..5163862 100644 --- a/Sources/SimpleTopBar/App.swift +++ b/Sources/SimpleTopBar/App.swift @@ -37,6 +37,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate { AppListModel.shared.start() MenuBarItemManager.shared.start() MenuBarHider.shared.prepare() + + // The tray is empty without Accessibility permission, so surface the + // system prompt once at launch instead of waiting for the user to + // open the panel and find the button. + if !AccessibilityPermission.isGranted, + !UserDefaults.standard.bool(forKey: "didRequestAccessibility") { + UserDefaults.standard.set(true, forKey: "didRequestAccessibility") + AccessibilityPermission.request() + } } func applicationWillTerminate(_ notification: Notification) { diff --git a/build-app.sh b/build-app.sh index 9b78905..9eb7da7 100755 --- a/build-app.sh +++ b/build-app.sh @@ -2,7 +2,7 @@ set -euo pipefail cd "$(dirname "$0")" -VERSION="${1:-0.2.0}" +VERSION="${1:-0.2.1}" swift build -c release