4,291 tests, and none of them can see a pixel
A 1px red line ran along the top and bottom of every block in the outline, at rest, on a phone nobody was touching. The colour belongs to the swipe-to-delete panel, and the mechanism is nowhere near it: a row lands on a fractional y, a background is rasterised per element, and the panel and the opaque row covering it rounded to different device pixels. The tidier-looking repair, painting the colour on the clipping parent, measures worse and widens the same leak to the full row. That bug, a hover affordance covering 49.1pt of the line it described, and a calendar grid computing to 627pt inside a 402pt viewport were all invisible to 3,188 Rust tests, 1,103 frontend tests, a clean tsc and a clean clippy. This is what verifying them actually took.
A 1px line of red ran along the top and bottom of every block in the outline.
Not during a swipe. At rest, on a phone nobody was touching, on every row of a journal page. The colour belongs to the swipe-to-delete panel, which sits under the row and is covered by it until you drag. Nothing had been dragged, and the panel was not the thing that was wrong.
The suite was green while that shipped: 3,188 Rust tests, 1,103 frontend tests across three bun packages, tsc --noEmit clean in every workspace package, clippy at -D warnings. Four thousand two hundred and ninety-one assertions about what the components render, and not one of them can see a pixel. Every defect in this pass that reached a user was geometry, which is the one thing that list cannot answer.
a background is rasterised per element, and the row sat on a fractional y
SwipeRow is three divs. A clipping parent, an action panel pinned to the right, and the row itself on top with a translateX that is zero until a finger moves it.
<div class="relative overflow-hidden">
<div
class="absolute inset-y-px right-0 flex items-center justify-end bg-(--color-outl-destructive) px-5 text-[15px] font-semibold text-(--color-outl-destructive-fg)"
style={{ width: `${threshold()}px` }}
>
{props.leftActionLabel ?? "Delete"}
</div>
inset-y-px, not inset-y-0. That one character is the fix, and the comment above it in crates/outl-mobile/src/components/SwipeRow.tsx is longer than the element.
A journal row does not land on a whole number. 162.4 and 223.4 are real y values off a real page, and there is nothing exotic about them: a row’s height is a line box at 17px over the shared --outl-block-leading ratio plus its padding, and the Nth row down the page is that number N times. A background is rasterised per element, so before anything is painted each box is rounded to whole device pixels on its own. The panel rounded one way, the opaque row covering it rounded the other, and the difference is a device pixel of red along the top and bottom of the right 96px of every row in the outline.
What I can say I measured is that the two boxes disagreed. Which difference between them decides the rounding, I did not isolate: the panel is absolutely positioned against the clipping parent and the cover is a flow child carrying a transform, and either of those is enough to put them on different rasterisation paths in WebKit. Pinning down which one would have been interesting and would have changed nothing, because the repair has to survive both.
Inset by a point, the panel is strictly inside whatever the cover rounds to, in both directions, whichever way either one goes. It costs one point of height on an element that is invisible at rest and whose content is a centred word.
the tidier fix measures worse, so the test asserts against it
The obvious alternative is to stop having two painted boxes. Put bg-(--color-outl-destructive) on the clipping parent, which already has overflow-hidden, and delete the panel’s own background. One fewer element painting a colour, same visual result, no magic one-pixel inset to explain.
It is worse. The parent is a box too, it rounds too, and now the colour it carries is the full row width rather than the right 96px. The leak does not go away, it gets six times wider.
That is why the regression net in SwipeRow.test.tsx asserts a negative:
const ACTION = "bg-(--color-outl-destructive)";
const panel = (root: HTMLElement) => root.querySelector<HTMLElement>(".absolute")!;
it("insets the panel instead of filling the row's height", () => {
const p = panel(mount());
expect(p.className).toContain("inset-y-px");
expect(p.className).not.toMatch(/inset-y-0\b/);
});
it("keeps the colour on the panel, never on the clipping parent", () => {
const root = mount();
expect(panel(root).className).toContain(ACTION);
expect(root.className).toContain("overflow-hidden");
expect(root.className).not.toContain(ACTION);
});
Read that as a test of behaviour and it is nonsense: it asserts the spelling of two class attributes. Its own doc says so in the second paragraph, that jsdom computes no layout, so no test in the file can see the pixels. What it is actually doing is holding a conclusion that took a measurement to reach, against the next person who looks at this component and sees an obvious simplification. The simplification is the bug, and the only thing standing between it and main is an assertion that looks pedantic.
the word covered the word it described
A control revealed on hover must not take a line of its own. The desktop’s property row went hidden to flex when you pointed at a block, which added 18pt of height and pushed every row below it down the page. At the boundary between two rows that flickers: the shift moves the next row out from under the pointer, the hover drops, the row collapses, the pointer is back over the first row.
So the at-rest row is positioned rather than laid out, in crates/outl-desktop/src/components/PropertyEditor.tsx:
class={`flex-wrap items-center gap-1 ${
chips().length > 0 || adding() || props.addAffordance === "always"
? "mt-0.5 flex"
: "absolute top-[3px] right-6 z-10 hidden rounded bg-(--color-outl-bg-elev) group-hover:flex"
}`}
Which bought the second defect. Anchored at the right edge of the block’s first line, the button now paints over text, and it spelled + prop. On a wide window most lines reach the right edge, so the affordance for adding a property covered the last word of the line it was floating on: 49.1pt of cover, measured, brought down to 19.6pt by making it a bare +.
Dropping the word is only acceptable because nothing was carried by it. aria-label="Add property" and title="Add a property (Cmd/Ctrl+Shift+P)" were both there the whole time, which the test says out loud rather than leaving to be inferred. The page header keeps + prop, because addAffordance="always" puts it in the flow with a row to itself, where it covers nothing.
The tests here pin the mechanism and not the look, which is the only version worth having:
// `mt-*` on an absolutely positioned row would be dead styling;
// on a flow row it is the gap that pushed the page down.
expect(row(host).className).not.toContain("mt-");
A row that participates in flow is the defect, whatever it is styled like.
seven squares wide is what decides how tall
The sharpest of the three is the one with no screenshot at all, because it only happens on a rotated phone.
A bottom sheet is position: fixed against bottom-0, so its height is whatever its content needs and nothing scrolls it. Content taller than the viewport therefore puts the top of the card above the top edge, unreachable, with the grab handle up there too, so the sheet cannot be dragged shut either. That was reported from a device for the long-press menu, with a photo, and the same shape was live in five more sheets.
The calendar is the case where the arithmetic is unambiguous. Its day cells are aspect-square in a seven-column grid, so width drives height. Landscape roughly halves the height and nearly doubles the width, and both platforms allow it: iOS declares all four orientations, Android handles the config change. On a landscape iPhone the columns come to about 101pt after the safe-area insets and the 12pt gutters, and a month needing six week rows is six of those plus five 4pt gaps. 627pt of grid inside a 402pt viewport, with the month arrows and the first three weeks off the top of the screen.
The fix is max-w-[28rem] on the grid, which is wider than any phone in portrait, so a date cell stays a date cell and portrait does not change at all. The bound itself is a max-height in the style object rather than a utility on a wrapper, because this sheet is the card:
style={{
"max-height": "calc(100dvh - max(env(safe-area-inset-top), 12px))",
An inset-card sheet gets max-h-dvh on its transparent positioned wrapper instead, where the top padding costs nothing while the sheet is short. A top-anchored sheet is already bounded by the gap between its two pinned edges. Three shapes, and sheets.bounded.test.ts carries the per-sheet table of which one each declares:
const CHECKS: Record<Bound, RegExp> = {
dvh: /max-h-dvh/,
"viewport-calc": /"max-height":\s*"calc\(100dvh/,
"top-anchored": /\btop:/,
"vh-cap": /max-h-\[\d+vh\]/,
// Pinned by the reason below, not by an attribute.
"fixed-content": /.^/,
};
every sheet is accounted for reads the directory, finds every component built on the shared slide-up or on a full-screen justify-end flex, and fails on one the table does not list. A sheet with no bound should fail there rather than arrive in a photo.
the table caught itself twice before it caught the code
Writing that table found two bugs, and both of them were in the table.
The first version demanded min-h-0 beside flex-1 on the scrolling region. Four sheets that predate the fix failed it while being entirely correct, because flexbox already drops a flex item’s automatic minimum size to zero when its main-axis overflow is not visible, which a scrolling region always satisfies. The min-h-0 the newer sheets carry is belt and braces. Pinning it would have been pinning a habit.
The second looked only for Tailwind’s overflow-y-auto and missed this client’s own .ios-scroll, which declares the same overflow-y: auto plus the momentum a phone wants. PageSwitcher scrolls through the class alone and failed. So the assertion asks for the region and nothing more:
expect(read(sheet.file)).toMatch(/overflow-y-auto|ios-scroll/);
Two mistakes in a test before it caught anything in the code is a good ratio for this kind of test, and it is the predictable one. A test that reads source text is a test of your own beliefs about the source, and you have more beliefs than the code has behaviours.
824 of 1024, and the rest is margin nobody could see
The fourth one is not CSS at all, and it is the same failure.
The desktop crate and the mobile crate each carried a full Tauri icon set, sixteen files under the same sixteen filenames, generated at different times from different runs. All sixteen differed byte for byte. Nothing could notice: an icon has no test and no compiler, and the two directories are never compared by anything. It was found when a user said outl looked bigger than its neighbours in the Dock.
They were right, and “bigger” is exact. macOS draws app icons on a 1024 canvas where the tile occupies 824 and the rest is transparent margin, at a corner radius of about 22.5% of the tile, so every icon in the Dock shares a silhouette and an optical size. An icon that fills its canvas edge to edge is not oversized by accident, it is drawn at the size its neighbours reserve for margin. Windows and Linux apply no mask and reserve no margin, where the same padding would make outl smaller than everything around it. So scripts/gen-icons.py applies the inset for the .icns alone and leaves the .ico and the loose PNGs full bleed, and it is now the only writer of any of those files.
scripts/check-icons.py runs in hygiene and asks three questions, all from the PNG header, so it needs nothing but the standard library: that the two Tauri sets are byte-identical, that each PNG is the size its filename claims, and that no iOS slot carries an alpha channel, which App Store Connect rejects after the build rather than during it.
What it refuses to check is named in its own module doc: the macOS margin, which is the thing that was actually reported. Verifying that means decoding pixels, and a PNG decoder inside a hygiene script is a worse trade than the generator being the only writer. That is a blind spot by decision, written where the next person meets it.
a harness that points at every row, because no assertion can
The counts at the top of this post are not an indictment of the suite. They are a statement about what a suite is for. So the other half of this change is a way to ask the questions the suite cannot.
.claude/skills/run-desktop/ builds the Linux desktop app in a container, runs it under Xvfb with a window manager, drives it with xdotool, and battery/probe.py asks one question of every visible row: does pointing at it move anything?
def ink_profile(im: Image.Image) -> np.ndarray:
a = np.asarray(im.convert("L"), dtype=float)
return np.abs(a - np.median(a, axis=1, keepdims=True)).sum(axis=1)
Deviation from each row’s own median, not darkness. 255 - luminance measures the background on a dark theme and reports every empty scanline as full of ink, so a battery written that way would stop working the day the default preset flips. With the profile, “the text dances when I hover” becomes “pointing at this row moves everything below it down by exactly 18px”, which names the CSS line responsible.
The readiness check is the same discipline: it polls until two consecutive reads agree on the row count, because the window exists long before the workspace does, and a battery that starts when the window appears measures the splash and reports no rows.
The trigger is the edit rather than anybody’s memory. .claude/hooks/desktop-ux-sweep.sh is a Stop hook that compares the working tree against battery/ux-surfaces.txt, one list read by both the hook and the battery so the two cannot disagree about what counts as a surface. It nudges rather than running, because the battery wants a Docker daemon the machine may not have, and a Stop hook that blocks on docker holds every turn hostage. The stamp it checks against is a content hash and not an mtime, and the comment in surfaces-hash.sh says why: restoring a file from a backup rewrites the timestamp while leaving the bytes identical, and that fired within an hour of the hook being written.
It also caught something nobody had reported. Pressing j sixty times on an 80-row page left the view showing row 1 with the selection about 55 rows below the fold, so j looked like it did nothing. followSelection in crates/outl-desktop/src/lib/keyboard-reach.ts is three lines of scrollIntoView with block: "nearest", keyed on the selected id so every path that moves the cursor inherits it. nearest rather than center because centring on every keypress makes the page lurch under someone stepping one row at a time, and nearest does nothing at all while the row is already visible.
what this does not cover, which is most of the phone
The landscape geometry above is arithmetic on known values, not a rendered measurement. There is no test in this change that has ever seen 627pt. jsdom computes no layout, the container runs the desktop app, and nothing in CI rotates a phone. Rotating one and opening Reminders, Properties, Insert template, Plugins and the calendar is the real check, and the PR asks a reviewer with a device to do it rather than claiming it was done.
The battery is mouse-only, deliberately. Keys reach a focused field in that container through the GTK input method without producing a JS keydown, so document-level handlers never fire and a keyboard assertion there would pass or fail for reasons that have nothing to do with the app. The j finding came from a hand-driven session with a window manager up, not from the battery.
And the red seam, the one this post opens with, has no harness at all. It was found in a screenshot. The phone shots in that PR are the real frontend under ?mock=1 at a 402pt viewport, which differs from a device build in the safe-area insets and the native scroll physics, which are two of the things most likely to put a row on a fractional y. On a client where the webview would not let me attach a debugger at all, the gap between “correct in the mock” and “correct on the device” has cost me a week before.
The shape is one I have hit from the other side recently, when a nonce on style-src ignored a style attribute depending on which DOM call wrote it. There, byte-identical CSS painted through one API and not the other. Here, a box with correct CSS geometry rounds two ways depending on who rasterises it. Both are defects that live entirely downstream of anything a type system, a linter or an assertion about the DOM can reach, and in both the first fix that looks tidier is the one that makes it worse.
The lesson I am taking is not that UI needs screenshot tests. It is narrower: when a defect’s cause is rounding, reflow or an aspect ratio, the test you can write is a test of the declaration, and it is worth writing only if it carries the measurement that justified it. The number goes in the comment. Without it, the next person deletes an odd-looking inset-y-px and ships the red line back.
The battery, the Stop hook and the surface list are in .claude/skills/run-desktop/ in the outl repository.