Skip to content

fix(web): link pill shows the distinguishing path, never wraps - #151

Merged
vnykmshr merged 1 commit into
mainfrom
fix/link-pill-display
Aug 7, 2026
Merged

fix(web): link pill shows the distinguishing path, never wraps#151
vnykmshr merged 1 commit into
mainfrom
fix/link-pill-display

Conversation

@vnykmshr

@vnykmshr vnykmshr commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Reported from 1mb-dev/log: the link pill rendered the hostname alone, so two posts pointing at different repositories both read github.com. The path is what carries identity when the host is a platform, so it is kept — and when the result is too long, whole trailing segments are dropped rather than cutting a word in half (example.com/a/very/deep/path, not example.com/a/very/deep/path/th…). All seven bare-domain posts on the reference deployment render byte-identical to before.

Query strings are deliberately not shown. Distinguishing an HN item needs ~34 characters, which overflows the pill's ~32-character budget at 320px, and the card's title already carries primary identity — the pill is secondary context. Recorded in the helper's doc comment so it is a decision rather than an oversight.

Separately, the pill could already wrap or widen the page for reasons unrelated to this change: it was width: fit-content with no bound, no max-width, and no white-space rule. It now caps at its container and truncates on a single line. Verified in-browser on both surfaces at container widths from 256px (the real card width at a 320px viewport) down to 60px — pill height stays at one line box throughout, never exceeds its container, and the arrow never gets squeezed out. min-width: 0 on the text span is load-bearing: a flex item defaults to min-width: auto and refuses to shrink below its content, which silently defeats the ellipsis.

The helper stays registered as extractDomain — operator templates loaded via TEMPLATES_PATH call it by that name, and replace mode means a rename breaks them at render time.

Host-only display rendered every platform link identically — two posts pointing
at different repos both read "github.com". Keeps the path, dropping whole
segments to fit; CSS bounds the pill so no input can wrap it to a second line.
@vnykmshr
vnykmshr merged commit 07ec3ea into main Aug 7, 2026
8 checks passed
@vnykmshr
vnykmshr deleted the fix/link-pill-display branch August 7, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant