Skip to content

docs(storybook): seven gallery stories use bundled sample images instead of picsum.photos - #11614

Merged
cixzhang merged 1 commit into
mainfrom
fix/storybook-local-sample-images
Nov 14, 2026
Merged

cixzhang merged 1 commit into
mainfrom
fix/storybook-local-sample-images

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

Story and test fixture fix. No product code changes, so there is no Changeset and no release note.

User impact

  • People browsing Storybook: the Lightbox, Carousel, Overlay, GridMasonry, AspectRatio, Thumbnail and LayerDismissal stories loaded their photos from picsum.photos. When that host is slow or down, as it is today, those galleries render empty. They now use small bundled images, so they always render.
  • Builders and users of the library: no change. Only stories and browser specs change.

Change

  • 36 sample scenes: small SVG files in apps/storybook/stories/assets/samples/, about 28 KB in total. Each keeps the width and height of the photo it replaces (for example, sample-forest-1200x800.svg for a 1200×800 photo), so aspect ratios and intrinsic sizes don't change. The folder's README lists each file.
  • Imports: stories import the files through samples.ts, using Vite's ?no-inline, so each scene stays a real URL (in dev and in the built Storybook) rather than an inline data URL.
  • Lightbox specs: 12 Lightbox browser specs routed picsum.photos requests to colored stand-ins and read the photo id from the URL. They now route sample-*.svg requests and read the scene name (forest, lake, beach, city), with the same colors and the same assertions.

Source and license: the scenes are drawn for Astryx from plain SVG shapes and gradients. There is no third-party artwork.

Not in scope: the sandbox media-mode page also uses picsum.photos; it isn't Storybook. Eight other story files (Avatar, AvatarGroup, PowerSearch, CommentPin, MediaTheme, MediaThemeAuto, Markdown, TopNavMenu) still load photos from other remote hosts (pravatar, unsplash). Both are left for follow-ups.

Visual baselines

The visual gate blocks remote requests, so today's baseline shots for these stories show broken or empty images. With bundled images they render real pictures, so 14 shots change: AspectRatio default, Carousel default, GridMasonry masonry gallery, Overlay hover on image, and Thumbnail default, each in its themes and color schemes. That's expected. The Lightbox and LayerDismissal shots show only a closed trigger, and the AspectRatio skeleton shots show no image, so those don't change. The refreshed baselines follow in a separate baseline pull request after this merges.

Testing

  • eslint is clean on the changed files, and pnpm check:repo passes.
  • tsc on the Storybook project reports no errors in the changed files. The remaining errors come from local packages that weren't built in this checkout.
  • The Lightbox browser specs run in CI.

Owner and land path

  • Owner: Astryx maintainers, fix-loop lane 1.
  • Land path: draft until code review approves this head; then ready for review, CI, merge. After the merge, a separate pull request refreshes the visual baselines for these stories.

…o host

Seven stories loaded their photos from picsum.photos. When that host is
slow or down, the Lightbox, Carousel, Overlay, GridMasonry, AspectRatio,
Thumbnail and LayerDismissal galleries render empty.

The stories now import 36 small SVG scenes from
apps/storybook/stories/assets/samples (about 28 KB in total, drawn for
Astryx). Each file keeps the width and height of the photo it replaces, so
aspect ratios and intrinsic sizes do not change. The imports use
?no-inline, so each scene stays a real URL.

The Lightbox browser specs routed picsum requests to colored stand-ins and
read the photo id from the URL. They now route sample-*.svg requests and
read the scene name, with the same colors and assertions.
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 13, 2026 10:14pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 13, 2026
@astracat-bot

astracat-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 14, 2026, 1:51 AM UTC

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 74351c9

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Lightbox · Storybook 145.1 kB (0) · 11.9 kB CSS (0) 4,675 (+10) ✓ · ✓ · ✓

Package size: no published package changed; no new dependencies.

Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot 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.

Requesting changes. The code works: the bundled scenes load in dev and in the built Storybook, and 11 of the 12 re-routed Lightbox spec files pass on a build of the head. Two statements in the pull request need correcting before merge:

  • The title says stories use bundled images instead of a remote photo host, but eight other story files (Avatar, AvatarGroup, PowerSearch, CommentPin, MediaTheme, MediaThemeAuto, Markdown and TopNavMenu) still load photos from pravatar or unsplash, so please retitle it, for example to docs(storybook): seven gallery stories use bundled sample images instead of picsum.photos.
  • The Visual baselines paragraph says about 20 shots change because CI serves a transparent stand-in, but the visual gate blocks remote requests, and only 14 shots change (AspectRatio default, Carousel default, GridMasonry masonry gallery, Overlay hover on image and Thumbnail default), because the Lightbox and LayerDismissal shots show only a closed trigger and AspectRatio's skeleton shots show no image.

Non-blocking: five comments in the changed Lightbox specs (for example LightboxKeyboard.a11y.browser.spec.ts:35) still call the story photos remote.

