feat: redesign Gallery as photo timeline with sync state, deduplication, and detail view
- GalleryItem: unified model with phone/nas/synced source, sync state enum - GalleryViewModel: off-actor PHFetchResult + manifest merge, Phone/NAS/All tab filtering, date section grouping, Combine-driven reactivity - GalleryView: sticky date section headers, 3-col grid, shimmer placeholders, sync dots (green/orange/blue), video duration badge, search bar, context menu (Share, Save to Photos, Delete from Device) - GalleryDetailView: full-screen swipeable photo viewer (TabView page mode), pinch-to-zoom, double-tap zoom toggle, bottom metadata sheet with file info and actions - BackupStatusService: expose lastManifest for gallery deduplication without extra NAS connection - ThumbnailCache: add decodeOffThread static helper for off-actor JPEG decode - BackupManifest: Sendable conformance for safe Task.detached capture - ThumbnailCache: synced items load from PHImageManager (instant) instead of NAS Co-Authored-By: Kutesir <kutesir@provoc.ug> Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
@@ -39,6 +39,14 @@ final class ThumbnailCache {
|
||||
}
|
||||
}
|
||||
|
||||
extension ThumbnailCache {
|
||||
static func decodeOffThread(data: Data, size: CGFloat) async -> UIImage? {
|
||||
await Task.detached(priority: .userInitiated) {
|
||||
UIImage(data: data)?.thumbnailScaled(to: size)
|
||||
}.value
|
||||
}
|
||||
}
|
||||
|
||||
extension UIImage {
|
||||
func thumbnailScaled(to size: CGFloat) -> UIImage {
|
||||
let scale = min(size / self.size.width, size / self.size.height)
|
||||
|
||||
Reference in New Issue
Block a user