After pressing every button on the A21s, this time I ran all 174 pages in the sitemap on a phone, once in light mode and once in dark. The automated results were clean:
| Item | Result |
|---|---|
| HTTP status | 200 on all 174 pages |
| axe accessibility check | 0 |
| Horizontal overflow | 0 |
| Text under 11px | 0 |
| Layout shift (CLS) | 0.002 at most |
But when I laid the screenshots out as an overview, quite a few places still looked off. This post is about what I found and how.
Ruling out noise first: 5 "failed requests" on every page
Every page's report said "failed requests: 5", and at first I assumed the site had a problem. Listing the URLs, all 174 pages had the same five:
- Online count
/api/presence, twice - Web Vitals
/api/web-vitals, twice - Cloudflare's
/cdn-cgi/rum, once
These are all sent with sendBeacon when the page closes. The test script closes the tab right after measuring, so of course the requests get interrupted. I tried making Web Vitals return 204 to hide them, but it failed the same way: the tab was gone before the request finished. In the end I made it ignore any request after the tab starts closing; normal browsing does not have this problem.
White space 1: the reserved height was taller than the content
The most obvious one was the Japanese consumption tax converter. A big gap appears under the result before the explanatory text begins.
The cause is that this kind of tool reads URL parameters (?yen=1000), which in this site's rendering mode can only be drawn in the browser, so the server sends an empty placeholder first. If the placeholder and the real content differ in height, the content below jumps on load. So I had originally put a fixed min-h-[360px] on the component's outer element, to keep the height identical before and after loading.
Measured, the content is nowhere near 360px:
| Width | Actual content | Reserved | White space |
|---|---|---|---|
| Desktop | 176px | 360px | 184px |
| A21s (411px) | 251px | 360px | 109px |
| Desktop Chromium at 411px | 333px | 360px | 27px |
At the same 411px width, the A21s and the desktop emulation differ by 82px. The difference is in the two button groups ("price is" and "tax rate"): the A21s font is narrower, so both groups fit on one line, while the desktop emulation cannot fit them and wraps to two lines. A 390px-wide iPhone wraps too. The height depends on the phone's font, which is why I could only write one big safe number.
The fix was to make the height fixed first, then reserve the real height:
- On phones the two button groups always take one line each, whatever the font width, so the height is always the same.
- The component itself loses its
min-h, and only the placeholder gets the measured height (316px on phones, 175px on desktop).
After that I compared at six widths (360, 375, 390, 411, 768, 1280), with JavaScript off (placeholder only) and on (tool loaded): the position of the text below differs by at most 1px.
Several other tools had the same situation. Their reservation was meant for "a result that appears after a click":
| Tool | Reserved | Content before any interaction |
|---|---|---|
| Crawler check | 420px (plus another 420px from the outer tab) | 107 to 158px |
| Base64, URL, JWT | 420px | 253 to 289px |
| PowerShell mojibake check | 360px | 143px |
When a result appears and pushes things down, the user caused it by clicking, so it does not count as layout shift (shifts within 500ms of a user action are excluded from CLS). So those safeguards only gave every visitor a big blank area on arrival, and I removed them all.
White space 2: cell count does not match column count
The "visitors" group on the year-in-review page has 3 numbers. Phones lay them out in 2 columns and desktops in 4, so one cell is always empty. The grid lines show through from the background color, so the empty cell exposes the whole background and looks like a gray block.
Now the last cell stretches to fill its row, and the desktop column count follows the cell count: 3 cells make 3 columns.
What thumbnails cannot show: one character per line
In the posts' tables, the first column on a phone looked like this:
(That is an English rendering of the effect. In the real table, the first column held a short Chinese label and each character sat on its own line.)
Between Chinese characters, every position is a legal line break, so the minimum width of this column is a single character. Automatic table layout also hands almost all the extra width to the columns with long content, and the label column gets squeezed to one character wide.
This problem is only visible when you zoom into the screenshot, and looking at 174 pages one by one is not realistic. So I added a check to the existing phone-width scan: for every table cell, definition list and button, measure with Range.getClientRects() which line each character is on, and find two situations:
- One character per line: at least two lines that hold a single Chinese character
- Orphan: short text of three lines or fewer whose last line holds just one character
Only automatic wrapping within the same text node counts; two blocks each taking a line do not. Otherwise a deliberately stacked label like "20004KT (line break) wind" would be a false alarm. Lines clipped by line-clamp also have to be excluded, since their text is invisible but still has a position.
The first scan at 411px found problems on 19 pages. Besides the post tables:
- In the Fukuoka weather table, a two-character word for "cloudy" was split across two lines
- The "insert example" button (three Chinese characters) wrapped with its last character alone on a second line
- In the airport passenger table, the Chinese name of Taiwan Taoyuan International Airport broke before its last character
- On the radar, the unit in "1 aircraft" dropped to the next line
Which fix for which case
Each case used a different fix:
| Case | Fix |
|---|---|
| Labels in the first column of post tables | word-break: keep-all, so Chinese characters cannot break by themselves, only at spaces and punctuation; applied only to the first column, with long sentences in later columns wrapping as usual |
| Very short text that will not grow (weather, buttons) | white-space: nowrap |
| Full airport names | On the server, split into words with Intl.Segmenter, insert <wbr> between words, then add text-wrap: balance, which breaks it as "Taiwan Taoyuan / International Airport" |
| Orphans in other cells | text-wrap: pretty |
The last one is a one-line CSS change. The site had text-wrap: pretty only on p and li; I added td, th, dd and dt. In testing, cases like a two-character word split across lines were fixed.
One exception: the labels in the stats cells are followed by a "?" help button, and pretty misjudges them, so the last line still holds a single character. Those use balance instead, splitting two lines evenly.
After all of that, I scanned the 192 pages on the live site (including the newly launched English pages) at 411px and 360px, and found nothing.
Two more phone-only problems
- Election map: on phones there is a fixed county drawer at the bottom. The spacing for it was added under the map component, but related tools and the footer come after it, so when scrolled to the bottom, the footer links were covered by the drawer in a row. The spacing now goes at the very bottom of the page, and the "back to top" button at the bottom right moved above the drawer
- METAR flight weather categories: the table needs horizontal swiping on phones, and the entire third column was off screen. On phones each row is now stacked vertically; desktop keeps the table
Summary
This time every automated check was 0, yet a dozen or so places still "looked wrong". Most were not errors: to avoid some other problem (jumping on load, tables stretching), I had picked a conservative way of writing things, and the side effect was white space and broken words.
Whatever I could write as a rule went into the scan. The next time I change the layout, one run tells me whether there is a new one-character column, with no need to rely on staring at screenshots.