fix(resources): render SVG thumbnails in cards#7711
Conversation
Query SVG thumbnail fields for the Resources grid and teach the shared card component to fall back to SVG and dark SVG assets when raster thumbnails are unavailable. Co-authored-by: Copilot <[email protected]> Signed-off-by: Arjun Mehta <[email protected]>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR fixes missing thumbnails in the Resources listings by querying SVG thumbnail fields and updating the shared Card component to fall back to SVG assets (including dark-mode variants) when raster thumbnails aren’t available.
Changes:
- Extend the Resources grid static query to include
thumbnail_svganddarkthumbnail_svg. - Update the shared
Cardcomponent to prefer raster thumbnails but fall back to SVG (and use dark variants in dark mode). - Avoid rendering the image component when no thumbnail exists.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/sections/Resources/Resources-grid/DataWrapper.js | Adds SVG thumbnail fields to the allMdx query used by the Resources grid. |
| src/components/Card/index.js | Implements thumbnail selection logic with SVG and dark-mode fallbacks, and guards image rendering when missing. |
leecalcote
left a comment
There was a problem hiding this comment.
Thanks. Let's see what the deploy preview looks like.
|
Preview deployment for PR #7711 removed. This PR preview was automatically pruned because we keep only the 6 most recently updated previews on GitHub Pages to stay within deployment size limits. If needed, push a new commit to this PR to generate a fresh preview. |
Summary
thumbnail_svganddarkthumbnail_svgfor the Resources gridProblem
The Resources page requested only raster thumbnail fields, while a set of published resources define only SVG thumbnail metadata. The shared card component also ignored the SVG fields, so those cards rendered without images.
Result
Resources cards now render available SVG thumbnails, including dark-mode variants when present.