Repository navigation
Add a first-run setup wizard - #93
Merged
Merged
Conversation
Walks through the hotkey (and the Spotlight conflict), launch at login, and terminal programs, asking for Automation access to Terminal or iTerm2 up front. Shown once when opened as an app, never from a shell, a pipe or under XCTest; Run Setup Again in the menu bar menu reopens it.
As an accessory app, a window that slipped behind others couldn't be found again. While Setup or Settings is open the app becomes a regular app with its icon in the Dock and the app switcher; clicking the Dock icon brings the window back. Closing the last one, by any means, returns to accessory and hands focus back to the previous app. Cmd-W now closes the setup window.
Owner
Author
|
Pushed 5f81840: while Setup or Settings is open the app is a regular app (Dock icon + ⌘Tab); clicking the Dock icon brings that window back. Closing by any path (Get Started, Esc on the last page, close button, ⌘W) returns to accessory and re-activates the previously frontmost app. Policy switching is behind |
On macOS 14+ the cooperative activate() was refused after switching to a regular app, so the window opened behind the frontmost app and never became key. Activate with the older call, and do it again on the next run loop turn once the new activation policy has taken effect. Dock presence tests move to their own file.
Existing installs are recognised by settings an earlier version wrote and the setup is marked as seen, so it only opens by itself for new installs. The setup view edits the same command settings its model checks, and closing Setup or Settings returns to the app that was active last rather than the one active when the window opened.
Store onboarding.completed = false when the wizard opens on first run, so the next launch isn't mistaken for an upgrade.
# Conflicts: # dmenu-mac.xcodeproj/project.pbxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small step-by-step window shown the first time dmenu-mac is opened as an app, so macOS prompts don't pop up later mid-use.
LaunchAtLogin.Toggleas Settings).CommandSettingsModel). For Terminal and iTerm2, whichTerminalLauncherscripts with Apple Events, a Grant Access button asks for Automation consent now viaAEDeterminePermissionToAutomateTargeton a background queue, launching the terminal hidden first if needed since TCC only answers for a running target. Shows granted / denied / not determined; when denied it links to Privacy & Security → Automation.Every step is skippable; Enter continues, Esc skips (and closes on the last page). Finishing or closing the window stores
onboarding.completed. Run Setup Again… in the menu bar menu reopens it.Shown only when launched by LaunchServices (parent is launchd), not with
--exit, not when reading a pipe, and never under XCTest.Permissions: only Automation (Apple Events) is covered, because it is the only TCC-protected API the app uses (
NSAppleScriptinTerminalLauncher). The entitlement andNSAppleEventsUsageDescriptionwere already in place. No Accessibility, Full Disk Access or App Management.New code is in new files (
Onboarding.swift,AutomationPermissions.swift,OnboardingView.swift);AppDelegategets one call and one menu item.Testing
OnboardingTests: gating (first launch, completed, shell,--exit, pipe, XCTest), completion persistence, step navigation, Automation logic through a mockAutomationPermissions(no real TCC), OSStatus mapping, and a check thatusesAppleEventsmatchesTerminalLauncher's plans.swiftlint --strictis clean.🤖 Generated with Claude Code