You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a preview-availability filter to the NFT gallery
NFTs whose media cannot be shown — a dead host, a file that no longer
matches its on-chain hash, or no file at all — render a placeholder tile
but could not be singled out, so finding the broken ones in a large
collection meant scrolling past every healthy one. The gallery's filter
bar gains a third pill next to the Types and Visible/Hidden ones, with
"Preview available" / "Preview not available" checkboxes and counts that
follow the same four-state model as the visibility pill.
The status behind the filter comes from two sources, both kept in a
per-NFT store inside NFTProvider:
- Tiles report what they actually settled on showing. The decision is
derived from the same booleans NFTPreview renders from, so the filter
classifies an NFT exactly as its tile does. Only preview-mode tiles
report; the detail view verifies the full data file rather than the
thumbnail and can legitimately disagree.
- The gallery is virtualized, so most NFTs never mount. Those are
classified from the cache's persisted outcomes via the new
`getCacheInfos` IPC, mirroring the URI walk `useNFTVerifyHash`
performs: a cached file matching the hash makes the preview available,
and it is unavailable only once every URI has a settled failure. A URI
the cache has never seen (or failed only transiently) leaves the NFT
undecided, and undecided NFTs count as available — a tile would still
attempt the download. Lookups run in batches of 200 URLs, once per NFT
per session; a live report always wins over a lookup.
Invalidating an NFT clears its verdict so the refreshed tile reports
anew. Filtering and the statistics counts re-run as verdicts arrive, so
with "Preview not available" selected the gallery converges on the
broken NFTs as tiles settle.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKEGodEgVdEuvUM8dza52q
0 commit comments