Claims and files checked
  • Claim: seven gallery stories loaded photos from a remote host and render empty when it is unreachable. Verified: with the host unreachable, the base shows broken images.
  • Claim: the stories now use bundled images and always render. Verified: every story image loads from the Storybook origin.
  • Claim: 36 small SVG scenes, about 28 KB in total. Verified: 36 files, 27,751 bytes.
  • Claim: each scene keeps the width and height of the photo it replaces. Verified: checked story by story and by natural size in the browser.
  • Claim: the folder README lists each file. Verified: 36 rows.
  • Claim: ?no-inline keeps each scene a real URL in dev and in the built Storybook. Verified: dev serves file URLs, and the build emits 36 hashed files.
  • Claim: 12 Lightbox specs now route the sample files and keep their colours and assertions. Verified: all of them pass on a head build except the Lightbox audit, which needs a git checkout and was not run.
  • Claim: no product code changes, so no Changeset. Verified: the published API surfaces are identical, and a tests-only change needs no Changeset.
  • Claim: the scenes are original artwork made from plain shapes and gradients. Consistent with the files: only basic shapes and gradients.
  • Claim: the sandbox media-mode page is left for a follow-up. Verified: it is the only remaining use outside tests.
  • Claim: ESLint is clean, the repository checks pass, and tsc reports no errors in the changed files. Verified, apart from three repository checks that need a git checkout.
  • Claim: the Lightbox browser specs run in CI. Not yet at this head: CI skipped every job on the draft.
  • Claim (title): stories no longer use a remote photo host. False: eight story files still do.
  • Claim (Visual baselines): about 20 shots change, including Lightbox and LayerDismissal, because CI serves a transparent stand-in. False: 14 change, and the visual gate aborts remote requests.
  • Files: apps/storybook/stories/AspectRatio.stories.tsx, Carousel.stories.tsx, GridMasonry.stories.tsx, LayerDismissal.stories.tsx, Lightbox.stories.tsx, Overlay.stories.tsx and Thumbnail.stories.tsx: clear.
  • Files: apps/storybook/stories/assets/samples/samples.ts and README.md: clear.
  • Files: the 36 apps/storybook/stories/assets/samples/sample-*.svg scenes: clear.
  • Files: packages/core/src/Lightbox/LightboxFinePointer.a11y.browser.spec.ts: clear.
  • Files: LightboxKeyboard.a11y.browser.spec.ts, LightboxViewport.a11y.browser.spec.ts and __tests__/LightboxAudit.a11y.chromium.spec.ts: clear, except the non-blocking comment wording.
  • Files: __tests__/LightboxDismiss, LightboxDismissCancel, LightboxEveryPointer, LightboxPaging, LightboxPagingModes, LightboxSingleCaption, LightboxZoom and LightboxZoomModes interaction specs: clear.

Automated review (maintainer link)

@@ -33,7 +33,9 @@ test.afterAll(async () => {
// Opens the gallery story at its second photo ("2 / 4").
async function openGallery(page: Page, direction: 'ltr' | 'rtl') {
// The story's photos are remote; the keys do not need them to load.

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.

Non-blocking: the story's photos now load from Storybook, not a remote host. The same wording is at line 149, LightboxViewport.a11y.browser.spec.ts:38, and LightboxAudit.a11y.chromium.spec.ts:99 and :241. For example: "The story's photos load from Storybook; the keys do not need them."

@cixzhang cixzhang changed the title docs(storybook): stories use bundled sample images, not a remote photo host docs(storybook): seven gallery stories use bundled sample images instead of picsum.photos Nov 13, 2026

@astracat-bot astracat-bot Bot 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.

Approved. The seven gallery stories now draw bundled sample scenes instead of photos from picsum.photos, the re-routed Lightbox specs pass on this head, and no published package changes.

  • Non-blocking: five comments in the changed Lightbox specs still say the story's photos are remote (LightboxKeyboard.a11y.browser.spec.ts:35 and :149, LightboxViewport.a11y.browser.spec.ts:38, LightboxAudit.a11y.chromium.spec.ts:99 and :241); they now load from Storybook.
  • For the follow-up baseline pull request: the AspectRatio record's verification row still says the default story's image is remote, so that gap line can be updated with the refreshed shots.
Claims and files checked

Claims:

  • Seven gallery stories switch from picsum.photos to bundled images: verified, seven story files change.
  • 36 small SVG scenes, about 28 KB in total: verified, 36 files and 27,751 bytes.
  • Each scene keeps the width and height of the photo it replaces: verified for all 46 replaced URLs and every file's own width and height.
  • The folder README lists each file: verified, one row per file.
  • Stories import the scenes through samples.ts with ?no-inline, so each stays a real URL in dev and in the built Storybook: verified in the dev server and in CI's Storybook build of this head (36 hashed files).
  • The 12 Lightbox specs now route sample-*.svg and read the scene name, with the same colours and assertions: verified in the diff; two of them pass on this head and fail with the old routes.
  • The visual gate blocks remote requests, so 14 baseline shots change and the closed Lightbox, LayerDismissal and AspectRatio skeleton shots do not: verified against the gate's network boundary, the baseline manifest and before and after frames.
  • No product code changes, so no changeset and no change for library users: verified, the built API surfaces are identical and no changeset is added.
  • The sandbox media-mode page and eight other story files still load remote photos: verified.
  • Lint, typecheck and the Lightbox browser specs run in CI: verified green on this head; the Lightbox audit spec runs only on an audit pull request.
  • The scenes are plain SVG shapes and gradients with no third-party artwork: consistent, the files hold only rectangles, circles, polygons, paths and gradients.

Files:

  • Seven story files (AspectRatio, Carousel, GridMasonry, LayerDismissal, Lightbox, Overlay, Thumbnail): clear.
  • samples.ts, the samples README and the 36 SVG scenes: clear.
  • Twelve Lightbox spec files: clear; three carry the comment note above.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 13, 2026 23:56
@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 14, 2026
@cixzhang
cixzhang marked this pull request as draft November 14, 2026 01:16
@cixzhang
cixzhang marked this pull request as ready for review November 14, 2026 01:17
@cixzhang
cixzhang merged commit a5c21f0 into main Nov 14, 2026
217 checks passed
@cixzhang
cixzhang deleted the fix/storybook-local-sample-images branch November 14, 2026 02:04

This branch was successfully deployed

1 active deployment
Preview — 74351c94 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant