Skip to content
← Work log

Porting the small stuff

With the design system back from its rebuild, porting a component turned out to be mostly copying. Each one already has its own CSS file on our tokens and layers, so that gets copied over untouched, the JavaScript gets turned into TypeScript with the same props, and a small test page rebuilds the system's own preview with our version so the two can be compared. Before handing that out to anyone, Claude spent a bit of time making the comparison check stricter. It now compares the hovered and keyboard-focused states as well as the resting one, and it gives the design system's preview the same self-hosted fonts the site uses. Otherwise every component with text in it would have failed on tiny differences between Google's copy of Geist and ours.

The first component with text (a little chip for picking values) came back 1/255 off on two pixels, both at the rounded corners of the first chip. The styles were identical, so Claude went after the colour tokens first, which was a reasonable guess and wrong. It turned out to be position. The system's preview sits 20px in from the edge of the page and ours was sitting right at the edge, and rounded corners get drawn very slightly differently right up against the edge of the screen. Moving ours to the same spot sorted it, and the chip became the example for the other text components.

Then three Sonnet agents took a third of the remaining primitives each (buttons, fields, checkboxes, switches, selects, a ruler slider and so on), each in its own copy of the repo. That fell over immediately, because the copies were made from main instead of the rebuild branch, so none of them had anything to port from. They all spotted it and stopped rather than guessing, which was the right call and the reason the brief tells them to check first. Second time round Claude made the copies by hand from the right branch, and they got through all eighteen. They also ran into the next problem, which was that the dev server won't run in a copy whose node_modules points back at the main checkout, so each of them quietly worked around it with a local config. That needs fixing properly before the next batch.

Most of what came back as "not identical" was the check rather than the ports. The design system never sets color-scheme, so on its own previews the browser's form controls stay light in the dark theme. The site sets it, so ours render dark, which is correct. The check now gives the system's preview the same setting. A background image showed up as different because one side loaded it from disk and the other from the dev server, so images are now compared by file name. That left three components (the search field, the icon button and the glass button) with a handful of pixels off by 1 or 2 out of 255, all on edges drawn over the frosted glass effect, with every style identical. The design system's own rebuild ran into exactly the same thing over glass. I didn't want to loosen the check for everything, so those three get a small named allowance, capped at the number of pixels and the size of the difference, with the reason written next to it.

So all 21 primitives are in now, identical to the design system in both themes, at rest, hovered and focused, apart from those few glass pixels. The pages still look broken, because nothing uses the components yet. Next up are the bigger pieces built from these (cards, panels and status messages), then the post content and the site's header and footer.

rebuild
AI-OMETER— DISCLOSURE INDEX
MACHINE-LED80%