Skip to content

Force all users back to the default indicator icon#343

Merged
FuJacob merged 1 commit into
mainfrom
chore/remove-custom-indicator-icon
May 28, 2026
Merged

Force all users back to the default indicator icon#343
FuJacob merged 1 commit into
mainfrom
chore/remove-custom-indicator-icon

Conversation

@FuJacob
Copy link
Copy Markdown
Owner

@FuJacob FuJacob commented May 28, 2026

Summary

Follow-up to #338. That PR hid the Settings UI for changing the indicator icon, but anyone who had picked a custom image in a previous build still saw it at runtime, because the persisted PNG and the loader were left intact. This PR removes the feature end-to-end and scrubs the saved blob on launch so the default cat is what everyone sees from now on.

Validation

  • swiftlint lint --quiet → exit 0
  • xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build → ** BUILD SUCCEEDED **
  • xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build-for-testing → ** TEST BUILD SUCCEEDED **
  • xcodegen generate (Cotabby.xcodeproj regenerated after deleting source + test file)

Linked issues

Refs #338.

Risk / rollout notes

  • One-way migration: the cotabbyCustomIndicatorImageData UserDefaults entry is removed on launch. Users who liked their custom icon lose it. That's the explicit intent.
  • Project file is regenerated by xcodegen generate because two source files were deleted (IndicatorIconImageProcessor.swift and its test). No project.yml changes were needed.

Greptile Summary

This PR completes the removal of the custom indicator icon feature by cleaning up the backend after the previous PR hid the Settings UI. It deletes IndicatorIconImageProcessor.swift and its tests, removes the customIndicatorImage property and all related persistence and mutation methods from SuggestionSettingsModel, and simplifies FieldEdgeIconIndicatorView to always render the default cat icon.

  • A one-way migration runs unconditionally in SuggestionSettingsModel.init(), removing the previously-persisted PNG blob from UserDefaults on every launch so users who had picked a custom icon are automatically reset to the default.
  • All call sites (AppDelegate, ActivationIndicatorController) are updated to drop the removed customImage parameter, and dead AppKit imports in the model and view are cleaned up.

Confidence Score: 5/5

Safe to merge — the change is a clean, complete feature removal with no remaining references to the deleted code.

Every layer of the removed feature is addressed: the processor, its tests, the model property and methods, the view parameter, the call site in AppDelegate, and the project file. The UserDefaults migration is idempotent and runs on every launch, so no user running an older build is left with a stale blob. No logic was rewritten — only deleted — which keeps the risk surface small.

No files require special attention.

Important Files Changed

Filename Overview
Cotabby/Models/SuggestionSettingsModel.swift Removes customIndicatorImage @published property, all related methods, the UserDefaults key constant, and the AppKit import. Adds an idempotent migration in init() that removes the persisted PNG blob on every launch.
Cotabby/UI/FieldEdgeIconIndicatorView.swift Strips the optional customImage parameter and all conditional branches; now unconditionally renders the dark rounded-chip with the built-in cat glyph.
Cotabby/Services/UI/ActivationIndicatorController.swift Removes the customImage parameter from show() and always constructs FieldEdgeIconIndicatorView() without arguments.
Cotabby/App/Core/AppDelegate.swift Removes the customImage argument from the show() call; straightforward call-site cleanup.
Cotabby/Support/IndicatorIconImageProcessor.swift File deleted in its entirety.
CotabbyTests/IndicatorIconImageProcessorTests.swift Test file deleted alongside the source it tested.
Cotabby.xcodeproj/project.pbxproj Four entries removed for the deleted source and test files; regenerated by xcodegen.

Sequence Diagram

sequenceDiagram
    participant App as App Launch
    participant SSM as SuggestionSettingsModel.init()
    participant UD as UserDefaults
    participant AD as AppDelegate
    participant AIC as ActivationIndicatorController
    participant View as FieldEdgeIconIndicatorView

    App->>SSM: init(configuration:userDefaults:)
    SSM->>UD: resolve all settings
    SSM->>UD: persist resolved settings
    SSM->>UD: removeObject(cotabbyCustomIndicatorImageData) migration
    Note over UD: persisted PNG blob deleted (one-way)

    App->>AD: focusedFieldChanged(context:)
    AD->>AIC: show(enabled:caretRect:inputFrameRect:)
    Note over AD: customImage parameter removed
    AIC->>View: FieldEdgeIconIndicatorView()
    Note over View: Always renders default cat icon
    View-->>AIC: dark chip + cat glyph
Loading

Reviews (1): Last reviewed commit: "Force all users back to the default indi..." | Re-trigger Greptile

PR #338 removed the Settings UI for picking a custom indicator icon
but left the persisted PNG and the loader behind, so anyone who had
chosen a custom image in a previous build was still seeing it with no
way to revert. Rip out the feature end-to-end and scrub the saved
blob on launch so the default cat is what everyone sees now.

Removes the customIndicatorImage property, its setter/clearer, the
PNG loader, and the IndicatorIconImageProcessor support + tests; the
indicator view and ActivationIndicatorController shed their no-longer-
needed customImage parameters. SuggestionSettingsModel's init now
deletes the cotabbyCustomIndicatorImageData UserDefaults entry so
the storage doesn't linger.
@FuJacob FuJacob merged commit da1bf60 into main May 28, 2026
4 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