fix(web): link pill shows the distinguishing path, never wraps - #151
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported from
1mb-dev/log: the link pill rendered the hostname alone, so two posts pointing at different repositories both readgithub.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, notexample.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-contentwith no bound, nomax-width, and nowhite-spacerule. 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: 0on the text span is load-bearing: a flex item defaults tomin-width: autoand refuses to shrink below its content, which silently defeats the ellipsis.The helper stays registered as
extractDomain— operator templates loaded viaTEMPLATES_PATHcall it by that name, and replace mode means a rename breaks them at render time.