Phase 2.5: extract LaunchAtLoginService protocol seam - #45
Merged
Conversation
Second platform seam (after SecretStore). AppState referenced the concrete LaunchAtLogin (SMAppService wrapper) at four sites, and SettingsView at two. - LaunchAtLoginService protocol (isEnabled / requiresApproval / setEnabled / openSettings). LaunchAtLogin: enum-of-statics -> final class conforming to it; the Apple-only ServiceManagement/AppKit calls stay isolated there. - The branchy toggle re-sync (reconcile applied vs. real system state, decide whether to surface the approval message) moved out of the didSet into a pure, Foundation-only LaunchAtLoginReconciler in OpenWhispCore, so the actual decision logic is unit-tested. - AppState injects launchAtLoginService via init(... = LaunchAtLogin()); didSet and the init read route through it. SettingsView routes through appState.launchAtLoginService. Behavior unchanged on macOS. - Tests: +6 LaunchAtLoginReconcilerTests (success, blocked-needing-approval, applied-failed, diverged+approval, no-nag-when-matched). 98 -> 104. - ROADMAP: mark LaunchAtLoginService done under Phase 2.5. swift test 104/104; ./build.sh clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 23, 2026
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.
Second platform seam (after
SecretStore, #44).AppStatereferenced the concreteLaunchAtLoginat four sites andSettingsViewat two; this puts it behind a protocol and extracts the decision logic.Changes
LaunchAtLoginServiceprotocol (isEnabled/requiresApproval/setEnabled/openSettings).LaunchAtLogin:enumof statics →final classconforming to it. The Apple-onlyServiceManagement/AppKitcalls stay isolated there.LaunchAtLoginReconciler— the branchy toggle re-sync (reconcile what was applied vs. the real system state, decide whether to show the approval message) moved out of thedidSetinto a pure, Foundation-only type inOpenWhispCore, so the actual decision is unit-tested.AppStateinjectslaunchAtLoginServiceviainit(… = LaunchAtLogin()); thedidSetand init read route through it.SettingsViewroutes throughappState.launchAtLoginService. No behavior change on macOS.LaunchAtLoginReconcilerTests(success, blocked-needing-approval, applied-failed, diverged+approval, no-nag-when-already-matched). 98 → 104.swift test104/104 ·./build.shclean.🤖 Generated with Claude Code