Skip to content

fix(web): clip restore item and account names that can't wrap - #4849

Merged
Quick104 merged 5 commits into
mainfrom
fix/restore-item-account-name-overflow
Nov 21, 2026
Merged

Quick104 merged 5 commits into
mainfrom
fix/restore-item-account-name-overflow

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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 it
resizes, and reports whether its text is wider than its box (scrollWidth > clientWidth + 1).
The name labels in ItemRow and AccountRow take overflow-x-clip only while that is
true: under @max-2xl: when a detail sits beside the name, since a wider row then
truncates 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: clip vertically as well. The
first 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

  • Reproduced on a Silo dev deployment built from main, then rebuilt from this branch,
    with the same backup. On main, the joined-emoji collection name ran 138, 98 and 58 px
    past 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 nothing
    changes. The page doesn't scroll sideways in either build.
  • Compared byte for byte with main, the Collections and Users sections are identical at
    1440 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.
  • The row's markup, rendered with the built CSS and the app's own font in Chromium,
    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 holds
    in 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.
  • The server accepts the joined-emoji run as a collection title, a library name and a
    username. Usernames are only trimmed and capped at 255 characters.
  • Web lint, format check, build, bundle budget and the restore page tests pass. No test is
    added: the change is a measured class toggle and a title, jsdom has no layout to
    measure, and the browser checks above cover it.

Evidence

Surface and build: web admin, Backups › Restore › Choose, Collections and Users, before main 5d52158, 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

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

Council review

Rounds: 2. The pull request merged at 7b8164e before a third round on the merge with main.

Member Round 1 (d23e1f4) Round 2 (3e75092)
Sol (gpt-6.2-sol, xhigh) 8/10 8/10
Opus (claude-opus-5-5, high) 9/10, no findings 9/10, no findings
Gemini (gemini-4-neon, xhigh) 7/10 unavailable (provider quota, after a retry)

Visual review: 2 rounds, captures from d23e1f4 and 3e75092

Member Round 1 Round 2
Sol better, 8/10 better, 8/10
Opus better, 8/10 better, 8.5/10
Gemini better, 7/10 better, 8/10

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 main the same run already ran off the screen. As in #4755, an ellipsis can't go
inside one grapheme and a fade would change every name. The full text stays in the label's
and the merge line's title and in the checkbox's accessible name, and only a line holding
one 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

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, T3 Code delegated tasks, Codex, Antigravity
  • Model(s): claude-opus-5-5 (implementation and code review), claude-sonnet-5-5 (code-review subagents), gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (visual and adversarial review)
  • Involvement: Fully AI-generated. The agent verified it on a dev sandbox and in a browser fixture in three engines; a person has not verified it yet.
  • Adversarial review: code review at xhigh found that the clipped "Merge into" line had no 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

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>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f8538cf9-0c26-47ec-83dc-d8028b5476a9
Commits

Reviewing files that changed from the base of the PR and between f465d2d and 7fe7188.

Files selected for processing: 3

  • web/src/pages/admin-backups/RestoreRows.tsx
  • web/src/pages/admin-backups/RestoreUsers.tsx
  • web/src/pages/admin-backups/useOverflowsInline.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T06:01:46.000284Z 7fe7188 New commits
🔒 Security Review ✅ Completed 2026-11-21T06:04:55.881364Z 7fe7188 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. labels Nov 21, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 implicit auto track and <aside> has no min-w-0, so the unbreakable text widens the whole Choose grid and pushes page scrollWidth past the viewport. At lg and wider (including 1440px), the 20rem summary column has ~260px of inner width, so the unbreakable run — and even a long spaceless ASCII name, because wrap-anywhere is absent — overflows out the end of the summary card (and past the viewport at 1024px).
  • Evidence: AdminBackupRestore.tsx:210 starts with an empty selection ("Nothing chosen yet"), so an unchecked Choose page never exercises this block. Once checked, restorePlan() (restoreModel.ts:465-531) interpolates item.label directly into <ul className="list-disc space-y-1.5 ps-5 text-sm"> (RestoreChoose.tsx:655), and chooseItems() / 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 has wrap-anywhere or overflow-x-clip, and .surface-panel-subtle (web/src/app.css:2212-2217) sets neither overflow nor min-width.
  • Suggested repair: Add min-w-0 to <aside> (RestoreChoose.tsx:644). On the plan <ul> (RestoreChoose.tsx:655), add wrap-anywhere and -me-[0.25em] overflow-x-clip pe-[0.25em] (keeping ps-5 intact so outside list-disc markers 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 (where status is null and why / policy_differences take its place), a selectable new AccountRow in an access group, or an unselectable ItemRow with path_in_use / folder_missing, when the interpolated name cannot fit on one line (for example, a 21-emoji ZWJ access group name in policy_differences, or a long unbroken username, email, library name, or group name in why).
  • Impact: The status line overflows past the row and viewport at narrow and wide widths.
  • Evidence: RestoreUsers.tsx:298 passes raw account.group through policyDifferenceSentence() directly into <SettingFieldStatus>. RestoreUsers.tsx:287 and RestoreRows.tsx:244 pass item.message into <SettingFieldStatus>, which the backend populates with a.Username / a.Email (internal/backup/users_plan.go:342,344), a.Group.Name (:418,444), pp.entry.Name (:469), and conflicting library name inUse (internal/backup/selective_plan.go:208). SettingFieldStatus (SettingField.tsx:62-72) is inline-flex with no max-w-full, no min-w-0 wrapper around {children}, no wrap-anywhere, and no overflow-x-clip. (Go's %q escapes U+200D to \u200d, which happens to give UAX #14 break points for ZWJ sequences in %q-formatted messages, but raw account.group in policy_differences overflows on ZWJ directly, and long unbroken non-ZWJ names overflow both.)
  • Suggested repair: Give SettingFieldStatus max-w-full and wrap {children} in a min-w-0 span (or apply max-w-full plus 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/clip missingPaths on RestoreRows.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 via web/src/pages/admin-backups/RestoreChoose.tsx:632)
  • Trigger: Open a restore set whose omitted list 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-249 stores the raw truncated username in OmittedItem.Label, and BackupWarningDetails.tsx:67 renders nameSampleText(group.labels) in <p className="text-muted-foreground text-xs break-words">. break-words cannot split a ZWJ grapheme cluster, and the paragraph has no overflow-x-clip.
  • Suggested repair: Add -mx-[0.25em] overflow-x-clip px-[0.25em] (and wrap-anywhere for consistency) to the sample <p> at BackupWarningDetails.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-triage silo-triage Bot added size/M 50–199 added + deleted lines (all files); change volume, not priority. and removed size/S 0–49 added + deleted lines (all files); change volume, not priority. labels Nov 21, 2026
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

On Gemini's round 1 review (reviewed d23e1f4): G1, G2 and G3 are real, but they're outside this diff and were already on main. The Choose step's summary panel and selection notices, the server sentences in SettingFieldStatus, and the omitted-accounts sample all render the same names without a clip. They've gone to the separate change that handles the library heading and the Review and Run steps, so this pull request stays on the Choose rows. For G2, #4810 has since given SettingFieldStatus wrap-anywhere, so long words in those sentences now wrap. A joined-emoji group name in a policy difference still can't.

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

# Conflicts:
#	web/src/pages/admin-backups/RestoreRows.tsx
@Quick104
Quick104 merged commit b40db86 into main Nov 21, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/restore-item-account-name-overflow branch November 21, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant