iOS client for Grain grain.social
ios photography atproto
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: remove blur from thumbnail placeholders in stories and galleries

The thumb CDN image is high enough resolution to serve as a clean
placeholder — the blur just added visual noise and caused a
clear→blurred→sharp flash on first render.

+15 -32
-1
Grain/Views/Components/ZoomableImage.swift
··· 282 282 thumb 283 283 .resizable() 284 284 .aspectRatio(aspectRatio, contentMode: .fit) 285 - .blur(radius: 20) 286 285 .clipped() 287 286 } else { 288 287 Rectangle()
+15 -31
Grain/Views/Stories/StoryViewer.swift
··· 417 417 } 418 418 } 419 419 } else { 420 - ZStack { 421 - if let thumbURL = URL(string: story.thumb), 422 - let cachedThumb = ImagePipeline.shared.cache 423 - .cachedImage(for: ImageRequest(url: thumbURL))?.image 424 - { 425 - Image(uiImage: cachedThumb) 426 - .resizable() 427 - .aspectRatio(story.aspectRatio.ratio, contentMode: .fit) 428 - .blur(radius: 20) 429 - .clipped() 430 - // .overlay(alignment: .topLeading) { 431 - // // DEBUG: yellow = thumb sync-pulled from memory cache 432 - // Color.yellow.opacity(0.35).ignoresSafeArea() 433 - // Text("thumb · cache").font(.caption2.bold()).padding(6).background(.black.opacity(0.5)).foregroundStyle(.white).padding(8) 434 - // } 435 - } else { 436 - LazyImage(url: URL(string: story.thumb)) { thumbState in 437 - if let thumb = thumbState.image { 438 - thumb 439 - .resizable() 440 - .aspectRatio(story.aspectRatio.ratio, contentMode: .fit) 441 - .blur(radius: 20) 442 - .clipped() 443 - // .overlay(alignment: .topLeading) { 444 - // // DEBUG: red = thumb from network (cache miss) 445 - // Color.red.opacity(0.35).ignoresSafeArea() 446 - // Text("thumb · network").font(.caption2.bold()).padding(6).background(.black.opacity(0.5)).foregroundStyle(.white).padding(8) 447 - // } 448 - } 420 + if let thumbURL = URL(string: story.thumb), 421 + let cachedThumb = ImagePipeline.shared.cache 422 + .cachedImage(for: ImageRequest(url: thumbURL))?.image 423 + { 424 + Image(uiImage: cachedThumb) 425 + .resizable() 426 + .aspectRatio(story.aspectRatio.ratio, contentMode: .fit) 427 + .clipped() 428 + } else { 429 + LazyImage(url: URL(string: story.thumb)) { thumbState in 430 + if let thumb = thumbState.image { 431 + thumb 432 + .resizable() 433 + .aspectRatio(story.aspectRatio.ratio, contentMode: .fit) 434 + .clipped() 449 435 } 450 436 } 451 - ProgressView() 452 - .tint(.white) 453 437 } 454 438 } 455 439 }