# Smart Snapshots

Reduce pull-request capture work while keeping every story accounted for.

## Enable the build metadata
For a supported Vite-based Storybook, build with `--stats-json` and upload the complete output:

```sh
npm run build-storybook -- --stats-json
```

The generated GitHub Actions setup includes this option for supported builds. For a custom script, confirm that the argument reaches the Storybook build command and that its metadata stays in the uploaded directory.

## What you see
On pull requests, Framecheck captures the stories a change could affect. Stories verified unaffected appear as unchanged with their approved baseline images. The run can show a captured count separately from the total checked count.

Default-branch runs capture every story. If the build metadata is missing, the baseline is unsuitable, or the effect of a change is uncertain, Framecheck captures all stories rather than assuming they are unchanged.

## Billing
Smart Snapshots is included on every plan. It saves capture work and time, not billed checks: an unchanged story still counts as one checked snapshot, just like a captured one.

## If every story is still captured
Check that your Storybook uses a supported builder, the stats file is uploaded, and the run is a pull request with a usable baseline. Shared dependencies and broad configuration changes can legitimately affect every story. Full capture is not itself a failure.
