From 60bf311f90c6de6ee5d8841ecb8c377fca806606 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:38:36 -0500 Subject: [PATCH] perf: retain only current imagery thumbnail intent --- src/layers/recentImagery/index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/layers/recentImagery/index.js b/src/layers/recentImagery/index.js index 23b12f44c1..8187872c21 100644 --- a/src/layers/recentImagery/index.js +++ b/src/layers/recentImagery/index.js @@ -568,12 +568,14 @@ export function createRecentImageryLayer({ const list = stripList(); if (!list.length) return; reconcileFocus(); - thumbnails.requestOrdered(list, _box, { - focusIndex: Math.max(0, focusIndexIn(list)), - firstVisible: _visible.first, - lastVisible: _visible.last, - extra: 2, - }); + const wanted = new Set( + thumbnails.requestOrdered(list, _box, { + focusIndex: Math.max(0, focusIndexIn(list)), + firstVisible: _visible.first, + lastVisible: _visible.last, + extra: 2, + }) || [], + ); for (const key of new Set([ _assigned.a, _assigned.b, @@ -581,8 +583,11 @@ export function createRecentImageryLayer({ _followKey, ])) { const candidate = candidateFor(key); - if (sourceOn(candidate)) thumbnails.request(candidate, _box, 0); + if (!sourceOn(candidate)) continue; + thumbnails.request(candidate, _box, 0); + wanted.add(candidate.key); } + thumbnails.retain?.(wanted); } function resetCatalog() {