Refactor settings into product domains#799
Merged
Merged
Conversation
FuJacob
force-pushed
the
codex/safe-decomposition
branch
from
July 18, 2026 03:01
a35450d to
ee74ba4
Compare
FuJacob
force-pushed
the
codex/settings-domains
branch
from
July 18, 2026 03:06
7a0bad7 to
9c15593
Compare
FuJacob
marked this pull request as ready for review
July 18, 2026 03:10
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
Group Cotabby's durable suggestion settings into subsystem-owned domain values while preserving the existing SwiftUI properties, generation snapshot, and flat persistence keys. This gives future work cohesive settings boundaries without making a migration part of the refactor.
This is the third PR in the repository-organization stack and is based on #798.
Validation
swiftlint lint --strict— 0 violations.xcodegen generate— succeeded and the generated project is committed.xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build-for-testing -derivedDataPath build/DerivedData— TEST BUILD SUCCEEDED.SuggestionSettingsDataproperties remain as bidirectional forwarding accessors.Linked issues
None.
Risk / rollout notes
No UserDefaults or Keychain key changes are included.
SuggestionSettingsSnapshotretains its existing shape and the observable model retains its individual@Publishedproperties, so this should not alter persistence, observation timing, or generation behavior.Greptile Summary
This PR restructures the flat
SuggestionSettingsDatastruct into eight cohesive domain sub-structs (SuggestionGeneralSettings,SuggestionEngineSettings,SuggestionCompletionSettings,SuggestionContextSettings,SuggestionCorrectionSettings,SuggestionPresentationSettings,SuggestionInlineFeatureSettings,SuggestionShortcutSettings) while keeping all 61 original flat properties as bidirectional forwarding computed properties for backward compatibility. Persistence keys,@Publishedproperties on the model, andSuggestionSettingsSnapshotshape are all unchanged.SuggestionSettingsData.swift: Replaces the single flat struct with eight domain sub-structs plus a compatibility extension that re-exposes every prior property through a forwarding getter/setter pair.SuggestionSettingsModel.swift: Adds adomainSettingscomputed property that assemblesSuggestionSettingsDatafrom the existing@Publishedproperties, and refactorssnapshotto go throughdomainSettingsrather than reading individual properties directly.SuggestionSettingsStore.swiftandSuggestionSettingsDomainTests.swift: Construction ofSuggestionSettingsDatain the store updated to use the new nested initialiser; new test file covers domain grouping, flat-accessor round-trips, and model projection.Confidence Score: 5/5
Safe to merge — purely structural reorganization with no persistence, observation timing, or generation behavior changes.
All 61 flat forwarding accessors are correctly bidirectional, the snapshot computation is semantically identical to before, and UserDefaults keys are untouched. The snapshotPublisher still reads @published properties directly so reactive emission paths are unaffected. New tests cover store-load grouping, flat/domain round-trips, and model projection.
No files require special attention — all changed files are consistent with each other and with the stated refactoring goals.
Important Files Changed
Class Diagram
%%{init: {'theme': 'neutral'}}%% classDiagram class SuggestionSettingsData { +var general: SuggestionGeneralSettings +var engine: SuggestionEngineSettings +var completion: SuggestionCompletionSettings +var context: SuggestionContextSettings +var correction: SuggestionCorrectionSettings +var presentation: SuggestionPresentationSettings +var inlineFeatures: SuggestionInlineFeatureSettings +var shortcuts: SuggestionShortcutSettings +61 total forwarding accessors } class SuggestionGeneralSettings { +isGloballyEnabled: Bool +pauseState: SuggestionPauseState? +disabledAppRules: [DisabledApplicationRule] +suggestInIntegratedTerminals: Bool +isPerformanceTrackingEnabled: Bool } class SuggestionShortcutSettings { +acceptance: SuggestionShortcutBindingSettings +fullAcceptance: SuggestionShortcutBindingSettings +globalToggle: SuggestionShortcutBindingSettings } class SuggestionShortcutBindingSettings { +keyCode: CGKeyCode +modifiers: ShortcutModifierMask +label: String } class SuggestionSettingsModel { +61 @Published properties +domainSettings: SuggestionSettingsData +snapshot: SuggestionSettingsSnapshot } class SuggestionSettingsStore { +load(configuration) SuggestionSettingsData } SuggestionSettingsData *-- SuggestionGeneralSettings SuggestionSettingsData *-- SuggestionShortcutSettings SuggestionShortcutSettings *-- SuggestionShortcutBindingSettings SuggestionSettingsModel ..> SuggestionSettingsData : domainSettings projection SuggestionSettingsStore ..> SuggestionSettingsData : constructs on load%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% classDiagram class SuggestionSettingsData { +var general: SuggestionGeneralSettings +var engine: SuggestionEngineSettings +var completion: SuggestionCompletionSettings +var context: SuggestionContextSettings +var correction: SuggestionCorrectionSettings +var presentation: SuggestionPresentationSettings +var inlineFeatures: SuggestionInlineFeatureSettings +var shortcuts: SuggestionShortcutSettings +61 total forwarding accessors } class SuggestionGeneralSettings { +isGloballyEnabled: Bool +pauseState: SuggestionPauseState? +disabledAppRules: [DisabledApplicationRule] +suggestInIntegratedTerminals: Bool +isPerformanceTrackingEnabled: Bool } class SuggestionShortcutSettings { +acceptance: SuggestionShortcutBindingSettings +fullAcceptance: SuggestionShortcutBindingSettings +globalToggle: SuggestionShortcutBindingSettings } class SuggestionShortcutBindingSettings { +keyCode: CGKeyCode +modifiers: ShortcutModifierMask +label: String } class SuggestionSettingsModel { +61 @Published properties +domainSettings: SuggestionSettingsData +snapshot: SuggestionSettingsSnapshot } class SuggestionSettingsStore { +load(configuration) SuggestionSettingsData } SuggestionSettingsData *-- SuggestionGeneralSettings SuggestionSettingsData *-- SuggestionShortcutSettings SuggestionShortcutSettings *-- SuggestionShortcutBindingSettings SuggestionSettingsModel ..> SuggestionSettingsData : domainSettings projection SuggestionSettingsStore ..> SuggestionSettingsData : constructs on loadReviews (1): Last reviewed commit: "refactor: group settings by product doma..." | Re-trigger Greptile