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: collapse exif section when current photo has no metadata

- Animate height to zero when swiping to a photo without camera data
- Only render settings row (aperture, ISO, etc.) when at least one value exists

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+13 -8
+7 -6
Grain/Views/Components/ExifInfoView.swift
··· 69 69 .foregroundStyle(style) 70 70 .opacity(exif?.lens != nil ? 1 : 0) 71 71 } 72 - ExifSettingsRow( 73 - tokens: [exif?.focalLength, exif?.fNumber, exif?.exposureTime, exif?.iso], 74 - style: style 75 - ) 72 + let settingsTokens = [exif?.focalLength, exif?.fNumber, exif?.exposureTime, exif?.iso] 73 + if settingsTokens.contains(where: { $0 != nil }) { 74 + ExifSettingsRow( 75 + tokens: settingsTokens, 76 + style: style 77 + ) 78 + } 76 79 } 77 - // Single opacity for the whole block so all rows appear/disappear together. 78 - // nil animation suppresses any inherited transaction so it's always instant. 79 80 .opacity(exif != nil ? 1 : 0) 80 81 .animation(.easeInOut(duration: 0.2), value: exif == nil) 81 82 }
+6 -2
Grain/Views/Components/GalleryCardView.swift
··· 530 530 531 531 @ViewBuilder 532 532 private func captionSection(lr: LabelResolution) -> some View { 533 - // EXIF info — always rendered when any photo in the gallery has exif so 534 - // the card height stays locked; content fades in/out per photo. 533 + // EXIF info — collapses when the current photo has no metadata, 534 + // expands smoothly when swiping to a photo that does. 535 535 let allPhotos = gallery.items ?? [] 536 536 if allPhotos.contains(where: { $0.exif?.hasDisplayableData ?? false }) { 537 537 let currentExif = allPhotos.indices.contains(currentPage) 538 538 ? allPhotos[currentPage].exif : nil 539 + let hasCurrentExif = currentExif?.hasDisplayableData ?? false 539 540 ExifInfoView( 540 541 exif: currentExif?.displayData, 541 542 reserveCameraRow: allPhotos.contains(where: { $0.exif?.cameraName != nil }), ··· 544 545 .transaction { $0.animation = nil } 545 546 .padding(.horizontal, 12) 546 547 .padding(.top, 8) 548 + .frame(maxHeight: hasCurrentExif ? nil : 0, alignment: .top) 549 + .clipped() 550 + .animation(.easeInOut(duration: 0.2), value: hasCurrentExif) 547 551 } 548 552 549 553 // Title & description