Skip to content

fix(web): clip restore names only while they overflow - #4987

Open
Quick104 wants to merge 2 commits into
mainfrom
fix/restore-clip-when-overflowing
Open

Quick104 wants to merge 2 commits into
mainfrom
fix/restore-clip-when-overflowing

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #4946
Validation tasks: none

Other clients: N/A (backup restore is only in the web admin)

#4921 clipped five 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: clip vertically 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 five places: the Choose step's library heading, the plan list in the Choose step's summary panel, 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

  • Each place measures its text with the shared useOverflowsInline hook (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 "Left out" list and each report row use a new shared OVERFLOW_CLIP class 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 only overflow-x-clip, since its start padding already holds the bullets.
  • The report clips each row's whole text column while any of its lines overflows, as fix(web): keep restore names that can't wrap inside their box #4921 did, so a name inside an account's data note is covered too.
  • The hook now measures where the text lays out (a Range over the element's contents) against its content box, instead of scrollWidth. scrollWidth counts 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.
  • The hook also measures again once a web font finishes loading, since a font swapping in changes a name's width without resizing its box (document.fonts.ready, and the loadingdone event, 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.tsx and useOverflowsInline.ts. No API, text, or translation changes.

Validation

  • Live on a Silo dev deployment, with the same backup and restore job on main and on this change. The data: a library renamed to a Thai name; collections, accounts and profiles named in Thai, Vietnamese, combining marks, and with the emoji run. Checked in Chromium and Firefox, at the default and x-large Text Size and with a 24 px minimum font size.
  • On this build, each ordinary name was cropped, then fix(web): keep restore names that can't wrap inside their box #4921's classes were added back on the same page and the crop taken again. fix(web): keep restore names that can't wrap inside their box #4921's clip cut a Vietnamese report line at x-large and Thai report lines with the minimum font, plus 4 faint pixels of the Thai heading at x-large, all in Firefox only. This build clips none of them. It clips only the elements holding the emoji run, and only where the run doesn't fit: the report's emoji rows at 360 px, none at 1024 px.
  • A fixture rendered each of the five places with the app's built CSS and fonts, with no clip (as before fix(web): keep restore names that can't wrap inside their box #4921), with fix(web): keep restore names that can't wrap inside their box #4921's clip, and with this change, for 14 names across scripts, at 300, 360 and 900 px, default and x-large Text Size, 1× and 2×, both directions, in Chromium, Firefox, WebKit, and Firefox with a 24 px minimum font size. Every name other than the emoji run renders pixel-identical to no clip; only the emoji names clip.
  • The new measurement read none of 3,472 wrapping-name layouts with a trailing margin as overflowing in any engine (scrollWidth read 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.ready resolved after it in all three engines.
  • Lint, format, build, bundle budget, local paths, size ratchet, bidi, and case collisions: pass. The admin-backups tests pass; the full web suite wasn't rerun on this head, so CI's run is the check there.
  • No passed case on the v1.0 validation board reaches the restore screens.

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

  • 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

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: running on 3a3c30d

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

Visual review: 1 round, on captures from 6cc9f09b (the head adds only the font-load re-measure and the jsdom guard)

Member Round 1
Sol better, 9/10
Opus better, 8/10
Gemini unavailable (provider quota)

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

  • 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 (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 browser fixtures; a person has not verified it yet.
  • Adversarial review: see Council review.

🤖 Generated with Claude Code

Note

Clip restore names only when they actually overflow

  • Rewrites useOverflowsInline in useOverflowsInline.ts to measure text bounds with a DOM Range against the element's content box, replacing the old scroll-width comparison
  • Recomputes overflow on resize, content changes, and web-font loading, with an active flag to prevent state updates after cleanup
  • Exports a shared OVERFLOW_CLIP class constant and applies it conditionally in RestoreChoose, RestoreReview, and RestoreRun, removing unconditional clipping, its padding, and negative margin
  • Risk: overflow now depends on font readiness; check the one-pixel tolerance and DOM Range fallback in textOverflows for elements with unusual padding or borders

Macroscope summarized 82ee6a0.

#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 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

CodeRabbit ASCII loading animation

Currently processing new changes in this PR. This may take a few minutes, please wait...

Review info

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: c5e1881d-f804-4a7d-9b11-8ac3c2ff4126
Commits

Reviewing files that changed from the base of the PR and between 44212c9 and 82ee6a0.

Files selected for processing: 4

  • web/src/pages/admin-backups/RestoreChoose.tsx
  • web/src/pages/admin-backups/RestoreReview.tsx
  • web/src/pages/admin-backups/RestoreRun.tsx
  • web/src/pages/admin-backups/useOverflowsInline.ts

@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: 🔄 Running

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T08:59:26.807540Z 82ee6a0 New commits
🔒 Security Review 🔄 Running since 2026-11-21T08:58:05.018756Z 82ee6a0 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 labels Nov 21, 2026
…-overflowing

# Conflicts:
#	web/src/pages/admin-backups/RestoreReview.tsx
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant