refactor(desktop): centralize preference keys in AppPreferences - #20
Open
Aforno wants to merge 3 commits into
Open
refactor(desktop): centralize preference keys in AppPreferences#20Aforno wants to merge 3 commits into
Aforno wants to merge 3 commits into
Conversation
- Own UserDefaults and AppStorage keys in one type - Drop unused AgentReply.content and Claude elicitation accept
- Drop doc comments that restate types, cases, and obvious locals - Keep comments that still explain non-obvious constraints
# Conflicts: # Sources/AgentsNotch/App/AgentsNotchApp.swift # Sources/AgentsNotch/Services/AgentNotificationService.swift # Sources/AgentsNotch/UI/Onboarding/OnboardingView.swift
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.
Summary
Preference names were string literals in AppDelegate, Settings, notifications, Sparkle, the notch panel, and a handful of views. A typo would silently miss the registered default. This PR puts the UserDefaults names and launch defaults in
AppPreferencesand switches every call site, including@AppStorage, toAppPreferences.Key.The stored key strings are unchanged. Existing settings keep working.
While touching the reply path, unused
AgentReply.contentandisDenycome out. Claude elicitation mapping now matches what the notch UI actually sends: cancel stays cancel, every other decision is decline. The oldaccept+contentbranch was only reachable from reply.sock clients that attachedcontent, and the tests now assert that path is gone.Verification
swift testswift test -c release./script/package_release.sh --adhoc./script/check_repository.shCompatibility and risk
No UserDefaults migration. Key names and registered defaults match the previous AppDelegate table, so persistence is stable.
Provider-hook change: Claude
Elicitationhook output no longer emitsaction: acceptor acontentobject. Allow, deny, and option all map todecline. Cancel is unchanged. reply.sock clients that relied on accept-with-content will now decline instead.No signing or Sparkle protocol changes beyond reading the same automatic-update key through
AppPreferences.Screenshots
Not applicable.