Skip to content

storybook and better reports#29276

Merged
chrisnojima merged 12 commits into
nojima/HOTPOT-next-670-clean-2from
nojima/HOTPOT-storybook
Jun 2, 2026
Merged

storybook and better reports#29276
chrisnojima merged 12 commits into
nojima/HOTPOT-next-670-clean-2from
nojima/HOTPOT-storybook

Conversation

@chrisnojima
Copy link
Copy Markdown
Contributor

No description provided.

- .storybook/main.ts: webpack5 config reusing desktop alias/babel/define patterns
- .storybook/mocks/electron.ts: KB2 stub so platform.tsx loads without Electron preload
- .storybook/preview.ts: injects globalThis._fromPreload, base decorator
- .storybook/preview-head.html: font-face + CSS reset via staticDirs fonts
- staticDirs: fonts/electron + images served at correct URL paths
- tsconfig.desktop.json: include .storybook/ files
- devices/device-icon.stories.tsx: 7 stories
- devices/row.stories.tsx: 6 stories (incl. BadgedDeviceIDsContext)
- devices/device-page.stories.tsx: 6 stories
- plans/storybook.md: todo list of remaining shared/ folders

Run with: cd shared && yarn storybook
- generate-electron-report: parse storybook-desktop/ PNGs, render as
  separate section with slider diff vs storybook-prev/ baseline
- generate-ios-report: add .section-hdr CSS for full-width grid divider
- save-baseline now also saves storybook screenshots to storybook-prev/
- package.json: add storybook:screenshot script
- `loading="lazy"` on all report images
- Slideshow button in header: opens full-screen modal, cycles images at 0.75s with CSS fade-in
- Controls bar: prev/next/pause buttons + counter (e.g. 5/233)
- Keyboard: ←/→ navigate, Space toggles play/pause, Esc closes
Use page.emulateMedia({colorScheme}) to set prefers-color-scheme via CDP
instead of document.documentElement.style.colorScheme. This activates
@media (prefers-color-scheme: dark) CSS rules that the real app depends on.

- screenshot-storybook.mts: emulateMedia before each light/dark capture
- fixtures.ts: emulateMedia replaces setNativeTheme for dark e2e project
- playwright.config.ts: add electron-flows-dark project

This comment was marked as outdated.

- Use Playwright bundled Chromium when CHROME_PATH is unset (fixes CI)
- Skip dark mode dispatch when preference is already correct
- Remove unnecessary `as any` cast in announcement story

This comment was marked as outdated.

- Fix webpack resolve.extensions order so .desktop.tsx/.desktop.ts take precedence over .tsx/.ts
- Wrap fixture setup() in try/finally so emulateMedia cleanup always runs
- Bind static file server to 127.0.0.1 and sandbox request paths to buildDir

This comment was marked as outdated.

This comment was marked as outdated.

- Treat flaky-but-passing Playwright tests as passed
- Escape label/name in HTML alt attributes
- Remove unnecessary ?? fallback on non-nullable projectName

This comment was marked as outdated.

- Clear storybook output dir before each run to remove stale screenshots
- Include skipped tests as passing in electron report
- Fix storybook label path separator replacement to be global
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 87 out of 88 changed files in this pull request and generated 1 comment.

Comment on lines +20 to +24
try {
await setup(page)
} finally {
await page.emulateMedia({colorScheme: null})
}
@chrisnojima chrisnojima merged commit d726593 into nojima/HOTPOT-next-670-clean-2 Jun 2, 2026
1 of 2 checks passed
@chrisnojima chrisnojima deleted the nojima/HOTPOT-storybook branch June 2, 2026 19:37
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.

2 participants