Support themed sample images#1228
Merged
Merged
Conversation
Map GitHub light/dark README image pairs to the site ThemeImage component and refresh sample data/assets from microsoft/aspire-samples PR 1682. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for theme-aware (light/dark) sample images across the samples experience, including README rendering, sample cards, and Open Graph image selection, along with refreshed sample assets/data.
Changes:
- Introduce theme-aware thumbnail types and helpers (including stripping
#gh-*-mode-onlyURL fragments for asset resolution). - Detect GitHub light/dark image pairs in sample READMEs and render them via the
ThemeImagecomponent. - Update the sample refresh script to preserve theme fragments and extract themed thumbnails.
Reviewed changes
Copilot reviewed 9 out of 66 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/tests/unit/custom-components.vitest.test.ts | Extends component coverage tests for themed sample images and thumbnails. |
| src/frontend/src/utils/samples.ts | Adds theme-aware thumbnail types and URL/alt normalization helpers. |
| src/frontend/src/utils/sample-readme-images.ts | New helper to detect standalone image blocks and theme image pairs in marked tokens. |
| src/frontend/src/pages/reference/samples/[sample]/index.astro | Resolves themed thumbnails and selects a stable OG image. |
| src/frontend/src/components/SampleReadmeBlocks.astro | Filters out standalone image blocks using new shared helper (supports themed pairs). |
| src/frontend/src/components/SampleGrid.astro | Resolves and carries themed thumbnails through sample grid rendering. |
| src/frontend/src/components/SampleDetail.astro | Extracts themed README images into the screenshot gallery using ThemeImage. |
| src/frontend/src/components/SampleCard.astro | Renders themed thumbnails using ThemeImage. |
| src/frontend/scripts/update-samples.ts | Preserves theme fragments when downloading/rewriting images and extracts themed thumbnails. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JamesNK
approved these changes
Jun 10, 2026
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.
Summary
Validation
Did not run pnpm build locally per preference.