Skip to content

feat: add optional AI app history cleanup#83

Merged
momenbasel merged 1 commit into
momenbasel:mainfrom
brainx:feat/ai-history-cleanup-v2
May 14, 2026
Merged

feat: add optional AI app history cleanup#83
momenbasel merged 1 commit into
momenbasel:mainfrom
brainx:feat/ai-history-cleanup-v2

Conversation

@brainx
Copy link
Copy Markdown
Contributor

@brainx brainx commented Apr 30, 2026

Summary

Follow-up to #20 that adds optional local history cleanup for known local AI apps in the AI Apps category.

Why

Ollama and LM Studio can store prompt or conversation history separately from logs and caches. That history can contain sensitive user content, so it should be visible for inspection but never cleaned automatically.

This keeps AI Apps cleanup useful while preserving explicit user consent for history removal.

Scope

Included optional history targets:

  • ~/.ollama/history for Ollama CLI prompt history
  • ~/.lmstudio/conversations for LM Studio conversations

These items are surfaced as optional entries and are unselected by default.

Still excluded from cleanup:

  • ~/.ollama/models
  • ~/.lmstudio/models

Implementation

  • wires the AI Apps category into the current scanner model
  • adds optional Ollama and LM Studio history targets using conservative, exact paths
  • keeps optional history unselected by default, including Clean All and scheduled auto-clean flows
  • clears stale scheduled-scan results before auto-clean so only freshly scanned scheduled categories can be cleaned
  • avoids double-counting by keeping Ollama cache roots out of the generic User Cache pass
  • updates README and localized README/category descriptions

Validation

  • built locally with xcodebuild -project PureMac.xcodeproj -scheme PureMac -configuration Debug -derivedDataPath build CODE_SIGNING_ALLOWED=NO build
  • launched the built macOS app and confirmed it runs

Notes

  • Existing Swift 6 warnings around Logger.shared still appear during build and predate this PR.
  • Manual verification on a machine with Ollama and LM Studio history files present would still be useful.

@momenbasel momenbasel merged commit 0d7e108 into momenbasel:main May 14, 2026
1 check passed
edufalcao added a commit to edufalcao/PureMac that referenced this pull request May 18, 2026
…y guard

Rebases PR momenbasel#76 onto upstream/main (post momenbasel#70 Arabic, momenbasel#75 FDA TCC, momenbasel#80
dashboard redesign, momenbasel#83 AI history). Adds pt-BR alongside the existing
locales and brings every bundled locale (en/es/ja/ar/pt-BR/zh-Hans/
zh-Hant) to key parity, then enforces that parity in CI via a new
XCTest case.

UI changes
- Localize the full user-facing surface across the redesigned views
  (DashboardView replacing SmartScanView; MainWindow's Overview/
  Applications/Cleanup sidebar; CategoryDetailView's hero card;
  AppListView/AppFilesView/OrphanListView; the new OnboardingView
  flow; AppearancePill; SettingsView tabs).
- Wrap dynamic strings with String(format: String(localized: ...))
  so locale-specific number/format substitutions stay correct.
- Add a Settings > General Language picker covering System Default
  plus every bundled language, with a relaunch prompt because
  AppleLanguages is consumed at app startup.

Infrastructure
- Extract AppLanguage + AppLanguagePreferences into Models/.
  AppLanguagePreferences.apply only touches AppleLanguages and
  preserves AppleLocale.
- Wire AppState with injection points (performStartupTasks,
  locationsProvider, appFileScanner) so the scan-for-app-files path
  is exercised by a unit test without touching the real filesystem,
  and expose appFileScanLocationCount /
  currentAppFileSearchLocationCount so the in-progress scan UI
  shows the location count instead of the placeholder discovered-files
  count.

Tests
- LocalizationFilesTests: parses every PureMac/*.lproj/
  Localizable.strings and fails if any locale drifts from en.
- AppLanguagePreferencesTests: verify apply(.english) and
  apply(.system) modify only AppleLanguages.
- AppStateTests: verifies scanForAppFiles publishes the location
  count while results are pending, then resolves to the sorted
  discovered files.

Build
- project.yml registers PureMacTests and a shared scheme so
  `xcodebuild test` works from a clean checkout. xcodeproj
  regenerated via xcodegen.

Verification
- plutil -lint OK for all 7 .strings files (227 keys each).
- xcodebuild test -only-testing:PureMacTests: 4 tests, 0 failures.
- xcodebuild build -configuration Debug: SUCCEEDED.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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