Skip to content

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

Merged
Quick104 merged 2 commits into
mainfrom
fix/restore-rows-measured-clip
Nov 21, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/restore-rows-measured-clip

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #4946
Related issue: N/A
Validation tasks: none

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

On the backup restore Choose step, the "match this server" list always clipped its names sideways. In Firefox that clip also cuts vertically, so names that fit lost the tops of marks above the line. Vietnamese stacked diacritics and combining marks lost their top pixel row.

Names that do overflow, and so need the clip, had a smaller problem. Item names, account names and the "Merge into" line were clipped with no room at the start edge, so a first letter whose ink reaches before its box lost a sliver. A leading "j" and the first letter of an Arabic name both lost one.

With this change, a "match this server" name is clipped only while it is still wider than its row after wrapping. Every clipped restore name keeps its first letter whole, and its end is cut at the edge of its label or row.

#4987 fixed the other places #4946 lists: the library heading, the Review lists and the Run report rows. This pull request does the "match this server" rows, which finishes the issue. It uses #4987's measurement and its OVERFLOW_CLIP classes.

Approach

  • useOverflowsInline.ts gains NARROW_OVERFLOW_CLIP, the same classes as OVERFLOW_CLIP, applied only below the 42rem container breakpoint. Above that width, a row with a detail beside the name truncates instead.
    • OVERFLOW_CLIP adds 0.25em of start padding, offset by a negative margin.
    • It also sets max-w-[calc(100%+0.25em)], so a name capped at max-w-full still ends on its container's edge.
  • SameRow measures its name with the hook and clips only while it overflows. Its name keeps the direction and alignment from fix(web): keep restore row names in their own direction in right-to-left languages #5007.
  • ItemRow's and AccountRow's name spans (since fix(web): keep restore row names in their own direction in right-to-left languages #5007, the element that's measured and clipped), the "Merge into" line and ProfileRow use the shared classes.
  • ProfileRow drops its inline copy of the old scrollWidth measurement and uses the hook.

Validation

  • Live, on a Silo dev deployment. I built it from main, then rebuilt it from this branch, with the same data both times.
    • The data had Vietnamese, Thai and combining-mark collections that match the server, and names holding a 21-emoji joined run. Those names start with Latin words ("jasper", "juniper") or Arabic ones ("يوسف", "ليلى").
    • I captured both builds in Firefox and Chromium at 360 and 1024 px and in Arabic.
  • Before. The Vietnamese "match this server" name differed in Firefox from the same row without the clip, because the top pixel row of the stacked tildes was cut. The combining-mark name differed at 1024 px.
  • After.
    • Every "match this server" name that fits draws exactly like the unclipped row, in both engines and on both pages.
    • Every clipped name has 0.25em of start room at its own start edge. That holds for left-to-right and right-to-left names, on English and Arabic pages.
    • Every end cut lands exactly on its label's or row's edge. On main, an overflowing "match this server" name ended 0.25em past its row.
  • Live, resizing without a reload in Chromium, Firefox and WebKit. The clip came on and off as names started and stopped overflowing. No name stayed clipped when it fit, and nothing scrolled sideways.
  • Fixture with the built CSS and the app's fonts. Classes were composed through cn, and overflow was measured as each side's code measures it. It covered Chromium, Firefox, Firefox with a 24 px minimum font size, and WebKit; rows of 300, 360 and 900 px; default and Extra large text; 1× and 2×; both directions.
    • No name that fits changed in any configuration. On main, Firefox changed Vietnamese, Thai and combining-mark "match this server" names, in up to 18 of 24 configurations.
    • At an overflowing name's start edge, main cut a leading "j" by up to 214/255 and a leading Arabic letter by up to 106/255. Both are now 0/255.
  • Web gate. Lint (0 errors), tsc -b, format check, build and bundle budget pass, and so do verify-local-paths, verify-bidi, verify-case-collisions and verify-size-ratchet. make test-web failed 5 files, none in admin backups.
    • 4 fail the same way on main on this machine, from localStorage under Node 26.
    • 1 is a timeout, and it didn't recur in alternating runs against main.
    • The admin-backups tests pass.
  • No new test. The change applies CSS classes from an existing measurement, and the fixture and live checks are its proof.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/issue-4946/

Risks

While the "match this server" fold is open, each row keeps its own ResizeObserver, as ItemRow rows already do. With 3,000 rows, opening the list took no extra time in Chromium and about 0.1 s longer in Firefox.

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, last reviewed 3c7b63f

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: 2 rounds, on captures from an earlier build of this change, before it was rebased onto #4987 and #5007. I checked the current head's captures against them myself.

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

Fixed: nothing needed fixing.

Answered:

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; Playwright (Chromium, Firefox, WebKit)
  • Model(s): claude-opus-5-5 (implementation and code review); gpt-6.2-sol, claude-opus-5-5 and gemini-4-neon (council review)
  • Involvement: Fully AI-generated. The agent verified it on a dev deployment and in a browser fixture; a person has not verified it yet.
  • Adversarial review: code review at xhigh (three finders, a validation check and a sweep) on an earlier version of the diff, then one focused pass on the final diff after fix(web): keep restore row names in their own direction in right-to-left languages #5007; nothing needed fixing. The plan round was skipped because the root cause is shown in the source and the fix reuses an existing hook. A simplify pass made no changes. The visual and background reviews are under Council review.

🤖 Generated with Claude Code

Note

Clip overflowing restore names conditionally in admin-backups UI

  • Restore rows now apply overflow clipping styles (negative margin, max width, clipping, start padding) only when the name is measured as overflowing, via the new shared useOverflowsInline hook
  • Adds a NARROW_OVERFLOW_CLIP class constant in useOverflowsInline.ts as the narrow-row variant used under the @max-2xl container query
  • RestoreUsers.tsx replaces its local ref/state/ResizeObserver measurement with the shared hook, and applies OVERFLOW_CLIP or NARROW_OVERFLOW_CLIP to overflowing names and merge-status text
  • RestoreRows.tsx uses the new constants for overflowing names, removing the previously unconditional clipping classes on SameRow
  • Behavioral Change: names that fit no longer receive negative margin, padding, or clipping classes

Macroscope summarized ad39de7.

The "match this server" list clipped every name sideways, so in Firefox
a name that fits lost the parts of its marks above the line, such as
Vietnamese stacked diacritics. SameRow now measures its name with
useOverflowsInline and clips only a name still wider than the row after
wrapping.

Clipped item and account names and the "Merge into" line take the same
start room as a clipped profile name: 0.25em of start padding offset by
a negative margin, so a first letter whose ink reaches before its box
stays whole, with the end cut still on the container's edge. Rows with a
detail use NARROW_OVERFLOW_CLIP, the same classes below the 42rem
container breakpoint. ProfileRow uses the shared hook instead of its own
copy of the measurement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/M 50–199 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 11 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: 2f69446b-e361-4776-85fc-e28dff194d55
Commits

Reviewing files that changed from the base of the PR and between 6fa4579 and ad39de7.

Files selected for processing: 3

  • web/src/hooks/useOverflowsInline.ts
  • web/src/pages/admin-backups/RestoreRows.tsx
  • 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-21T18:05:15.629845Z ad39de7 New commits
🔒 Security Review ✅ Completed 2026-11-21T18:06:44.651495Z ad39de7 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 (gpt-6.2-sol, reviewed 3c7b63f)

AI disclosure — This automated adversarial review used gpt-6.2-sol in the Codex harness through T3 Code.

}) {
useT();
const label = displayLabel(item);
const [nameRef, nameOverflows] = useOverflowsInline<HTMLSpanElement>(label);

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.

S1 [P2] Opening a large matching-items list blocks on every label. SameRows mounts the full result inside a max-h-80 scrollbox. When a same-server backup has thousands of matching artwork entries, this hook measures every row before paint and registers a resize observer and font listener for each, including offscreen rows. In a production React fixture with the old and new SameRow and 5,000 artwork labels, the synchronous mount went from 7–9 ms to 72–74 ms in Chromium and from 25–42 ms to 125–230 ms in Firefox. The new rows made 15,000 text measurements across mount and the first resize and font callbacks. Window or paginate the list so mounting and measuring rows stays bounded as the backup grows.

# Conflicts:
#	web/src/pages/admin-backups/RestoreRows.tsx
@Quick104
Quick104 merged commit 6465c2c into main Nov 21, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/restore-rows-measured-clip branch November 21, 2026 18:09
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.

[bug] Restore names that fit lose marks above or below the line in Firefox

1 participant