Skip to content

Grid view: stop the drawer showing the previous tile while metadata loads (#438) - #446

Merged
lstein merged 2 commits into
masterfrom
lstein/fix/grid-drawer-stale-metadata
Nov 30, 2026
Merged

lstein merged 2 commits into
masterfrom
lstein/fix/grid-drawer-stale-metadata

Conversation

@lstein

@lstein lstein commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Fixes #438.

What changed

  • Loading placeholder: when the selected grid tile's metadata hasn't arrived, the drawer is blanked and the title bar says "Loading…", instead of keeping the previous tile's name, path, details and { } link. The cluster and label rows still show (they need only the index).
  • Late metadata repaints the drawer. Previously nothing did, including after every grid reset (album change, search, deletion).
  • Failed fetch: the drawer stays blank rather than showing "Loading…" forever.
  • Empty album: updateMetadataOverlay(null) now blanks the drawer instead of returning early, so the old album's path no longer lingers.
  • Hidden single swiper: updateMetadataOverlay is a no-op while grid view is active, so the single swiper (still alive underneath, still rebuilding on album changes) can't overwrite grid view's drawer.
  • Seek to an on-screen tile (UMAP click, seek slider, Back, reference thumbnail): the grid's seekToSlideIndex handler now repaints the drawer and score itself. It used to rely on the hidden single swiper doing it, which the previous point removes.

Two related fixes, made visible by repainting on arrival:

  • Metadata fetches started before an album change or grid rebuild are discarded when they land (generation counter), so the old album's data can't be stored under the same index.
  • Grid resets drop slideData, so after a deletion shifts indices the drawer can't briefly describe the wrong image.

Testing

  • New Jest cases in grid-view.test.js and metadata-drawer-file-info.test.js; the stale-fetch and seek cases were checked to fail without their fixes. Full suite, lint and format pass.
  • Tested in the browser by the author.
  • Adversarial fresh-context review run; it found the seek regression above (fixed) and a trim/failed-fetch race (fixed).

Not addressed: the score pill can also go stale after switching to an empty album in single-image view.

🤖 Generated with Claude Code

lstein and others added 2 commits November 29, 2026 20:44
…oads (#438)

- Blank the drawer (with a "Loading…" title placeholder) when the selected
  grid tile's metadata hasn't arrived, instead of leaving the previous
  tile's name, path, details and { } link.
- Repaint the drawer when the selected tile's metadata lands; previously
  nothing did, including after every grid reset.
- A failed fetch drops the placeholder rather than loading forever.
- updateMetadataOverlay(null) blanks the drawer (empty album) instead of
  returning early, and is a no-op while grid view is active so the hidden
  single swiper can't overwrite grid view's drawer.
- Discard metadata fetches started before an album change or grid rebuild,
  and drop slideData on reset so shifted indices can't describe the wrong
  image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etches for trimmed tiles

The hidden single swiper used to repaint the drawer after a seek (UMAP
click, seek slider, back, reference thumbnail) to a tile already in the
grid; with it now barred from the drawer in grid view, the grid's
seekToSlideIndex handler does it itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lstein
lstein merged commit 9552681 into master Nov 30, 2026
11 checks passed
@lstein
lstein deleted the lstein/fix/grid-drawer-stale-metadata branch November 30, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid view: drawer title bar shows the previous tile's name and path while metadata loads

1 participant