Repository navigation
fix(web): clip restore item and account names that can't wrap - #4849
Conversation
A restore row's name that holds a run no line break can split, such as emoji joined by zero-width joiners, ran past its row on the Choose step in narrow rows. Item names (libraries, collections, home sections, plugins), account names, and an account's "Merge into" line now clip that run sideways at the row's edge, as profile names do since #4755. Every other name renders as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 36 minutes. View limit details
|
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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gemini-4-neon, reviewed d23e1f4)
The diff itself (RestoreRows.tsx and RestoreUsers.tsx) checks out: @max-2xl: (width < 42rem) and @2xl: (width >= 42rem) partition the container width cleanly, overflow-x: clip leaves overflow-y as visible without creating a scroll container, -mx-[0.25em] / px-[0.25em] emit symmetric margin-inline / padding-inline, cn keeps all four @max-2xl: utilities alongside Label's defaults, and <Label> stretches across the flex-col cross axis below @2xl.
Three remaining places on the Choose step still overflow with unbreakable names (none sit on changed diff lines, so they are listed here):
G1 (Medium) — Choose summary sidebar overflows when a fixed item is selected or triggers a notice
- Location:
web/src/pages/admin-backups/RestoreChoose.tsx:642-669 - Trigger: On the Choose step, check the checkbox for a collection, library, or plugin whose name contains an unbreakable run (such as 21 emoji joined by U+200D), or trigger a transitive selection/deselection notice involving an item, account, or profile with such a name.
- Impact: Below
lg(320px/360px), the grid's single column is an implicitautotrack and<aside>has nomin-w-0, so the unbreakable text widens the whole Choose grid and pushes pagescrollWidthpast the viewport. Atlgand wider (including 1440px), the20remsummary column has ~260px of inner width, so the unbreakable run — and even a long spaceless ASCII name, becausewrap-anywhereis absent — overflows out the end of the summary card (and past the viewport at 1024px). - Evidence:
AdminBackupRestore.tsx:210starts with an empty selection ("Nothing chosen yet"), so an unchecked Choose page never exercises this block. Once checked,restorePlan()(restoreModel.ts:465-531) interpolatesitem.labeldirectly into<ul className="list-disc space-y-1.5 ps-5 text-sm">(RestoreChoose.tsx:655), andchooseItems()/unchooseItems()(restoreModel.ts:212-348) interpolate item, account, and profile names into<p role="status" className="text-[13px] text-amber-600 dark:text-amber-400">(RestoreChoose.tsx:666). Neither element haswrap-anywhereoroverflow-x-clip, and.surface-panel-subtle(web/src/app.css:2212-2217) sets neitheroverflownormin-width. - Suggested repair: Add
min-w-0to<aside>(RestoreChoose.tsx:644). On the plan<ul>(RestoreChoose.tsx:655), addwrap-anywhereand-me-[0.25em] overflow-x-clip pe-[0.25em](keepingps-5intact so outsidelist-discmarkers remain inside the padding box instead of getting clipped). On the notice<p>(RestoreChoose.tsx:666), add-mx-[0.25em] overflow-x-clip px-[0.25em] wrap-anywhere.
G2 (Low) — Open details in AccountRow and ItemRow leave user-named status lines unwrapped and unclipped
- Location:
web/src/pages/admin-backups/RestoreUsers.tsx:285-302,web/src/pages/admin-backups/RestoreRows.tsx:242-246,web/src/pages/admin-settings/SettingField.tsx:62-72 - Trigger: Open the details chevron on an unselectable
AccountRow(wherestatusisnullandwhy/policy_differencestake its place), a selectable newAccountRowin an access group, or an unselectableItemRowwithpath_in_use/folder_missing, when the interpolated name cannot fit on one line (for example, a 21-emoji ZWJ access group name inpolicy_differences, or a long unbroken username, email, library name, or group name inwhy). - Impact: The status line overflows past the row and viewport at narrow and wide widths.
- Evidence:
RestoreUsers.tsx:298passes rawaccount.groupthroughpolicyDifferenceSentence()directly into<SettingFieldStatus>.RestoreUsers.tsx:287andRestoreRows.tsx:244passitem.messageinto<SettingFieldStatus>, which the backend populates witha.Username/a.Email(internal/backup/users_plan.go:342,344),a.Group.Name(:418,444),pp.entry.Name(:469), and conflicting library nameinUse(internal/backup/selective_plan.go:208).SettingFieldStatus(SettingField.tsx:62-72) isinline-flexwith nomax-w-full, nomin-w-0wrapper around{children}, nowrap-anywhere, and nooverflow-x-clip. (Go's%qescapes U+200D to\u200d, which happens to give UAX #14 break points for ZWJ sequences in%q-formatted messages, but rawaccount.groupinpolicy_differencesoverflows on ZWJ directly, and long unbroken non-ZWJ names overflow both.) - Suggested repair: Give
SettingFieldStatusmax-w-fulland wrap{children}in amin-w-0span (or applymax-w-fullplus a child<span className="-mx-[0.25em] min-w-0 overflow-x-clip px-[0.25em] wrap-anywhere">at these restore details call sites; also wrap/clipmissingPathsonRestoreRows.tsx:257).
G3 (Low) — Omitted account sample on the Choose step still overflows on joined-emoji usernames
- Location:
web/src/pages/admin-backups/BackupWarningDetails.tsx:67(rendered on the Choose step viaweb/src/pages/admin-backups/RestoreChoose.tsx:632) - Trigger: Open a restore set whose
omittedlist includes an account with a 21-emoji ZWJ username and expand the omitted-accounts disclosure under the Users section. - Impact: The inline sample paragraph runs past the row and widens the page horizontally.
- Evidence:
internal/backup/restoreset_users.go:244-249stores the raw truncated username inOmittedItem.Label, andBackupWarningDetails.tsx:67rendersnameSampleText(group.labels)in<p className="text-muted-foreground text-xs break-words">.break-wordscannot split a ZWJ grapheme cluster, and the paragraph has nooverflow-x-clip. - Suggested repair: Add
-mx-[0.25em] overflow-x-clip px-[0.25em](andwrap-anywherefor consistency) to the sample<p>atBackupWarningDetails.tsx:67.
Clipping every name in a narrow row, even with 0.25em of room, cut marks that reach above or below the line on ordinary Thai and Vietnamese names in Firefox, which clips overflow-x: clip vertically too. A small hook now measures each name (and an account's "Merge into" line) after layout and on resize, and the row clips it sideways only while its text is wider than its box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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:
|
|
On Gemini's round 1 review (reviewed d23e1f4): G1, G2 and G3 are real, but they're outside this diff and were already on Since that review, the change itself moved to a measured clip (3e75092): Firefox cut marks on ordinary Thai and Vietnamese names under the always-on clip. The pull request description has the details. 🤖 Claude Code (claude-opus-5-5) |
…unt-name-overflow # Conflicts: # web/src/pages/admin-backups/RestoreRows.tsx # web/src/pages/admin-backups/RestoreUsers.tsx
…unt-name-overflow
…unt-name-overflow # Conflicts: # web/src/pages/admin-backups/RestoreRows.tsx
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (the backup restore screen is web admin only)
On the backup restore Choose step, an item name (a library, collection, home section, or
plugin) or an account name that no line break can split ran past its row in narrow rows.
A run of emoji joined by zero-width joiners is one grapheme. A valid 41-character
collection title or username made of 21 joined emoji ran 138 px past its row at a 320 px
viewport and 58 px at 1024 px. It drew over the row's "New" or "Differs" tag and chevron
and ran off the screen. An account's "Merge into" line, which repeats the name, did the
same. #4755 fixed this for profile names. With this change the run is clipped at the edge
of the name's column, and a name that mixes words with such a run wraps its words inside
the row. Every other name looks the same as before, in Chromium, Firefox and WebKit.
Approach
A small hook,
useOverflowsInline, measures an element after layout and whenever itresizes, and reports whether its text is wider than its box (
scrollWidth > clientWidth + 1).The name labels in
ItemRowandAccountRowtakeoverflow-x-cliponly while that istrue: under
@max-2xl:when a detail sits beside the name, since a wider row thentruncates with an ellipsis, and at every width when nothing does, since such a name wraps
at every width since #4788. An account's
"Merge into" line shows only in narrow rows. It is measured and clipped the same way, and
carries its full text as a
title, as the label and the wide row's status already do.The clip is conditional because Firefox clips
overflow-x: clipvertically as well. Thefirst version of this change clipped every name in a narrow row, with 0.25em of room around
the clip as #4755 does. Chromium and WebKit drew ordinary names unchanged, but in Firefox
ordinary Thai, Vietnamese and combining-mark names lost ink above or below the line. Open
#4848 moves profile names to the same measured clip, so the three rows will behave alike.
Validation
main, then rebuilt from this branch,with the same backup. On
main, the joined-emoji collection name ran 138, 98 and 58 pxpast its row at 320, 360 and 1024 px, the account name 118, 78 and 38 px, and the
"Merge into" line 76 and 36 px at 320 and 360 px. Arabic showed the same at 360 px. With
the change, each name stops at the edge of its column, before the row's state tag, and
the merge line stops at the row's edge. Only those overflowing lines are clipped: every
other name keeps
overflow-x: visible. At 1440 px the rows truncate, and nothingchanges. The page doesn't scroll sideways in either build.
main, the Collections and Users sections are identical at1440 px. At 320, 360 and 1024 px and in Arabic, they differ only in the two joined-emoji
rows. In Arabic, one pixel at the start of the clipped merge line also shifts slightly,
since the clip leaves no room around the line. A "jasper" name, a Telugu name, a
64-character name with no spaces, the profile rows and the "New account" lines are
unchanged.
Firefox (also with a 24 px minimum font size) and WebKit, with the clip applied as the
hook applies it, draws every ordinary test name pixel-identically to
main. That holdsin narrow and wide rows, left to right and right to left, at 1× and 2×, and at Extra
large text: 160 configurations of the name and the merge line. The names include a
leading "j", "Maryƴ", Telugu, Devanagari, Arabic, Thai, Vietnamese with stacked marks,
combining marks, a dotted setting key, and long names.
username. Usernames are only trimmed and capped at 255 characters.
added: the change is a measured class toggle and a
title, jsdom has no layout tomeasure, and the browser checks above cover it.
Evidence
Surface and build: web admin, Backups › Restore › Choose, Collections and Users, before
main5d52158, after 7b8164e.Evidence: https://evidence.siloserver.org/r/silo-server/restore-item-account-name-unbreakable/
Risks
The ResizeObserver watches the name's box, so if the text grows wider without the box
resizing (a web font arriving after the row renders), the clip waits for the next resize.
In Firefox a clipped line also loses ink above and below it, so a name that mixes Thai or
Vietnamese marks with a run that can't wrap may lose some marks. Names that fit are never
clipped.
Follow-ups
main(the "match this server" list from fix(web): keep an unwrappable matching restore name inside its list #4907, and thelibrary heading and Run report lines from fix(web): keep restore names that can't wrap inside their box #4921) drop marks on ordinary names in Firefox.
The heading and report lines are being moved to this hook in a separate change. A follow-up
covers the list, gives this change's clips the same start room as
ProfileRow(a bareclip can trim a sliver of a clipped line's first letter), and switches
ProfileRowtothe shared hook.
Checklist
Council review
Rounds: 2. The pull request merged at 7b8164e before a third round on the merge with
main.Visual review: 2 rounds, captures from d23e1f4 and 3e75092
Fixed: round 1's version clipped every name, which in Firefox cut marks on ordinary Thai
and Vietnamese names. The clip now applies only while a name overflows.
Open: Sol's round 2 S2 (its review couldn't be posted). The hook doesn't re-measure when the
web font finishes loading, so a name whose width changes then keeps its old clip state until
the next resize. This is the disclosed font-loading risk below, now reproduced. It's handed to
the change that is already editing the hook, which will add a re-measure on
document.fonts.Answered: Sol's S1 (its round 1 review couldn't be posted) and the visual reviews noted that
a clipped run gives no sign that the name continues and can't be revealed by keyboard or
touch. On
mainthe same run already ran off the screen. As in #4755, an ellipsis can't goinside one grapheme and a fade would change every name. The full text stays in the label's
and the merge line's
titleand in the checkbox's accessible name, and only a line holdingone grapheme wider than the row is ever clipped. Gemini's round 1 findings point at other
places on the restore screens with the same overflow, outside this diff. They have gone to
the follow-up change. A profile name inside an open account still clips 0.25em past the row,
as on
main; #4848 moves it to the same measured clip. The untranslated restore explanations are #4669.AI Disclosure
title(added) and the same overflow elsewhere on the restore screens (handed to a separate change). A cross-engine check after the pull request opened found the Firefox problem above, which led to the measured clip. The plan round was skipped as a mechanical fix reusing fix(web): clip a restore profile name that can't wrap #4755's approach. Simplify passes changed one comment. Background and visual review results are under Council review.🤖 Generated with Claude Code