Add image disk cache + native-res hero upgrade + bootstrap-path timing
Created by: jedmund
Summary
Three stacked commits. Each is independently reviewable and self-contained.
-
Add TTLDataCache for per-pipeline disk storage — wraps Nuke's
DataCachewith a TTL sidecar so.pixiv(14 d) and.pixivLightbox(7 d) entries expire by age on top of LRU-by-size. Each pipeline gets its own 3 GB directory so lightbox originals can't evict grid thumbnails. -
Upgrade detail hero to native resolution after lift settles — introduces
HeroImageStack, a two-layer view that keeps the current.largebase and crossfades a 1400 pt decode of.originalon top ~400 ms after the matched-geometry entrance spring settles. Routes through.pixivLightboxso thepreloadLightboxbytes are reused — one download per illust feeds both the hero upgrade (resized) and the lightbox (native). Bumps.pixivLightboxcountLimit6→25 to accommodate the mixed workload. -
Instrument image-cache bootstrap path with timing logs — diagnostic commit for the reported "several minutes to first feed" on a fresh install. Adds an
image-cacheOSLogcategory that timesImagePipeline.pixiv/.pixivLightboxstatic-let init (thread + total ms) andTTLDataCache.initphases (createDirectory,DataCache(path:),loadTimestamps) + timestamps count. Filter in Console.app withsubsystem:com.attractor.pixillate category:image-cache.
Test plan
-
Fresh install on iPad Pro 13": open a detail with a large native source; hero visibly sharpens ~500 ms after the lift lands, lightbox still pinches to native -
Tap a cell and dismiss within 200 ms: no .originalrequest begins (upgrade task cancelled before firing) -
Multi-page carousel: each page's .largeshows instantly; upgrades fire only for pages the user rests on -
Cold network + fresh install: capture Console logs under category:image-cacheand confirm whether pipeline init is on main and how long each phase takes — this is what will tell us if the minutes-to-feed was TTLDataCache-related or pure network