Repository navigation
fix(web): clip restore names only while they overflow - #4987
Conversation
#4921 clipped the Choose step's library heading, the plan lists on the Choose and Review steps, the Review step's left-out list, and the Run report's rows sideways at all times. Firefox clips `overflow-x: clip` vertically too, so names that fit lost the marks above and below their line there: Thai and Vietnamese marks at the larger Text Size or with a minimum font size. Each of these now clips only while its text is wider than its box, through the shared useOverflowsInline hook and a new OVERFLOW_CLIP class list that the other restore rows can share. The hook now measures where the text lays out instead of scrollWidth, which counts an inline margin: Firefox lets the gap after a name hang past a line's end, so a name that fit read as overflowing at some widths. A clipped name now stops at the box's end edge. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
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. |
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:
|
…-overflowing # Conflicts: # web/src/pages/admin-backups/RestoreReview.tsx
#4982 clipped the Choose step's selection notice sideways at all times, which in Firefox also trims the marks above and below its lines. It now clips only while a name in it can't wrap to fit, like the other restore clips. 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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed 1eefc69)
This pass looked for parts of the change the problem doesn't need. Two findings, both on lines in this diff.
- O1 (pre-existing, limits the fix): at
lgand wider, the selection notice's own scroll box still cuts the marks this PR restores. - O2 (nit): the
max-widthinOVERFLOW_CLIPhas no effect at any of the five places that use it.
Checked with no finding:
- Every hook call is needed, since each place can show a name.
- The jsdom guard is needed, because jsdom's Range has no
getBoundingClientRect. - The
activeflag and listener cleanup are correct. - Bullets don't cause false overflows:
::markerboxes aren't in the Range, and each<li>border box spans exactly the list's content box. cnmergesps-[0.25em]withpy-3.5without conflict.- ItemRow and AccountRow get the same verdict as with
scrollWidth, truncated one-line rows included. - SameRow is the only always-on clip left on these screens, and the PR says a later change converts it.
- I also looked at the font-load re-measure. Plus Jakarta Sans is the only web font, and almost every place breaks anywhere, so a font load can rarely change the answer. The Run report's data lines don't set
wrap-anywhere, though, so I didn't count the re-measure as unneeded.
Written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, as an automated review.
| @@ -732,13 +736,14 @@ export function RestoreChoose({ | |||
| tabIndex={noticeScrolls ? 0 : undefined} | |||
| className="overlay-scroll focus-visible:outline-ring -mx-[0.25em] rounded-sm px-[0.25em] text-[13px] wrap-anywhere text-amber-600 focus-visible:outline-2 focus-visible:outline-offset-2 lg:max-h-32 lg:min-h-0 lg:overflow-y-auto dark:text-amber-400" | |||
There was a problem hiding this comment.
O1, pre-existing (limits the fix): at lg and wider, this notice's own scroll box cuts the marks the span change restores.
Trigger: any notice whose marks rise above its first line or drop below its last at a width of lg or more. These are the same names and settings the PR fixes (Vietnamese at x-large Text Size, Thai with a large minimum font size).
Impact: at lg this <p> gets overflow-y: auto, which makes it a scroll container, and it has no padding in the block axis. The span is its only child: a block with no vertical margin or padding, so the span's box lines up with the <p>'s padding box. A scroll container clips ink at its padding box in both axes in every engine. Any pixels the old span clip cut vertically are therefore still cut by the <p> at lg, in Chromium and WebKit as well as Firefox. The fix only takes effect below lg.
Evidence: I built a fixture of a block span inside a <p> with inline-only padding, 24px Vietnamese text, and line-height 1 and 1.2, in Firefox 153, Chromium and WebKit. With overflow-y: auto on the <p>, the topmost ink row moved from 2 to 6 px above the box to the box's top edge, and the ink pixel count dropped by 1.5 to 7%. At line-height 1.5, where nothing rose above the box, all three variants rendered the same.
Suggested repair: give the notice room in the block axis inside its scroll box, for example lg:-my-[0.25em] lg:py-[0.25em]. That moves the scroll box's clip edge past the first and last lines, and useScrolls still compares heights the same way. If that room isn't enough for the minimum-font case, say in the PR that the notice is still cut at lg.
There was a problem hiding this comment.
Agreed this is real at lg and up, and it predates this PR: the notice became a scroll container in #4797, and a scroll container clips its content on every side in every engine, whatever the inner span does. This PR only stops the inner span from adding a cut of its own. A follow-up run is confirming whether the app's real font size, line height, Text Size and minimum font size reach it, and will fix it in its own pull request if they do.
🤖 Claude Code (claude-opus-5-5)
| * fit inside a box otherwise capped at `max-w-full`, so the cut stays flush with its | ||
| * container. | ||
| */ | ||
| export const OVERFLOW_CLIP = "-ms-[0.25em] max-w-[calc(100%+0.25em)] overflow-x-clip ps-[0.25em]"; |
There was a problem hiding this comment.
O2, nit: the max-width in OVERFLOW_CLIP changes nothing at any place in this PR.
Trigger: none. The doc comment says the wider max-width is for a box "otherwise capped at max-w-full", and none of the five places that use the constant has that cap. They are the library heading (a flex item inside an inline-flex button), the Run report's row column (flex-1), the notice span, and the "Left out" list (both auto-width blocks). PlanSentences uses plain overflow-x-clip. An auto-width block with -ms-[0.25em] is already exactly 100% + 0.25em wide, and a shrinking flex item ends at its container's edge.
Evidence: I laid out a 21-emoji ZWJ run in each of the four shapes in Firefox, Chromium and WebKit, in LTR and RTL, with and without max-w-[calc(100%+0.25em)]. The left and right edges of every box matched to 0.01 px.
Suggested repair: drop max-w-[calc(100%+0.25em)] and the sentence about it, so the constant matches ProfileRow's -ms-[0.25em] overflow-x-clip ps-[0.25em]. Add it with the ItemRow/AccountRow change, which has the max-w-full it is meant for.
There was a problem hiding this comment.
Right, none of the places in this PR is capped at max-w-full, so the max-width does nothing here. It's in the shared constant for the item and account rows, whose labels are capped at max-w-full; the run converting those to OVERFLOW_CLIP (tracked in #4946) asked for this exact value so every restore clip matches. Keeping it.
🤖 Claude Code (claude-opus-5-5)
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (Gemini 4 Neon, reviewed 1eefc69)
One finding on the Choose step's selection notice (web/src/pages/admin-backups/RestoreChoose.tsx:737). The Range.getBoundingClientRect() measurement in useOverflowsInline.ts, the document.fonts.ready and loadingdone listeners (including WebKit's missing loadingdone), the OVERFLOW_CLIP box math, the existing ItemRow/AccountRow callers, and the merged #4970 and #4982 behaviors held up across Chromium, Firefox, and WebKit.
AI disclosure: Gemini 4 Neon in Antigravity (T3 Code).
| @@ -732,13 +736,14 @@ export function RestoreChoose({ | |||
| tabIndex={noticeScrolls ? 0 : undefined} | |||
| className="overlay-scroll focus-visible:outline-ring -mx-[0.25em] rounded-sm px-[0.25em] text-[13px] wrap-anywhere text-amber-600 focus-visible:outline-2 focus-visible:outline-offset-2 lg:max-h-32 lg:min-h-0 lg:overflow-y-auto dark:text-amber-400" | |||
There was a problem hiding this comment.
G1 (Medium): Choose notice <p> still clips tall marks vertically at lg and wider
- Trigger: An ordinary fitting selection notice at viewport width
>= 64rem(lg) whose first or last line has marks extending past the line box, such as Vietnamese inPlus Jakarta Sansatx-largeText Size (16.12px,line-height: 1.5) or Thai under Firefox's24pxminimum font size. - Impact: Making
OVERFLOW_CLIPconditional on the inner<span>stops Firefox'soverflow-x: clipvertical trimming belowlg, but<p>keepslg:overflow-y-autoon at all times with zero vertical padding (px-[0.25em], nopy-*). Per CSS Overflow 3 § 3.1,overflow-y: autoforcesoverflow-x: autoand clips all paint outside<p>'s padding edge in Firefox, Chromium, and WebKit. On desktop (lg+), the Choose notice still loses the top mark pixels that commit1eefc69aims to keep intact. Comparing the inner<span>against a plain<span class="block">inside the same<p>reads pixel-identical atlgonly because<p>already clips those pixels in both cases. - Evidence: Measured on the notice markup with
Plus Jakarta Sansatx-large(16.12px,line-height: 1.5) forAlso chose Ẫ Ệ Ổ Ứ Ữ Ắ Ằ Ẳ Ẵ Ặ:- Below
lg(nooverflow-y: auto): non-white ink pixels above the first line box = 8 (Firefox), 30 (Chromium), 10 (WebKit). - At
lg(currentlg:overflow-y-autoon<p>, inner<span>unclipped): 0 in all three engines. - Under Firefox
24pxminimum font size with Thai (13px,line-height: 1.5): 15 pixels above the first line box belowlg, 0 atlg.
- Below
- Suggested repair: Apply
lg:overflow-y-autoonly whilenoticeScrollsis true (keepinglg:max-h-32 lg:min-h-0on<p>, which still reportsscrollHeight > clientHeightwhen content exceeds8remacross all three engines, and running an initial check inuseScrollson attach) so fitting notices have no vertical clip at any font size. To protect scrolled notices as well, or avoid togglingoverflow-y, addlg:-my-[0.25em] lg:py-[0.25em]on<p>and switch its parent (line 731) fromspace-y-4toflex flex-col gap-4sospace-y-4'smargin-bottomdoes not override-my-[0.25em]. That restores exact pixel parity with the unclipped notice across Firefox, Chromium, WebKit, and Firefox24pxminimum font size while keepingscrollHeight <= clientHeighton short notices andscrollWidth === clientWidthwhen a name overflows.
There was a problem hiding this comment.
Same finding as O1 above, so I answered it there: it predates this PR (the notice became a scroll container in #4797), and a follow-up run is confirming it under the app's real settings before fixing it in its own pull request.
🤖 Claude Code (claude-opus-5-5)
The name sample and the full list clipped sideways at all times. Firefox clips `overflow-x: clip` vertically too, so ordinary Thai and Vietnamese names lost the marks above and below their line. Both now clip only while a name can't wrap to fit, through the useOverflowsInline hook and OVERFLOW_CLIP from #4987, as the rest of the restore screens do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed 1eefc69)
I checked the overflow measurement, clip boundaries, and hook lifecycle. Browser fixtures with Chromium, Firefox, and WebKit covered wrapping and direction. I reproduced one Firefox report regression and recorded it inline.
AI disclosure
OpenAI Codex in T3 Code, gpt-6.2-sol at xhigh, performed this independent review and used Playwright for the browser and pixel checks. The finding is open.
| {/* Only while a line is still wider than the row after wrapping, such as one holding a | ||
| long run of joined emoji in a name or a note, does the row clip sideways at its end | ||
| edge; the words around the run still wrap, and a name's title shows it in full. */} | ||
| <div ref={columnRef} className={cn("min-w-0 flex-1", columnOverflows && OVERFLOW_CLIP)}> |
There was a problem hiding this comment.
S1 [P3] Keep a fitting account name clear of the profile’s clip
An overflowing profile name turns on clipping for the entire report column. In a Firefox Nightly 153 fixture with the shipped Plus Jakarta Sans font, Extra Large text size, and Bolder text weight, Nguyễn Lương Huỳnh Thị Vĩ fits in a 225 CSS px column with a 224.77 px layout box. A profile name made from 21 U+200D-joined emoji turns on the clip. The new flush edge cuts off the right tip of the tilde. A pixel comparison at 2× scale showed 12 pixels of the tilde missing compared with the old classes, which gave the ink 5 CSS px of end padding.
Clip the overflowing profile line in its own box so the account heading can keep its full glyphs.
…ox (#4908) * fix(web): keep an omitted account's name that can't wrap inside its box An account name holding a run no line break can split, such as emoji joined by zero-width joiners, ran past the name sample in the omitted-accounts warning and spilled into the next column of the expanded name list. Clip it sideways at its own box with the 0.25em bleed the restore screens use, and give each list item its full name as a tooltip, as well as the sample when it is the only place the names appear. Other names render as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(web): clip an omitted account's name only while it overflows The name sample and the full list clipped sideways at all times. Firefox clips `overflow-x: clip` vertically too, so ordinary Thai and Vietnamese names lost the marks above and below their line. Both now clip only while a name can't wrap to fit, through the useOverflowsInline hook and OVERFLOW_CLIP from #4987, as the rest of the restore screens do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(web): keep an omitted account's name in one column of the list A name split across two columns of the expanded list measured as fitting, because its overflow check saw the union of both pieces, so a name holding a run no line break can split could still paint over the next column. Each name now stays in one column, where the check sees its overflow. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(web): import useOverflowsInline from its new hooks path Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Problem
Related issue: #4946
Validation tasks: none
Other clients: N/A (backup restore is only in the web admin)
#4921, and then #4982 for the Choose step's selection notice, clipped six places on the backup restore screens sideways at all times, so that a name holding a run no line break can split (many emoji joined by zero-width joiners) stays inside its box. Firefox clips
overflow-x: clipvertically too, so ordinary names that fit lost the top of their highest marks there. Live, at the x-large Text Size, a Vietnamese name on the Run report lost the top one to two pixel rows of its stacked diacritics, and with a 24 px minimum font size Thai names lost the top row of their tone marks. Chromium (checked live) and WebKit (checked in a fixture) were unaffected. This change clips each of those places only while its text is wider than its box, so a name that fits draws exactly as it did before #4921, and the emoji run still stays in its box.The six places: the Choose step's library heading, its summary panel's plan list and selection notice, the Review step's plan lists and "Left out" list, and the Run report's rows. #4946 also lists the Choose step's "match this server" rows; another pull request covers those.
Approach
useOverflowsInlinehook (fix(web): clip restore item and account names that can't wrap #4849) and adds the clip classes only while it overflows. The heading, the notice, the "Left out" list and each report row use a new sharedOVERFLOW_CLIPclass list: fix(web): clip a restore profile name only when it overflows #4848's start-side room for a first letter whose ink reaches before its box, and a cut flush with the box's end edge. The plan list adds onlyoverflow-x-clip, since its start padding already holds the bullets.scrollWidth.scrollWidthcounts an inline element's margin, and Firefox lets a trailing margin, such as the gap after the heading's name or a report profile's name, hang past the end of a line, so a name that fit read as overflowing at some widths and would have been clipped again.document.fonts.ready, and theloadingdoneevent, which WebKit doesn't fire). The hook returns "fits" where there's no layout, as in jsdom.Web only, in
RestoreChoose.tsx,RestoreReview.tsx,RestoreRun.tsxanduseOverflowsInline.ts. No API, text, or translation changes.Validation
scrollWidthread 93 of 5,194 in Firefox), caught all 496 real emoji overflows, and gives the same answer with the clip on or off. A font served late widened a name from 115 to 181 px;document.fonts.readyresolved after it in all three engines.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/restore-clip-when-overflowing/
Risks
A plan list clips as a whole while one of its sentences overflows, so in Firefox the marks above its first line and below its last can still be trimmed while a list holds an unbreakable name. Each measured element adds a resize observer; a Run report has one per row.
Checklist
Council review
Plan round: skipped; this follows the merged pattern from #4848 and #4849. Code review at high (three finders) led to clipping the report's whole row only while it overflows instead of each name line, so data notes stay covered, and to the measurement change after a margin probe confirmed Firefox's trailing-margin overflow. A finding from #4849's review led to the font-load re-measure.
Background review: 1 round, on 1eefc69, finished after merge
Follow-ups: Sol's S1, a report row clipping as a whole while one line overflows, which trims a fitting account name's tilde in Firefox at the largest Text Size: caused by this PR, fixed in a follow-up pull request that clips each overflowing line instead. Opus's O1 and Gemini's G1, the notice's own scroll box cutting marks at
lgand wider in every engine: predates this PR (#4797), handled by a follow-up run. Opus's O2, the max-width inOVERFLOW_CLIP: kept for the item and account rows, which are capped atmax-w-full.Visual review: 1 round, on captures from 6cc9f09b (the head adds only the font-load re-measure and the jsdom guard)
Answered: the one- and two-pixel cuts were hard to see at 4× (Opus), so the evidence adds images that mark every pixel that differs; the Thai heading's cut is 4 faint pixels and the evidence says so. Crop framing notes (Sol, Opus) are covered by the report pairs, which show the run stopping at the content edge.
AI Disclosure
🤖 Generated with Claude Code
Note
Clip restore text only when it overflows in admin-backups pages
textOverflowsmeasurement function in useOverflowsInline.ts that uses a DOM Range to compare text bounds against the element's content box, with a one-pixel tolerance, instead of comparing scroll and client widthsOVERFLOW_CLIPclass and applies it conditionally inRestoreChoose,RestoreReview, andRestoreRun, replacing always-on horizontal clipping and its negative-margin/padding treatment; text that fits is no longer clippedscrollWidth/clientWidth, so elements whose text extends past either content-box edge are treated as overflowing; checktextOverflowsand theOVERFLOW_CLIPconstant if row layouts shiftMacroscope summarized 1eefc69.