Repository navigation
docs(storybook): seven gallery stories use bundled sample images instead of picsum.photos - #11614
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
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-inlinekeeps 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.tsxandThumbnail.stories.tsx: clear. - Files:
apps/storybook/stories/assets/samples/samples.tsandREADME.md: clear. - Files: the 36
apps/storybook/stories/assets/samples/sample-*.svgscenes: clear. - Files:
packages/core/src/Lightbox/LightboxFinePointer.a11y.browser.spec.ts: clear. - Files:
LightboxKeyboard.a11y.browser.spec.ts,LightboxViewport.a11y.browser.spec.tsand__tests__/LightboxAudit.a11y.chromium.spec.ts: clear, except the non-blocking comment wording. - Files:
__tests__/LightboxDismiss,LightboxDismissCancel,LightboxEveryPointer,LightboxPaging,LightboxPagingModes,LightboxSingleCaption,LightboxZoomandLightboxZoomModesinteraction specs: clear.
| @@ -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. | |||
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
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:35and:149,LightboxViewport.a11y.browser.spec.ts:38,LightboxAudit.a11y.chromium.spec.ts:99and: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.tswith?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-*.svgand 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.
Primary intent
Story and test fixture fix. No product code changes, so there is no Changeset and no release note.
User impact
Change
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.svgfor a 1200×800 photo), so aspect ratios and intrinsic sizes don't change. The folder's README lists each file.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.picsum.photosrequests to colored stand-ins and read the photo id from the URL. They now routesample-*.svgrequests 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-modepage 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
eslintis clean on the changed files, andpnpm check:repopasses.tscon the Storybook project reports no errors in the changed files. The remaining errors come from local packages that weren't built in this checkout.Owner and land path