# Sweeping the whole site on a cheap phone: dangling separators, layout shift only slow phones see, and tests that fail after 10pm

> I screenshotted all 171 sitemap pages on a Galaxy A21s and scanned layouts at phone width on the desktop. The biggest surprise was layout shift on 11 tool pages, visible only with the CPU slowed 6x.

- Date: 2026-12-01
- Topics: CSS, Performance, Accessibility
- Chinese original: https://kbs0830.com/blog/mobile-sweep-dangling-dots-suspense-cls

Last time I measured the home page and a few key pages on the [Galaxy A21s](/en/blog/galaxy-a21s-real-phone-testing). This time I ran all 171 pages in the sitemap: up to 8 screens captured per page, an accessibility check on the phone, and then a layout scan with desktop Chromium at phone width (411px).

Going through screenshots page by page can catch big problems, but things like "where does the title wrap" or "is the text too small" cannot be seen in thumbnails. So I wrote a separate scan that lets the browser report them itself.

## The dangling "·"

Every page title on this site is in the form "Chinese · English", for example "Posts · Notes" (with the Chinese word for "posts" first). A short title is fine, but a longer one ends up like this:

```text
Private-docs Q&A (Chinese) ·
Private docs Q&A
```

The "·" is stranded at the end of the previous line. The other case is wrapping to the start of the next line, giving "· Accessibility".

How I found them: for each "·", get its position with `Range.getClientRects()`, then compare with the character before and after. If the next character's `top` is lower than the "·", it wrapped and left the "·" at the end of a line; if the previous character is higher than the "·", the "·" sits at the start of a line. 4 of the 171 pages had it.

The fix is an old CSS trick: give every item some room in front for the "·", shift the whole row left by the same width, and clip the container's left side. The first item on each line sits exactly at the left edge, so the "·" in front of it falls into the clipped area.

```css
.dot-list { overflow-x: clip; }
.dot-list > span { display: flex; flex-wrap: wrap; margin-inline-start: -1.4em; }
.dot-list > span > span { position: relative; padding-inline-start: 1.4em; }
.dot-list > span > span::before { content: "·"; position: absolute; inset-inline-start: 0; width: 1.4em; text-align: center; }
```

When a line fits, it looks identical to before. The 1.4em spacing was found by comparing desktop screenshots pixel by pixel; my first try of 1.25em moved the English half 5px to the left. When it does not fit, the English part moves entirely to the next line, with no "·" in front. All 27 page titles use this now, and so do the class-number list and the radar cards.

I used `overflow-x: clip` instead of `overflow: hidden` because I only wanted to clip left and right; with `hidden`, the top and bottom edges of the text might get cut too.

## Titles that wrap in the middle of a word

Chinese titles often break in the middle of a word, for example a title about the flight distance from Kaohsiung to Tokyo (Narita) splitting inside the airport name, or a department name splitting after its first character. The site already has a `<Phrase>` component: on the server it uses `Intl.Segmenter` to split words, inserts `<wbr>` between them, and pairs that with `word-break: keep-all`. The problem was that some places did not use it.

I found them the same way, by letting the browser report: browsers have `Intl.Segmenter` too, so I split each title into words and checked whether the characters of one word ended up on different lines. Across h1 to h4 there were 27 places: the big titles of 10 tool pages and 17 subheadings in posts.

Post subheadings are generated by MDX, so the `h2` and `h3` components now automatically wrap the text part in `<Phrase>`, leaving inline code and links as they are. The dictionary also splits wrongly sometimes: the Chinese name of New Chitose airport gets split in the wrong place, so I added it to a do-not-split list.

## 10px text

The site has a set of small monospace labels (for example "related small tools · Japan") that are 10px on desktop. On phones, 10px is below the minimum of 11 recommended by iOS and Material Design. These labels appear on 77 pages, and one of them, "all 29 →", is also a link, so its tap target was too small as well.

The fix is 11px on phones and 10px on desktop: `text-[11px] sm:text-[10px]`. On this site, phone adjustments always apply only below 640px, and desktop screenshots have to be compared to confirm nothing changed.

## Layout shift only visible on slow phones

The most unexpected result of the phone sweep was this: 8 tool pages had layout shift (CLS 0.016 to 0.081), and on every page the thing being pushed was the same, the explanatory text under the tool. Measured on desktop, all of them were 0.

The cause is related to Next.js Cache Components. These tools read parameters from the URL (`useSearchParams`), so the component can only be rendered in the browser, and the page wraps it in `<Suspense>`. In the HTML the server sends, the tool's spot is just an empty block 320 to 480px tall, which is replaced by the real tool only after JavaScript loads and hydrates. The converter is actually 726px tall, so the text below got pushed down by over 400px.

A fast desktop CPU finishes hydration before the first paint, so you never see the empty block. On the A21s, the empty block is painted first and replaced about 1.2 seconds after loading starts (the 8 pages measured 1.16 to 1.56 seconds).

The way to reproduce it on the desktop is to throttle the CPU with CDP: `Emulation.setCPUThrottlingRate` with `rate: 6`. With a 6x slowdown the numbers are nearly the same as on the A21s; the era page gets 0.081.

The fix is direct: set the height of that empty block to the real height after the tool loads. To measure it, open the same page twice, once with JavaScript off and once on, and compare how far the text below moves; that difference is the height the placeholder was missing. Measured once for phone and once for desktop, written as `min-h-[726px] sm:min-h-[496px]`. The cap is 900px: however long a tool gets, the explanatory text below is already beyond the first screen, so being pushed does not count as a shift.

After the change, with 6x throttling over 11 pages: 10 were 0, and the yen price comparison was left with 0.002.

## A test that only fails late at night

After the fixes, I ran the whole E2E suite, and a few tests for the home-ops dashboard failed: "all normal" could not be found, and the accessibility check also caught a clock with insufficient contrast. Running the original `main` failed the same way.

The screenshot showed only a very dim "00:04". The dashboard has a burn-in protection design: from 22:00 to 06:00 Taiwan time it shows only a dimmed clock. I had run the tests after midnight; run in the daytime they pass.

The fix is to pin the browser clock to 2 p.m. in the test:

```ts
await page.clock.setFixedTime(new Date("2026-11-30T14:00:00+08:00"));
```

Two other tool tests were flaky: the words they looked for (the labels for the old system and "about 83%") also appear in the explanatory paragraph below, and Playwright's strict mode fails when it finds two. Searching for the sentence of the result itself fixed it.

## How to use these going forward

- `node scripts/ui-scan.mjs`: scans the sitemap on the desktop at 411px, finding dangling "·", mid-word title breaks, text under 11px, and axe problems (including WCAG 2.2 target size). About 3 minutes for 171 pages
- `node scripts/phone-check.mjs --sitemap --quick --axe`: screenshots every page on the A21s and runs the accessibility check, about 20 seconds per page

The two have different roles. The desktop scan is fast, but its fonts differ from Android's, so line-break positions differ slightly; the phone scan is slow, but what it sees is what visitors see. The tool-page shift this time could only be caught by the phone one.

---

Author: PINGWEI LI (李秉威, Li Ping-Wei)
Original page: https://kbs0830.com/en/blog/mobile-sweep-dangling-dots-suspense-cls
