From 909a9ade92c9b718e8b4a48c6dd2e8c20e54ee5e Mon Sep 17 00:00:00 2001 From: Henric Persson Date: Fri, 2 Oct 2026 08:09:20 +0200 Subject: [PATCH 1/2] Document the blockApproval config option Adds a section for the option introduced in happo/happo#636. It is marked unreleased so it stays out of the production build until the next minor version of happo ships. Co-Authored-By: Claude Opus 5.5 --- docs/configuration.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index f9038e3..3146eaa 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -560,6 +560,36 @@ export default defineConfig({ | `ignoreWhitespace` | `boolean` | `false` | When `true`, whitespace-only differences are ignored. | | `applyBlur` | `boolean` | `false` | When `true`, a blur is applied before comparing to smooth out subtle edge differences. | + + +## `blockApproval` + +_Available since happo v6.21.0._ + +Prevent a comparison from being approved until certain problems are resolved. Each condition is opt-in. + +```js title="happo.config.ts" +import { defineConfig } from 'happo'; + +export default defineConfig({ + blockApproval: { + renderErrors: true, + accessibilityViolations: true, + }, + + // ... rest of config +}); +``` + +| Option | Type | Description | +| --- | --- | --- | +| `renderErrors` | `boolean` | When `true`, approval is blocked while the report for the current commit has examples that failed to render. | +| `accessibilityViolations` | `boolean` | When `true`, approval is blocked while the comparison introduces new [accessibility violations](accessibility.md). | + +Because the conditions live in the configuration file, they apply to comparisons started from that file. You can turn one on in a single pull request, and fix the problems there, without affecting other work in the repository. + + + ## `failOnWaitForTimeout` _Available since happo v6.12.0._ From a0402389a64065b9a2379592a02b9a0bb5d72483 Mon Sep 17 00:00:00 2001 From: Henric Persson Date: Fri, 2 Oct 2026 08:09:48 +0200 Subject: [PATCH 2/2] Remove the unreleased marker from blockApproval happo v6.21.0 is out and the server side is deployed. Co-Authored-By: Claude Opus 5.5 --- docs/configuration.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 3146eaa..5e1e307 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -560,8 +560,6 @@ export default defineConfig({ | `ignoreWhitespace` | `boolean` | `false` | When `true`, whitespace-only differences are ignored. | | `applyBlur` | `boolean` | `false` | When `true`, a blur is applied before comparing to smooth out subtle edge differences. | - - ## `blockApproval` _Available since happo v6.21.0._ @@ -588,8 +586,6 @@ export default defineConfig({ Because the conditions live in the configuration file, they apply to comparisons started from that file. You can turn one on in a single pull request, and fix the problems there, without affecting other work in the repository. - - ## `failOnWaitForTimeout` _Available since happo v6.12.0._