build: add Chromatic visual review for the report UI - #6
Merged
Conversation
Adds a root .storybook config (React + Tailwind v4 via viteFinal) with stories for the report App, plus the storybook/build-storybook/chromatic scripts and dev dependencies. The report's styles.css is reused so Storybook shares the same Tailwind compilation. tsconfig now includes the .storybook dot-directory (so it is typechecked and visible to the eslint project service), and storybook-static is ignored by git, prettier, and eslint.
Path-filtered workflow that builds Storybook and publishes to Chromatic only when src/report/web, .storybook, or the workflow itself changes. Runs on PRs for visual review and on push to main to establish baselines (--auto-accept-changes=main); --only-changed enables TurboSnap. Requires a CHROMATIC_PROJECT_TOKEN repository secret.
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
Adds Chromatic visual review for the report web UI. A root
.storybookconfig hosts stories for the reportApp(built entirely from the existing fishery factories), and a path-filtered CI workflow publishes the Storybook to Chromatic only when the report UI changes.build:prefix because this is internal tooling with no user-facing behavior, so it stays out of the changelog.Before CI can pass: add a
CHROMATIC_PROJECT_TOKENrepository secret (Settings → Secrets and variables → Actions) with the token from the Chromatic project.Review focus
packages/storybookindirection,SKIP_DEMO_STORIES, thepackages: readpermission, and theclosed/merged-event +CHROMATIC_BRANCH/SHA/SLUGephemeral-merge-commit handling — replacing the last with the simpler canonicalpush: main+--auto-accept-changes=mainbaseline pattern. Worth a sanity check that we're comfortable not mirroring planbridge exactly.pull_request, GitHub checks out a merge commit; withfetch-depth: 0the Chromatic CLI handles this in the common case. If we later see "ambiguous baseline" warnings, the fix is to addref: ${{ github.event.pull_request.head.sha }}to the checkout. Left out to keep the workflow simple..storybookin tsconfiginclude. The implicit**/*glob skips dot-directories, so the config files were invisible to bothtscand the eslint project service. Adding.storybook/**/*toincludefixes both; confirmedtsc --listFilesnow picks them up.Commits
195ea86— build: set up Storybook and Chromatic for the report UI3d0330a— build: publish Storybook to Chromatic on report UI changes