From f19b70fda5fa76a1a77ecca01c7c842df73d53b7 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 30 Oct 2026 17:26:17 -0700 Subject: [PATCH] Update visible cells directly when a thumbnail arrives. --- iOS/MainTimeline/MainTimelineViewController.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index a92fb8857..b08f28fa2 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -1248,10 +1248,16 @@ private extension MainTimelineViewController { } @objc func handleArticleThumbnailDidBecomeAvailable(_ notification: Notification) { - guard let thumbnailMode, let url = notification.userInfo?[ArticleThumbnailFinder.urlKey] as? String else { + guard let thumbnailMode, let collectionView, let dataSource, let url = notification.userInfo?[ArticleThumbnailFinder.urlKey] as? String else { return } - reloadCells(visibleArticles().filter { ArticleThumbnailFinder.shared.thumbnailURL(for: $0, mode: thumbnailMode) == url }) + // The row’s height already allows for the thumbnail, so only the cell’s contents change. + for indexPath in collectionView.indexPathsForVisibleItems { + guard let article = dataSource.itemIdentifier(for: indexPath), ArticleThumbnailFinder.shared.thumbnailURL(for: article, mode: thumbnailMode) == url, let cell = collectionView.cellForItem(at: indexPath) as? MainTimelineCell else { + continue + } + cell.cellData = configure(article: article) + } } @objc func handleArticleThumbnailDownloadDidFail(_ notification: Notification) {