Skip to content

Rename all app UserDefaults keys to the cotabby prefix#238

Merged
FuJacob merged 1 commit into
mainfrom
chore/cotabby-userdefaults-keys
May 25, 2026
Merged

Rename all app UserDefaults keys to the cotabby prefix#238
FuJacob merged 1 commit into
mainfrom
chore/cotabby-userdefaults-keys

Conversation

@FuJacob
Copy link
Copy Markdown
Owner

@FuJacob FuJacob commented May 25, 2026

Summary

Renames every app-owned UserDefaults key to a cotabby* prefix for consistency with the project rename. Covers the 14 already-prefixed tabby* keys plus the previously unprefixed selectedSuggestionEngine, selectedSuggestionWordCountPreset, onboardingCompleted, totalTabAcceptedWordCount, and selectedRuntimeModelFilename.

Only the key string literals change; the Swift identifiers are untouched.

Validation

xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build
# ** BUILD SUCCEEDED **
grep -rn '"tabby' Cotabby/   # no app key literals remain

Linked issues

None.

Risk / rollout notes

  • Intentionally drops backward compatibility. Existing users' stored settings (engine choice, word-count, name, keybinds, onboarding-complete flag, accepted-word counter, selected model) reset to defaults on the first launch after upgrade. This was a deliberate decision over carrying a permanent migration shim for the old names.
  • No migration code is included by design. If we later decide the reset is too aggressive, a one-time read-old/write-new shim could be added, but that is explicitly out of scope here.

Greptile Summary

This PR renames every app-owned UserDefaults key from the old tabby*/unprefixed naming to a uniform cotabby* prefix, covering 19 keys spread across four Swift files. The PR explicitly accepts the one-time settings reset for existing users and documents that no migration shim is included.

  • All 16 keys in SuggestionSettingsModel, plus the four keys in SuggestionCoordinator, WelcomeCoordinator, and RuntimeBootstrapModel, are consistently renamed; logic, persistence patterns, and Swift identifiers are untouched.
  • The project.pbxproj diff includes test-file reference reordering (Xcode cosmetic churn) and an unexplained deletion of the LlamaSwift in Frameworks build-file entry, which is outside the stated scope of this PR and deserves explicit confirmation.

Confidence Score: 3/5

The key-rename changes themselves are clean and consistent, but the project file deletes a LlamaSwift framework entry that is unrelated to the stated scope and needs explicit confirmation before merging.

The Swift changes are mechanical and correct — every key literal is updated, persistence and read logic are unchanged, and the intentional settings reset is clearly documented. The concern is in project.pbxproj: the LlamaSwift in Frameworks build-file entry is removed without explanation. If LlamaSwift is still imported anywhere in the main target, this deletion would produce a linker failure that only surfaces at link time, not during a source-only build step. The PR reports a build success, which is encouraging, but the mismatch between the stated scope and the actual diff warrants a closer look before merging.

Cotabby.xcodeproj/project.pbxproj — the LlamaSwift framework deletion should be confirmed as intentional.

Important Files Changed

Filename Overview
Cotabby.xcodeproj/project.pbxproj Reorders test file references (cosmetic) but also removes the LlamaSwift PBXBuildFile entry without explanation — unrelated to the stated key-rename scope.
Cotabby/Models/SuggestionSettingsModel.swift Renames all 16 UserDefaults key strings from tabby*/unprefixed to cotabby*; logic and persistence patterns unchanged.
Cotabby/App/Coordinators/SuggestionCoordinator.swift Renames totalTabAcceptedWordCount key to cotabbyTotalAcceptedWordCount; no logic changes.
Cotabby/App/Coordinators/WelcomeCoordinator.swift Renames onboardingCompleted key to cotabbyOnboardingCompleted; no logic changes.
Cotabby/Models/RuntimeBootstrapModel.swift Renames selectedRuntimeModelFilename key to cotabbySelectedModelFilename; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[App Launch] --> B{UserDefaults key exists?}
    B -- "Old tabby* / unprefixed key (pre-PR)" --> C[Key not found → use default]
    B -- "New cotabby* key (post-PR)" --> D[Read persisted value]
    C --> E[Write default to new cotabby* key]
    D --> F[Use stored value]

    subgraph Renamed Keys
        K1["tabbyGloballyEnabled → cotabbyGloballyEnabled"]
        K2["selectedSuggestionEngine → cotabbySelectedEngine"]
        K3["onboardingCompleted → cotabbyOnboardingCompleted"]
        K4["totalTabAcceptedWordCount → cotabbyTotalAcceptedWordCount"]
        K5["selectedRuntimeModelFilename → cotabbySelectedModelFilename"]
        K6["tabby* × 14 → cotabby* × 14"]
    end
Loading

Fix All in Codex Fix All in Claude Code

Reviews (1): Last reviewed commit: "Rename all app UserDefaults keys to the ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Follows the project rename for full consistency: every app-owned key now
uses a cotabby* prefix, including the previously unprefixed engine,
word-count, onboarding, accepted-word-count, and selected-model keys.

This intentionally drops backward compatibility — existing users' stored
settings reset to defaults on first launch after upgrade. We accept that
over carrying a permanent migration shim for the old tabby* names.
Comment on lines 11 to 13
194B33B52FC3F33B00DF6F60 /* Logging in Frameworks */ = {isa = PBXBuildFile; productRef = 194B33B42FC3F33B00DF6F60 /* Logging */; };
19E177EA2FC1B7890067E267 /* CotabbyInference in Frameworks */ = {isa = PBXBuildFile; productRef = 19E177E92FC1B7890067E267 /* CotabbyInference */; };
8B6282F0C1CCA0746D96B914 /* DownloadOutcomeClassifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562F89255AF340C15A0554BE /* DownloadOutcomeClassifierTests.swift */; };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Unrelated LlamaSwift framework removal

The PBXBuildFile entry for LlamaSwift in Frameworks (A1C3E0012F90000100AAA001) is dropped here with no corresponding re-addition anywhere in the diff, and the PR description says "only the key string literals change." The test-file reference moves (ClipboardRelevanceFilterTests, ClipboardContentDistillerTests) are just Xcode sort-order churn, but this LlamaSwift entry is a genuine deletion. If this was intentional (e.g., superseded by CotabbyInference), it should be noted in the PR description so reviewers can verify the build still links correctly against anything that previously depended on it.

Fix in Codex Fix in Claude Code

@FuJacob FuJacob merged commit 8fec23d into main May 25, 2026
3 checks passed
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.

1 participant