Files
amethyst/commonsUI
Vitor PamplonaandClaude Opus 5 0dca3cb11b fix(browser): the two things that looked wrong in the pill and the Recent list
**The tile grid stranded its remainder.** Six actions filled a row of four and
left two beside a hole. The rows now share the tiles out evenly — six is 3 + 3,
five is 3 + 2 — and a gap only appears when the count will not divide, which
for seven is 4 + 3 either way. Rows are still padded back out to four where
they draw, so every tile keeps the same width.

`balancedRowSizes` returns the row sizes rather than one column count: the
first shape of this returned a single number and `chunked` it, which quietly
gave 4 + 4 + 2 for ten instead of 4 + 3 + 3. The test caught that, so the
function changed rather than the expectation.

**Two rows in Recent both read "Primal / primal.net".** They are not
duplicates — they are `primal.net/home` and `primal.net`, two pages that
happen to share a `<title>`. The second line was only ever the host, so there
was no way to tell them apart or to know which one a tap would open. It now
shows host and path, minus the scheme and a bare trailing slash:
`primal.net/home` against `primal.net`.

While in there, `BrowserHistoryRegistry` now keys on a normalised URL instead
of the raw string. That is not what caused the pair above, but a trailing
slash, a different case in the host or a leftover `#fragment` would each have
produced a genuine duplicate, and `distinctBy { it.url }` could not see it.

Verified on an SM-T220: the Recent rows read `primal.net/home` and
`primal.net`, and the six-tile pill renders as two rows of three.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-26 20:42:32 -04:00
..