feat: add offline experience with tiered cache and network monitoring#152
Merged
BrunoCerberus merged 5 commits intomasterfrom Feb 14, 2026
Merged
feat: add offline experience with tiered cache and network monitoring#152BrunoCerberus merged 5 commits intomasterfrom
BrunoCerberus merged 5 commits intomasterfrom
Conversation
Add persistent disk cache (L2) alongside existing in-memory cache (L1), network connectivity monitoring via NWPathMonitor, and graceful UI degradation when offline. Cached content remains visible during network failures, and an animated offline banner appears at the top of the app. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document the tiered cache (L1 memory + L2 disk), NetworkMonitorService, offline banner, graceful degradation, and new key files added in the offline experience feature. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tiered caching (L1 memory + L2 disk) to Media tab via CachingMediaService decorator, and add offline-aware error handling to Feed tab with dedicated offline UI (wifi.slash icon, no retry button). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8e3bb16 to
6968791
Compare
Include ~/Library/Caches/org.swift.swiftpm in the SPM cache path so binary XCFrameworks (LeapSDK) are preserved across runs. Previously only package metadata was cached, causing SPM to re-download artifacts each run and fail with "already exists in file system" errors. Bumps cache key to v6 to pick up the expanded cache path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6968791 to
10fd97a
Compare
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
NetworkMonitorServiceusingNWPathMonitorto track connectivity and display an animated offline bannerwifi.slashicon, and typedPulseError.offlineNoCacheerrorDetails
Tiered Cache
LiveNewsCacheStore(NSCache)DiskNewsCacheStore(JSON in Caches/)Fetch Flow
PulseError.offlineNoCacheNew Files
PulseError.swift- Typed offline error enumNetworkMonitorService.swift- Protocol + Live (NWPathMonitor) + MockDiskNewsCacheStore.swift- Persistent file-based cacheOfflineBannerView.swift- Animated offline bannerDiskNewsCacheStoreTests.swift- 8 unit tests for disk cacheModified (key files)
CachingNewsService.swift- Tiered L1+L2 cache withfetchWithTieredCache()+ offline awarenessHomeDomainInteractor+DataLoading.swift/MediaDomainInteractor/SearchDomainInteractor- Offline error detection, preserve data on failed refreshCoordinatorView.swift- Offline banner integrationHomeView/MediaView/SearchView- Show cached data over error, offline-specific error viewsTest plan
DiskNewsCacheStoreTests- write/read, TTL, remove, corrupted file, overwrite (8 tests)CachingNewsService*Testsupdated for new init signatureHomeViewStateReducerTestsandHomeViewModelTestsupdated forisOfflineErrorfield🤖 Generated with Claude Code