Skip to content

Support themed sample images#1228

Merged
IEvangelist merged 4 commits into
mainfrom
dapine/sample-theme-images
Jun 10, 2026
Merged

Support themed sample images#1228
IEvangelist merged 4 commits into
mainfrom
dapine/sample-theme-images

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

Summary

  • refresh sample data/assets from microsoft/aspire-samples PR 1682
  • map GitHub light/dark README image pairs to the ThemeImage component on sample pages
  • support themed thumbnails in sample cards and sample Open Graph image selection

Validation

  • pnpm --dir ./src/frontend run lint
  • pnpm --dir ./src/frontend run test:unit:components
  • pnpm --dir ./src/frontend run check-data

Did not run pnpm build locally per preference.

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>
Copilot AI review requested due to automatic review settings June 8, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-only URL fragments for asset resolution).
  • Detect GitHub light/dark image pairs in sample READMEs and render them via the ThemeImage component.
  • 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.

Comment thread src/frontend/src/components/SampleDetail.astro Outdated
Comment thread src/frontend/src/components/SampleCard.astro
Comment thread src/frontend/src/components/SampleDetail.astro
Comment thread src/frontend/src/components/SampleGrid.astro Outdated
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1228. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1228 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

IEvangelist and others added 2 commits June 8, 2026 11:04
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist IEvangelist requested a review from eerhardt as a code owner June 8, 2026 16:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist IEvangelist enabled auto-merge (squash) June 9, 2026 21:05
@IEvangelist IEvangelist merged commit fef8951 into main Jun 10, 2026
9 checks passed
@IEvangelist IEvangelist deleted the dapine/sample-theme-images branch June 10, 2026 00:22
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.

3 participants