Skip to content

build: add Chromatic visual review for the report UI - #6

Merged
blimmer merged 2 commits into
mainfrom
build/chromatic-visual-review
May 25, 2026
Merged

build: add Chromatic visual review for the report UI#6
blimmer merged 2 commits into
mainfrom
build/chromatic-visual-review

Conversation

@blimmer

@blimmer blimmer commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Chromatic visual review for the report web UI. A root .storybook config hosts stories for the report App (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_TOKEN repository secret (Settings → Secrets and variables → Actions) with the token from the Chromatic project.

Review focus

  • Deliberate divergence from the planbridge reference. planbridge is a monorepo and its Chromatic workflow carries machinery that isn't warranted in this single-package repo. I dropped the packages/storybook indirection, SKIP_DEMO_STORIES, the packages: read permission, and the closed/merged-event + CHROMATIC_BRANCH/SHA/SLUG ephemeral-merge-commit handling — replacing the last with the simpler canonical push: main + --auto-accept-changes=main baseline pattern. Worth a sanity check that we're comfortable not mirroring planbridge exactly.
  • Ephemeral-merge-commit tradeoff. On pull_request, GitHub checks out a merge commit; with fetch-depth: 0 the Chromatic CLI handles this in the common case. If we later see "ambiguous baseline" warnings, the fix is to add ref: ${{ github.event.pull_request.head.sha }} to the checkout. Left out to keep the workflow simple.
  • .storybook in tsconfig include. The implicit **/* glob skips dot-directories, so the config files were invisible to both tsc and the eslint project service. Adding .storybook/**/* to include fixes both; confirmed tsc --listFiles now picks them up.

Commits

  • 195ea86 — build: set up Storybook and Chromatic for the report UI
  • 3d0330a — build: publish Storybook to Chromatic on report UI changes

blimmer added 2 commits May 25, 2026 10:27
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.
@blimmer
blimmer merged commit bb49a2c into main May 25, 2026
9 checks passed
@blimmer
blimmer deleted the build/chromatic-visual-review branch May 25, 2026 16:30
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.

1 participant