Repository navigation
Fix card artwork everywhere, constant PayPal link, v1.7.1 and the Top 100 page - #24
Merged
Merged
Conversation
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ching artwork - add src/services/cardImages.ts as the single resolver: normalises TCGdex asset bases (strips a duplicate extension/quality suffix), rejects non-TCGdex URLs instead of inventing them, and returns ordered derivatives (low.webp -> low.png -> high.webp -> high.png, reversed for full-size art) - add CardArtwork: one component for every image surface, walks the derivative chain, distinguishes 'no artwork published' from 'failed to load' (with retry) and never renders a bare broken image - wire it into CardTile, PackCard (booster simulator), PullSummary, CardPreviewModal, CardDetailPage, CollectionPage, ScannerPage and the header suggestions - packPools no longer appends /low.webp itself (that produced .../016.webp/low.webp); saved pulls keep working through the resolver - service worker: artwork is never intercepted, and only complete basic responses are cached, so an opaque/error response can no longer be replayed to an <img> - remove the temporary diagnostic page - Buy Me a Pack now always links to https://paypal.me/dlinacre16 - version 1.7.1 Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
- /top-100 ranks cards by Cardmarket trend, one printing per card, GBP with the EUR source figure, marketplace + FX dates, coverage/progress reporting and an honest empty state; filters (name/set, rarity, era) and four sorts - the price index is built from a bounded, resumable, cached candidate pool (the rarities that hold expensive raw cards) rather than fetching the whole catalogue on every visit, and it never pads the list or invents a value - nav (desktop + mobile) and footer entry points - version from package.json shown in the footer and About page via __APP_VERSION__ (single source of truth) - README/RELEASE_NOTES document the artwork resolver, the worker change, the Top 100 method and the constant PayPal link - tests: cardImages resolver, CardArtwork states, pack reveal artwork, top-100 service, top-100 route + nav link (190 tests) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Rows appear as cards are priced (every 25) instead of only when the pass finishes, so a first visit shows results immediately. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Discovery ran one rarity page at a time (~30 sequential requests before any row could appear). It now runs four at a time and reassembles them in rarity order, so a first visit reaches the ranking much sooner. Adds a discovery test. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Twenty-five consecutive detail failures abort the pass, keep everything priced so far and tell the user, instead of spending the whole budget on errors. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
1. Card artwork (all surfaces, including the booster simulator)
Root cause. Three separate problems were stacking up:
packPools.tsappended/low.webpto a TCGdex asset base that can already carry an extension (…/016.webp), producing…/016.webp/low.webp. Each component also had its own fallback chain — some had none at all (PackCard), so a package reveal had a single, un-retried<img>.imagefor some cards (confirmed:tk-sm-r-22returns{"id":"tk-sm-r-22","localId":"22","name":"Drowzee"}with noimagekey). Those cards producedimageBase === undefinedand rendered “Image unavailable” everywhere, including the “More cards” grid.<img>request with a503 application/jsonbody — which the browser renders as a broken image. That is why artwork broke for users whose cache had filled rather than failing from the start.Fix.
src/services/cardImages.ts— the single resolver. Normalises any shape (…/016,…/016.webp,…/016/low.webp) to one asset base, refuses to invent a URL for artwork the provider never published, and returns ordered derivatives (low.webp → low.png → high.webp → high.png, reversed for full-size art).src/components/Cards/CardArtwork.tsx— the single artwork component, used by the grid, card page, preview modal, vault, scanner results, header suggestions and the booster simulator. It walks the derivative chain, retries on a different format, resets on card change, and distinguishes “No artwork” (provider published none) from “Artwork unavailable” (load failed, with a retry). A bare broken<img>can no longer appear.assets.tcgdex.netor any image request, and only caches completebasicresponses; quota errors are swallowed. Bumping the version invalidates the poisoned caches.2. Buy Me a Pack
Always
https://paypal.me/dlinacre16, new tab,rel="noopener noreferrer", identical in header/footer/About.VITE_BUY_ME_A_PACK_URLand the “not configured” state are gone.3. Version
package.json1.7.0 → 1.7.1 (+ lockfile), injected as__APP_VERSION__and shown in the footer and About page. One source of truth, no invented build numbers.4. Top 100 (
/top-100)Ranked by Cardmarket trend, one printing per card, GBP with the EUR source figure, marketplace update date and FX rate date. Cardmarket has no public leaderboard and the search API carries no prices, so the page builds a bounded, cached, resumable price index from the rarities that hold expensive raw cards — it never pads the list, never estimates a value, and always shows how much of the candidate pool has been priced. Filters (name/set/number, rarity, era) and four sorts. Linked from the desktop nav, mobile nav and footer.
Verification (live, on the deployment of this branch)
sw.jsserves the new worker (isMediaRequest, media bypass) — cache invalidation is live.sv06.5-016: hero art loads; “More Drowzee cards” now shows real art forex6-32,xy3-35,me06-043,base1-49,xy12-49, and “No artwork” fortk-sm-r-22(the card with noimagefield).<img src="https://assets.tcgdex.net/en/xy/xy12/49/low.webp" width="245">(previously 0×0)./top-100: row 1 = “Mega Charizard X ex — Phantasmal Flames #125 · Special illustration rare · Holofoil · 13 Nov 2026 · £472.97 / €566.04”.PokeGuru v1.7.1; nav:Search Sets Packs Top 100 Wiki Vault Scan; About:Buy me a pack → https://paypal.me/dlinacre16.Tests
191 passing (
npm test), plusnpm run typecheck,npm run lint,npm run build. New coverage: image resolver (extension normalisation, junk rejection, ordering, dedupe),CardArtworkstates (fall-through, retry, no-artwork vs failure, card change), booster reveal artwork, top-100 service (ranking, storage, coverage, discovery) and the/top-100route + nav link.