Skip to content

refactor(desktop): centralize preference keys in AppPreferences - #20

Open
Aforno wants to merge 3 commits into
mainfrom
t3code/refactor-the-app
Open

refactor(desktop): centralize preference keys in AppPreferences#20
Aforno wants to merge 3 commits into
mainfrom
t3code/refactor-the-app

Conversation

@Aforno

@Aforno Aforno commented Aug 29, 2026

Copy link
Copy Markdown
Owner

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 AppPreferences and switches every call site, including @AppStorage, to AppPreferences.Key.

The stored key strings are unchanged. Existing settings keep working.

While touching the reply path, unused AgentReply.content and isDeny come out. Claude elicitation mapping now matches what the notch UI actually sends: cancel stays cancel, every other decision is decline. The old accept + content branch was only reachable from reply.sock clients that attached content, and the tests now assert that path is gone.

Verification

  • swift test
  • swift test -c release
  • ./script/package_release.sh --adhoc
  • ./script/check_repository.sh
  • Packaged-app UI/runtime smoke test, when applicable

Compatibility and risk

No UserDefaults migration. Key names and registered defaults match the previous AppDelegate table, so persistence is stable.

Provider-hook change: Claude Elicitation hook output no longer emits action: accept or a content object. Allow, deny, and option all map to decline. 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.

- Own UserDefaults and AppStorage keys in one type
- Drop unused AgentReply.content and Claude elicitation accept
Copilot AI lite review requested due to automatic review settings August 29, 2026 16:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Aforno added 2 commits August 29, 2026 18:22
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants