Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions frontend/content/blog/daisyui-case-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: "Case study: one CSS selector, two daisyUI regressions, eighteen releases"
description: A button cleanup in daisyUI underlined link buttons inside prose for 16 releases. The fix then took the underline off every link in prose. We replayed both commits with VisualCI, and each build flagged exactly the pages it broke.
date: 2026-12-05T01:32:00+13:00
author: Nathan Broadbent
image: daisy-prose-releases-5.png
---

[daisyUI](https://daisyui.com) is a component library for Tailwind CSS. It's pure CSS: buttons, cards, menus and forms as class names. That makes it the kind of project where a visual change slips past unit tests. Its tests are unit tests of its build scripts, run before each release, and nothing in the repository renders a page. So we forked it, added VisualCI, and replayed two commits from its history.

## The underline that came and went

Tailwind's typography plugin (`.prose`) underlines links. Buttons made from links (`<a class="btn">`) shouldn't be underlined, so daisyUI has a rule that removes the underline from buttons inside prose. Here's what happened to that rule.

1. **11 November 2025:** [bbc8991](https://github.com/saadeghi/daisyUI/commit/bbc8991df3) ("feat: button improvements and cleanup") rewrote the button styles. It replaced the rule with one for `.btn-link` only, so every other link button inside prose (`a.btn`, `a.btn-outline`) got an underline. It shipped in **v5.4.8 and the next 15 releases, through v5.5.14**, for about eleven weeks, until someone reported it.
2. **1 February 2026:** the fix, [c1e1e11](https://github.com/saadeghi/daisyUI/commit/c1e1e11254), changed one line: the selector became `.prose :where(:not(.btn-link))`. That matches every element in prose that isn't a link button, so **every ordinary link in prose lost its underline** (and `a.btn-link` gained one). It shipped in v5.5.15 and v5.5.16.
3. **2 February 2026:** [6ae4f6e](https://github.com/saadeghi/daisyUI/commit/6ae4f6ed79) narrowed it to `a.btn:not(.btn-link)`, released in v5.5.17.

![The same prose page with daisyUI 5.4.7, 5.4.8, 5.5.14, 5.5.15 and 5.5.17, top to bottom](daisy-prose-releases-5.png)

## The replay

Our fork ([visualci-com/daisyui](https://github.com/visualci-com/daisyui)) builds daisyUI from the commit with its own build script, compiles two small test pages with Tailwind (a page of prose with links and buttons, and a page of components), and screenshots each in the light and dark themes. That's four screenshots per build. For each commit we pushed its parent as a baseline and opened a pull request with the commit on top.

- **bbc8991, [build #12](https://app.visualci.com/visualci-com/daisyui/builds/12):** 2 of 4 screenshots changed, the prose page in both themes. The diff marks new underlines under `a.btn` and `a.btn-outline`, and a few pixels along the top edges of three buttons from the rewrite. The components page didn't change: the rest of the rewrite was visually identical, so the reviewer sees only these changes.
- **c1e1e11, [build #14](https://app.visualci.com/visualci-com/daisyui/builds/14):** again only the prose page changed, in both themes. The diff shows the fix working (`a.btn` and `a.btn-outline` lose their underlines) and what else it did: both ordinary links in the text lose theirs, and `a.btn-link` gains one. A one-line fix, and its whole effect is marked on one screenshot.

We rejected both, with the reason on each build. Upstream, the first one shipped in 16 releases and the second in 2.

![Build #14, the light prose page before c1e1e11: ordinary links underlined, and so are a.btn and a.btn-outline](daisy-build14-prose-base.png)

![The same page with c1e1e11: the buttons lose their underlines, and so do both ordinary links, while a.btn-link gains one](daisy-build14-prose-head.png)

![The changes VisualCI marked on build #14](daisy-build14-prose-diff.png)

## What it takes

Two HTML pages, a Tailwind build and a Playwright script: about 100 lines, and four screenshots that run in a minute on GitHub's free runners. A component library's own docs pages make even better targets: every component, every variant, both themes.

## Try it

[Screenshots](/docs/screenshots/) · [GitHub Actions](/docs/ci/github-actions/)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions frontend/content/blog/katex-case-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "Case study: the KaTeX fix that updated six screenshots and still shipped a bug"
description: A KaTeX commit that fixed fraction sizing updated its own screenshot baselines in three browsers, and it still made bold and sans-serif fractions lose their font for 15 releases. We replayed it with VisualCI and one page of everyday formulas, and the build showed it on the commit.
date: 2026-12-05T01:34:00+13:00
author: Nathan Broadbent
image: katex-build2-formulas-diff.png
---

[KaTeX](https://katex.org) renders maths on the web. It's fast and it's everywhere: the `katex` package had about 45.7 million npm downloads in the week to 2 December 2026. And it already does visual testing. Its screenshotter renders 125 test cases in Chrome, Firefox and Safari and compares each with a checked-in PNG.

## The bug

On 22 February 2026, [ef51f18](https://github.com/KaTeX/KaTeX/commit/ef51f18) ("fix: `\*frac` sizing") changed how `\dfrac`, `\tfrac` and `\cfrac` set their size. It was a real fix, and it came with new unit tests and six updated screenshot baselines (FractionTest and Raisebox, in all three browsers). It was released the same day as v0.16.31.

It also stopped font commands from reaching into those fractions. Write `\mathbf{\dfrac{\partial f}{\partial x}}` and the fraction comes out in plain math italic instead of bold. The same goes for `\mathsf`, `\mathrm` and `\boldsymbol`. Plain `\frac` was unaffected, which makes it easy to miss: `\mathsf{\frac{ABC}{xyz}}` was still sans-serif, and `\mathsf{\dfrac{ABC}{xyz}}` right next to it wasn't.

This is ordinary notation: bold vectors and matrices, sans-serif units, an upright "d" in d/dt. It was reported on 13 May as present since v0.16.31 and still present in v0.16.45. The fix, [e9ee046](https://github.com/KaTeX/KaTeX/commit/e9ee046) ("fix: preserve math font in some styling commands"), shipped in v0.16.46 that day. That's 15 releases and almost 12 weeks.

## Why the existing screenshots didn't catch it

The commit's author did look at screenshots: six of them changed, and the new versions were checked in with the fix. But none of the 125 test cases puts a font command around `\dfrac`, `\tfrac` or `\cfrac`. FractionTest has every kind of fraction, all in the default font. The screenshots that existed were right; nothing in them could show this bug.

## The replay

Our fork ([visualci-com/KaTeX](https://github.com/visualci-com/KaTeX)) has one page of ten formulas, written the way people write them:

- five with a font command around a fraction (a bold Jacobian entry, sans-serif units, a roman d/dt, a bold ½mv² and a bold continued fraction), plus the reported example;
- four without (the quadratic formula, Bayes' theorem, nested `\tfrac`s and a binomial sum) as a control.

A GitHub Actions job builds KaTeX from the commit, renders the page in Chromium and sends the screenshot to VisualCI. We pushed ef51f18's parent as a baseline and opened a pull request with ef51f18 on top.

VisualCI's build for that pull request, [build #2](https://app.visualci.com/visualci-com/katex/builds/2), marked **seven regions, all in the font-command rows**. The Jacobian, the units, the d/dt and the inner fractions of the continued fraction have all gone back to math italic, and the ½ in ½mv² is no longer bold. In the reported example, the `\dfrac`s lost their font and the `\frac`s kept theirs. The four control formulas didn't change by a pixel. We rejected the build.

![Before ef51f18: the font-command rows in bold, sans-serif and roman](katex-build2-formulas-base.png)

![With ef51f18: the fractions inside those font commands back in math italic](katex-build2-formulas-head.png)

![The seven regions VisualCI marked on build #2](katex-build2-formulas-diff.png)

## What it takes

One HTML page, a 20-line Playwright script and the KaTeX build the project already runs. The job took 79 seconds on GitHub's free runners. KaTeX's screenshot tests check that its rendering matches TeX, case by case. A page of formulas as people really write them, compared on every pull request, checks something different: that a change made for one case leaves everyone else's maths alone.

## Try it

[Screenshots](/docs/screenshots) · [GitHub Actions](/docs/ci/github-actions)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions frontend/content/blog/pdfkit-case-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "Case study: the PDFKit lint fix that took the colour out of every JPEG"
description: A one-character lint fix in PDFKit's JPEG parser made it embed every colour JPEG as greyscale, and it went out in a release that day. All 367 of PDFKit's tests passed, including screenshot tests full of colour JPEGs, because the renderer those tests use draws the images in colour anyway. VisualCI's renderer didn't.
date: 2026-12-05T01:35:00+13:00
author: Nathan Broadbent
image: pdfkit-build4-test-images-diff.png
---

[PDFKit](https://pdfkit.org) is the PDF generator for Node.js that a lot of other tools are built on. `pdfkit` had about 19.1 million npm downloads in the week to 2 December 2026. It has screenshot tests: 44 snapshots of rendered pages, drawn with pdf.js and compared with jest-image-snapshot on every push, in three Node versions.

## The bug

On 7 June 2026, [38dd435](https://github.com/foliojs/pdfkit/commit/38dd435) ("Fix lint issues") changed one expression in the JPEG parser, from `this.data[pos++]` to `this.data[pos + 1]`. The value of `pos` was never read again, so to the linter the increment looked like dead code. But `pos + 1` reads the next byte instead of the current one. The byte it should read is the image's channel count, 3 for a colour JPEG. The one after it is the first channel's ID, which is usually 1, and 1 channel means greyscale. So PDFKit now wrote every colour JPEG into the PDF with a greyscale colour space, `/DeviceGray`, instead of `/DeviceRGB`.

It went out in v0.19.0 the same day. It was reported quickly, and [b5b2547](https://github.com/foliojs/pdfkit/commit/b5b2547) ("Fix RGB JPEG embedded as DeviceGray (0.19.0 regression)") shipped in v0.19.1 on 10 June. So this one lasted three days. It's in this series because of how it got past CI, not because of how long it lasted.

## The replay

We forked PDFKit ([visualci-com/pdfkit](https://github.com/visualci-com/pdfkit)) and added three small documents:

- **a colour photo-style JPEG** (four coloured bands and a circle) under a blue heading;
- **PDFKit's own test JPEGs** on one page: four of the photos its tests already use;
- **a control** with text, filled shapes and a PNG, which the JPEG parser never touches.

A GitHub Actions job builds PDFKit from the commit, renders the three PDFs and sends them to VisualCI. We pushed 38dd435's parent as a baseline and opened a pull request with 38dd435 on top.

VisualCI's build for that pull request, [build #4](https://app.visualci.com/visualci-com/pdfkit/builds/4), changed **two of the three documents**: both with JPEGs. On the page of PDFKit's own test images, every photo has gone grey and looks zoomed in and striped, because three channels of data are being drawn as one. The building, the bee, the waterfall and the living room are each unrecognisable. The control didn't change. We rejected the build.

![PDFKit's own test JPEGs before 38dd435](pdfkit-build4-test-images-base.png)

![The same page with 38dd435: every photo grey, zoomed in and striped](pdfkit-build4-test-images-head.png)

![The changes VisualCI marked on build #4](pdfkit-build4-test-images-diff.png)

## Why PDFKit's own screenshots didn't catch it

The same pull request ran PDFKit's own CI, on Node 20, 22 and 24. **All 367 tests passed**, including the screenshot tests, and those embed colour JPEGs: eight photos in the EXIF-orientation tests and another in the pdfmake-style image tests. (Its lint was red at this commit for an unrelated reason, which upstream fixed in the next commit, so in the fork we let the tests run past it.)

It wasn't a lenient threshold. The fork also renders our three PDFs with PDFKit's own test renderer, the pdf.js helper its screenshot tests use, and counts the coloured pixels on each page. The numbers are identical before and after 38dd435: 24.68% on the colour JPEG page, 10.35% on the test images. pdf.js draws the JPEG with the colours the image file itself contains, and ignores the colour space the PDF gives it. Other PDF readers take the PDF at its word. We rendered the same PDFs with pdfium, the engine behind Chrome's PDF viewer, and with MuPDF: both draw every photo grey and striped, as VisualCI did.

So the tests were looking at the right pages, through a renderer that forgave the mistake. The fix added a unit test that checks the parsed colour space directly.

## What it takes

Three PDFs, a 36-line script that makes them, and 30 seconds on GitHub's free runners. The lesson is about the renderer more than the test: a visual check is only as strict as what draws the page. Your users open your PDFs in more than one reader, and some, like Chrome's, follow the PDF to the letter. Compare them with a renderer that's as strict as the strictest reader, not as forgiving as the most forgiving.

## Try it

[PDFs](/docs/pdfs) · [GitHub Actions](/docs/ci/github-actions)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions frontend/content/blog/react-pdf-case-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: "Case study: the react-pdf bug that's still in the latest release"
description: A performance commit in react-pdf's text engine turned parts of non-Latin documents into empty boxes, and it has been in every release for over three months. react-pdf already compares 210 screenshots in its tests. We replayed the commit with VisualCI and four realistic documents, and the build flagged the one document it breaks.
date: 2026-12-05T01:33:00+13:00
author: Nathan Broadbent
image: react-pdf-build2-invoice-arabic.png
---

[react-pdf](https://react-pdf.org) turns React components into PDFs. It's one of the most widely used PDF libraries in JavaScript: `@react-pdf/renderer` had about 9.6 million npm downloads in the week to 2 December 2026. And it already does visual testing. Its repository holds 210 PNG baselines that its tests compare with jest-image-snapshot.

So we asked a narrower question than usual: **when a project already compares screenshots, what does a visual check of real documents add?**

## The bug

react-pdf's text engine, `@react-pdf/textkit`, picks the font that draws each character. When the first font in a `fontFamily` list lacks a character, it falls back to the next font in the list.

On 24 August 2026, [6dc0901](https://github.com/diegomura/react-pdf/commit/6dc0901) ("perf(textkit/font): drop omit('font') pass, trim Knuth-Plass, cache AFM lookups") made text layout faster. It also broke fallback for text written in several pieces, which is how JSX writes `<Text>{vat}%</Text>` or `<Text>{day}/{month}/{year}</Text>`. When two pieces in a row both need the fallback font, the second is drawn with the first font anyway. If the first font doesn't have those characters, they come out as empty boxes.

That happens in real documents, because web fonts are usually split by script. Google Fonts and Fontsource serve Noto Sans Arabic's Arabic subset with no Latin digits or punctuation, and expect those to come from a second font. That is exactly what a `fontFamily` list is for.

It shipped in textkit 7.0.1 the same day, and it's in every react-pdf release since. The latest renderer, 4.9.2, installs textkit 7.1.0, which still has it. A user reported it on 1 September with a script that reproduces it. The fix, [b730d15](https://github.com/diegomura/react-pdf/commit/b730d15) ("fix(textkit): merge flattened runs in input order"), was merged on 27 November and isn't in a release yet. As of 4 December 2026, that's more than three months in released versions.

## Why the existing screenshots didn't catch it

None of the renderer's test documents uses a fallback font list with text in several pieces. react-pdf's own example of font fallback writes each line as a single string ("Roboto / امتحان"), and single strings were never affected. The screenshot tests were there, but they had nothing that could show the bug. The fix added unit tests for the two functions involved.

## The replay

We forked react-pdf ([visualci-com/react-pdf](https://github.com/visualci-com/react-pdf)) and added four documents:

- **An Arabic tax invoice.** Noto Sans Arabic and Noto Sans, as Fontsource serves them, with the invoice number, date, quantities, amounts, discount and VAT written as JSX would write them.
- **An English invoice** for the same customer, with the customer's name in Arabic.
- **react-pdf's own font-fallback example**, ported as it is.
- **A two-page report** in Helvetica, with justified paragraphs, a table and page numbers. The same commit also changed the line breaker, so this checks for reflow.

On every push, a GitHub Actions job builds react-pdf from the commit, renders the four documents and sends the PDFs to VisualCI. We pushed 6dc0901's parent as a baseline, then opened a pull request with 6dc0901 on top.

VisualCI's build for that pull request, [build #2](https://app.visualci.com/visualci-com/react-pdf/builds/2), changed **one of the four documents**: the Arabic invoice. The diff marks seven places on its single page:

- the date, `4/12/2026`, now reads `4` followed by eight boxes;
- the `×` after each of the four quantities is a box;
- the discount line, `(10%): -1,961.80`, and the VAT line's `(5%):` are boxes.

The page's text diff lists each of those lines. The English invoice, react-pdf's example and the report didn't change at all, including the report's line breaks. So the reviewer sees exactly what broke, in the only document it affects. We rejected the build.

![The Arabic invoice before 6dc0901, after it, and the difference in red](react-pdf-build2-invoice-arabic.png)

## What it takes

Four documents, about 250 lines of plain JavaScript, and fonts from the same CDN the web uses. The documents are the point: a visual check is only as good as the documents it renders. A test suite full of screenshots can still miss a bug that every Arabic invoice shows. If your users render documents in more than one script, put one of those documents in CI.

## Try it

[PDFs](/docs/pdfs) · [GitHub Actions](/docs/ci/github-actions)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading