Skip to content

fix(web): clip a restore profile name only when it overflows - #4848

Merged
Quick104 merged 2 commits into
mainfrom
fix/restore-profile-name-clip-when-overflowing
Nov 21, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/restore-profile-name-clip-when-overflowing

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)

#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

ProfileRow measures the name's label in a layout effect (scrollWidth > clientWidth + 1)
and again whenever a ResizeObserver reports a new size, and adds overflow-x-clip only
while 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

  • A fixture rendering the row's markup with the built CSS and the app's fonts, in Firefox
    (default and with a 24 px minimum font size), WebKit, and Chromium, left to right and
    right to left: main trims "Maryƴ" and a Thai name in Firefox; with this change no
    ordinary name differs from the same label with no clip, and only the emoji and mixed
    names are clipped.
  • All three engines keep reporting the label's full scrollWidth with overflow-x: clip
    applied, after a frame and in a ResizeObserver callback, so the clip doesn't turn itself
    off.
  • On a Silo dev deployment built from main and then from this branch, with restorable
    profiles 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).
  • Web lint, format check, build, bundle budget, and the admin-backups tests pass. No test
    is added: jsdom has no layout, so the measurement can't run there.

Evidence

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

  • 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: 1, reviewed 8fb2a5c (f7eecdd adds start padding while clipped)

Member Round 1
Sol (gpt-6.2-sol, xhigh) 8/10
Opus (claude-opus-5-5, high) 8/10
Gemini (gemini-4-neon, xhigh) 9/10

Visual review: 1 round, captures from 8fb2a5c

Member Round 1
Sol better, 9/10
Opus better, 9/10
Gemini better, 6/10

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

  • 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), gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (visual and adversarial review), claude-sonnet-5-5 (code-review subagent)
  • Involvement: Fully AI-generated. The agent verified it on a dev sandbox and in a cross-browser fixture; a person has not verified it yet.
  • Adversarial review: Sol's background review of fix(web): clip a restore profile name that can't wrap #4755 found that its fixed padding trimmed a hooked letter in Firefox with a raised minimum font size; this change's fixture also found a Thai name trimmed in Firefox at default settings. Code review asked whether overflow-x: clip hides the overflow from scrollWidth and 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 ProfileRow only when they overflow

Adds an overflow measurement to the profile-name label in RestoreUsers.tsx. The label compares scrollWidth to clientWidth (with a 1px tolerance) in a layout effect, then remeasures via ResizeObserver when available. Horizontal clipping and start-side padding are now applied only when the measured name overflows; the title attribute still shows the full name.

Macroscope summarized f7eecdd.

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]>
@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 1 minute.

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: beaeea6b-abcd-41ab-8af8-4211466f5866
Commits

Reviewing files that changed from the base of the PR and between 4c17b86 and f7eecdd.

Files selected for processing: 1

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

@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 ❌

@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-21T03:55:04.387078Z 8fb2a5c PR opened
🔒 Security Review ✅ Completed 2026-11-21T04:35:13.171808Z f7eecdd 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-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 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 (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

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
Quick104 merged commit aa68f7f into main Nov 21, 2026
20 checks passed
@Quick104
Quick104 deleted the fix/restore-profile-name-clip-when-overflowing branch November 21, 2026 05:28
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/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant