Skip to content

Open source CapCut alternative.

TypeScript

fix(app): open the permission setup window only when a task needs it [rebuild]

David Lef87118392e6e
diff --git a/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift b/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift
index df74bdcb..1740619b 100644
--- a/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift
+++ b/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift
@@ -13,7 +13,6 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {
private var authCoordinator: DonkeyAuthCoordinator?
private var onboardingWindowController: OnboardingWindowController?
private var permissionSetupController: MacPermissionSetupWindowController?
- private var manualPermissionSetupController: MacPermissionSetupWindowController?
private var overlayController: UserQueryOverlayController?
private var uiUnderstandingCoordinator: UIUnderstandingCoordinator?
/// Mirrors the auth coordinator's session phase into the overlay's `needsLogin`, so the notch
@@ -98,8 +97,6 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {
) -> Bool {
if authCoordinator?.isAuthenticated != true {
presentOnboardingCard(entry: .signIn)
- } else if let permissionSetupController {
- permissionSetupController.showSetup()
} else if overlayController == nil {
startAuthenticatedAppSurfaces()
}
@@ -182,25 +179,15 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {
}
private func startAuthenticatedAppSurfaces() {
- guard overlayController == nil,
- permissionSetupController == nil
- else { return }
+ guard overlayController == nil else { return }
onboardingWindowController?.close()
NSApp.setActivationPolicy(.regular)
- // The notch overlay renders immediately on launch, so it's always present. When permissions
- // still need granting, the setup window opens alongside the notch rather than gating it.
+ // Launch never opens the permission setup window: many users install Donkey only for Cut and
+ // need none of these grants. A task that needs a permission asks in the notch mid-conversation
+ // (the harness permission gate), and the window stays reachable via the Permissions Setup menu.
startOverlaySurfaces()
-
- let permissionSetupController = MacPermissionSetupWindowController()
- guard !permissionSetupController.permissionsAreReady else { return }
-
- self.permissionSetupController = permissionSetupController
- permissionSetupController.completed = { [weak self] in
- self?.permissionSetupController = nil
- }
- permissionSetupController.showSetup()
}
private func startOverlaySurfaces() {
@@ -427,14 +414,13 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {
// MARK: - Permissions setup
- /// Reopens the Accessibility / screenshot / microphone permission walkthrough on demand. Uses a
- /// dedicated retain so it never collides with the launch-time `permissionSetupController`, which the
- /// startup state machine keys off of.
+ /// Opens the Accessibility / screenshot / microphone permission walkthrough on demand — the only
+ /// way this window appears besides a task's in-notch permission request.
@objc private func permissionsSetupMenuAction(_ sender: Any?) {
let controller = MacPermissionSetupWindowController()
- manualPermissionSetupController = controller
+ permissionSetupController = controller
controller.completed = { [weak self] in
- self?.manualPermissionSetupController = nil
+ self?.permissionSetupController = nil
}
controller.showSetup()
}
@@ -457,7 +443,6 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {
uiUnderstandingCoordinator = nil
overlayController?.stop()
overlayController = nil
- permissionSetupController = nil
}
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
diff --git a/apps/Donkey/Sources/Donkey/MacPermissionSetupWindowController.swift b/apps/Donkey/Sources/Donkey/MacPermissionSetupWindowController.swift
index 7889f8ab..1d40a18b 100644
--- a/apps/Donkey/Sources/Donkey/MacPermissionSetupWindowController.swift
+++ b/apps/Donkey/Sources/Donkey/MacPermissionSetupWindowController.swift
@@ -42,11 +42,6 @@ final class MacPermissionSetupWindowController: NSWindowController, NSWindowDele
completed?()
}
- var permissionsAreReady: Bool {
- model.refresh()
- return model.canContinue
- }
-
func showSetup() {
model.refresh()
showWindow(nil)
diff --git a/docs/guides/install-donkey.md b/docs/guides/install-donkey.md
index ddfa8f96..5804300f 100644
--- a/docs/guides/install-donkey.md
+++ b/docs/guides/install-donkey.md
@@ -101,11 +101,12 @@ backend, which owns provider credentials, provider selection, and concrete
model selection. The Mac client sends typed requests to the backend and needs
no OpenAI, Gemini, or other provider API keys.
-First launch is therefore an account and permission setup flow, not a local
-model installer. After sign-in, Donkey asks for Accessibility, Screenshots,
-and Microphone with user-visible reasons before starting the overlay.
-Protected folders such as Desktop, Documents, and Downloads remain lazy and
-are requested only when a user-requested local-item lookup needs them. There
+First launch is therefore an account setup flow, not a local model installer.
+macOS permissions (Accessibility, Screenshots, Microphone) are requested only
+when a task first needs one, through the in-notch permission gate; the
+Permissions Setup menu opens the full walkthrough on demand. Protected folders
+such as Desktop, Documents, and Downloads remain lazy and are requested only
+when a user-requested local-item lookup needs them. There
are no supported release manifest URLs, model weight override URLs, local LLM
packages, or local model repair steps in the hosted-model install path.