From a2aa1352fbd21327f4796374518cc20d381f37d8 Mon Sep 17 00:00:00 2001 From: Roland Date: Thu, 30 Jul 2026 19:08:44 -0600 Subject: [PATCH] ui: Statistic and StatisticGroup, and the four defects they had These three exports had no test of their own. Statistic had already been caught out once -- it relied on Semantic's `Statistic.Group` for its spacing, so it broke silently when that was uninstalled -- and they are on the Status, Dashboard, Apps, Docs, Videos, Archive and Channels pages. Four defects, each with a test that goes red without the fix: * StatisticGroup ruled between columns only, with a `border-right` on every cell but the last. `auto-fit` wraps, so the seven statistics on the Docs page became four rows on a phone with no rule between them, and the cell ending each earlier row drew its border straight onto the group's outer one, making that edge 2px on the right and 1px on the left. The hairlines are now a 1px grid gap filled by an outline on each cell, which rules both axes however the tracks fall. Ruling the gaps with a border-coloured background behind the grid -- which is where this went first -- has the same reach but paints every track no cell landed in: an odd count left the last slot a solid grey block. An outline is drawn only where a cell is. Both of these are guarded, because the second was introduced while fixing the first. * A statistic that renders nothing left a padded cell and a stray hairline mid-row. FanRPMStatistic returns null on a device with no fan connector, which is most of them, so this was the Status page's normal appearance. The group cannot render a child to find out, so the cell is still emitted and `:empty` takes it out of the grid -- which is why the cells carry no inline style for that rule to have to outrank. * Statistic destructured five props and dropped the rest. LoadStatistic and the four Status wrappers all end in `{...props}`, so anything passed through a wrapper vanished with no error anywhere. * VideosStatistics passed `style={{margin: '2em'}}` to every statistic, Semantic-era spacing that the grid now provides. It beat the group's own rule, being inline, and made that one page's statistics sit differently from the six others. CardGroup was the only component in the library with no class of its own, which left nothing to assert against -- `container.firstChild` in jsdom is Mantine's injected