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: stable like count width — only reflows on digit count change

Use a hidden ghost Text sized to the widest N-digit string ("8" × N)
so the layout only shifts when the count crosses a digit boundary
(e.g. 9→10), not on every increment.

+13 -1
+13 -1
Grain/Views/Components/GalleryCardView.swift
··· 295 295 } 296 296 } 297 297 } 298 + .contentShape(Rectangle()) 299 + .onTapGesture { 300 + let photo = currentPage < photos.count ? photos[currentPage] : nil 301 + if let alt = photo?.alt, !alt.isEmpty { 302 + withAnimation(.easeInOut(duration: 0.2)) { showingAlt.toggle() } 303 + } 304 + } 298 305 .frame(height: height) 299 306 } 300 307 .aspectRatio(carouselRatio, contentMode: .fit) ··· 393 400 .font(.system(size: 22)) 394 401 .contentTransition(.symbolEffect(.replace.downUp.byLayer, options: .nonRepeating)) 395 402 .animation(.spring(response: 0.3, dampingFraction: 0.6), value: isFavorited) 396 - Text("\(gallery.favCount ?? 0)") 403 + ZStack { 404 + let count = gallery.favCount ?? 0 405 + Text(String(repeating: "8", count: max(1, "\(count)".count))) 406 + .hidden() 407 + Text("\(count)") 408 + } 397 409 } 398 410 } 399 411 .foregroundStyle(isFavorited ? Color("AccentColor") : .secondary)