Add cache cleanup: age-based auto-eviction + manual Clear cache
CacheMaintenance prunes the SwiftData caches so they don't grow forever: seen markers >30d, read >90d, cached articles >30d, cached stories >14d — always protecting saved bookmarks. Runs on launch. Settings gains a "Clear offline cache" action (keeps saved) with a count + confirmation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -120,6 +120,7 @@ struct SignalFeedView: View {
|
||||
.onChange(of: store.stories) { _, newValue in
|
||||
cacheStories(newValue)
|
||||
}
|
||||
.task { CacheMaintenance.prune(modelContext) } // bound the caches on launch
|
||||
.task(id: selectedPill) {
|
||||
// A filter active but nothing matched in the loaded set → pull a few
|
||||
// more pages so sparse pills still populate.
|
||||
|
||||
Reference in New Issue
Block a user