Commit 82b553a
chore(scripts): further reduce visual-diff false positives
Follow-up to the retry/font/scroll hardening. After the first round, three
distinct false-positive shapes remained; each gets a targeted fix:
- `compareImages` now crops to the smaller of the two captures instead of
padding the smaller one with transparent black. Padding compared blank
pixels against real content and produced a giant phantom diff at the
bottom whenever the two captures rendered at slightly different heights.
- Inject `html { scrollbar-gutter: stable; }` via context init script so
the browser always reserves scrollbar space. Without this, captures
where content barely fits toggle the scrollbar between runs, changing
effective page width by ~15px and reflowing card titles / ellipsis
truncation.
- After `networkidle`, wait for `requestIdleCallback` plus two animation
frames before capturing. Catches async client-side work that finishes
after the network is quiet (Prism syntax highlighting, late hydration).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 8c42688 commit 82b553a
1 file changed
Lines changed: 38 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
128 | 145 | | |
129 | 146 | | |
130 | 147 | | |
| |||
194 | 211 | | |
195 | 212 | | |
196 | 213 | | |
197 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
198 | 220 | | |
199 | 221 | | |
200 | 222 | | |
201 | 223 | | |
202 | | - | |
| 224 | + | |
203 | 225 | | |
204 | 226 | | |
205 | 227 | | |
| |||
214 | 236 | | |
215 | 237 | | |
216 | 238 | | |
217 | | - | |
218 | | - | |
| 239 | + | |
| 240 | + | |
219 | 241 | | |
220 | | - | |
| 242 | + | |
221 | 243 | | |
222 | | - | |
223 | | - | |
| 244 | + | |
| 245 | + | |
224 | 246 | | |
225 | 247 | | |
226 | 248 | | |
| |||
286 | 308 | | |
287 | 309 | | |
288 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
289 | 320 | | |
290 | 321 | | |
291 | 322 | | |
| |||
0 commit comments