Repository navigation
fix(web): clip a restore profile name only when it overflows - #4848
Conversation
Clipping every profile name, even with room around the clip, trimmed letters whose ink reaches past their edge in some settings: a hooked letter with Firefox's minimum font size raised, for one. The name's label now measures itself and clips only while its text is wider than the row, which happens only for a run no line break can split. A name that fits is never clipped, and an overflowing one is cut at the row's edge. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 1 minute. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed 8fb2a5c)
One nit, inline. I also checked whether a plain CSS clip on an ancestor could replace the measurement. It can't: any box whose start edge sits ahead of the label also holds the checkbox, so it would clip the checkbox's focus ring. The measured approach is justified. I found no breakage in disabled or locked profiles, the status lines under the row, or RTL, and no other caller or client is affected.
When a profile name overflows and is clipped, a first letter whose ink reaches before its box, such as a leading "j", lost about 1 px of it (2 px in Firefox with a raised minimum font size). While the name is clipped, the label now has 0.25em of start padding offset by a negative margin, so the clip begins before the text. The end of the clip stays at the row's edge, and names that fit are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (the backup restore screen is web admin only)
#4755 clips a restore profile name that no line break can split, such as a long run of
emoji joined by zero-width joiners, at the row's edge. It clips every profile name's label,
with 0.25em of padding around the clip so letters that reach past their edge stay whole.
In Firefox that isn't enough, and ordinary names that fit lose ink: a Thai name at 1×, and
with a raised minimum font size the hook of "ƴ" in "Maryƴ". Firefox's minimum font size
draws the text larger but leaves the label's computed size at 14 px, so the padding stays
3.5 px. This change clips the label only while its text is wider than the row.
Approach
ProfileRowmeasures the name's label in a layout effect (scrollWidth > clientWidth + 1)and again whenever a ResizeObserver reports a new size, and adds
overflow-x-cliponlywhile the name overflows. The always-on padding and negative margin go away. A name that fits is
never clipped in any browser or setting, and a name that overflows is cut exactly at the
row's edge instead of 0.25em past it. The measurement follows the pattern in
DetailOverview, with the same guard for a missing ResizeObserver.While a name is clipped, the label also gets 0.25em of start padding offset by a negative
margin, so a first letter whose ink reaches before its box (a leading "j") stays whole;
the overflow only runs past the end edge, where the cut stays flush.
Limits: the observer watches the label's box, so if the text grows wider without the box
changing size (a web font arriving after the row is shown), the clip waits for the next
resize. The start padding is sized from the label's computed font size, so in Firefox with
a raised minimum font size, a name that overflows can still lose part of a hooked letter at
its start edge (for example "Maryƴ" followed by the emoji run, right to left, with a 24 px
minimum). Start room equal to the checkbox gap (
-ms-3 ps-3) would cover it.Validation
(default and with a 24 px minimum font size), WebKit, and Chromium, left to right and
right to left:
maintrims "Maryƴ" and a Thai name in Firefox; with this change noordinary name differs from the same label with no clip, and only the emoji and mixed
names are clipped.
scrollWidthwithoverflow-x: clipapplied, after a frame and in a ResizeObserver callback, so the clip doesn't turn itself
off.
mainand then from this branch, with restorableprofiles named "jasper", "మంగళ", two 64-character names, a joined-emoji name, and a name
mixing words with that run: the Users section with every account open is byte-identical
at 320, 360, 1024, and 1440 px and in Arabic. The emoji run now ends at the row's edge
(x = 639 against an edge at 640 at 1024 px; before, x = 643).
admin-backupstests pass. No testis added: jsdom has no layout, so the measurement can't run there.
Evidence
Surface and build: web admin, Backups › Restore › Choose › Users, before
main27420da, after 8fb2a5c.Evidence: https://evidence.siloserver.org/r/silo-server/restore-profile-name-clip-when-overflowing/
Risks
None identified. The measurement runs once per profile row when an account's profile list
is opened, and again only when a row changes size.
Checklist
Council review
Rounds: 1, reviewed 8fb2a5c (f7eecdd adds start padding while clipped)
Visual review: 1 round, captures from 8fb2a5c
Fixed: Opus (and Sol, for "Maryƴ" at the start edge in right-to-left text) found that an overflowing name starting with a "j" lost about 1 px of it (2 px in Firefox with a raised minimum font size); f7eecdd adds start padding while clipped, verified whole in all three engines, both directions, apart from the case under Limits. The evidence names the Thai difference (the top of a tone mark) and adds a Firefox capture of the overflowing name. Answered: Gemini reported the emoji run still overhanging narrow rows by 12-13 px; measuring the captures, the run ends exactly where every other element on the page ends (x = 343 at 360 px, 303 at 320 px, and 16 at the start edge in Arabic). A fade over the cut would also fade the ends of a mixed name's word lines, so the clip stays a straight cut.
AI Disclosure
overflow-x: cliphides the overflow fromscrollWidthand so turns the clip off; running it in all three engines showed it doesn't. The plan round was skipped as a mechanical fix. Background and visual review results are under Council review.🤖 Generated with Claude Code
Note
Clip restore profile names in
ProfileRowonly when they overflowAdds an overflow measurement to the profile-name label in RestoreUsers.tsx. The label compares
scrollWidthtoclientWidth(with a 1px tolerance) in a layout effect, then remeasures viaResizeObserverwhen available. Horizontal clipping and start-side padding are now applied only when the measured name overflows; thetitleattribute still shows the full name.Macroscope summarized f7eecdd.