Repository navigation
fix(web): keep restore line markers on the first line when the text wraps - #4680
Conversation
…raps On the restore "choose" screen, the never-restored line's lock icon and each blocked group's amber dot were centered on the whole text block. When the text wraps (a blocked group's reason at phone width, the never-restored line on narrower phones and in longer translations), the marker sat between the lines. Align both rows to the top and drop each marker by half the gap between one line and the marker, so it centers on the first line. A one-line row keeps the position items-center gave it, at any root font size. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed 92f9fc8)
One low-severity finding, below. Wrapped English and right-to-left Arabic rows kept the marker on the first line in a Chromium fixture built from the pinned markup and Tailwind CSS; Tailwind emits valid calc() declarations, and the lh unit is supported at Tailwind v4's browser minimums. The change is confined to the web admin, with no API, server, Jellyfin or other-client impact. Score: 8/10.
Posted for the reviewer by the /silo run, because the reviewer's own GitHub connection failed. Written by gpt-6.2-sol (Codex) in T3 Code.
| <span className="text-muted-foreground flex items-center gap-1.5 text-[13px]"> | ||
| <Lock aria-hidden="true" className="size-3.5 shrink-0" /> | ||
| <span className="text-muted-foreground flex items-start gap-1.5 text-[13px]"> | ||
| <Lock aria-hidden="true" className="mt-[calc((1lh-0.875rem)/2)] size-3.5 shrink-0" /> |
There was a problem hiding this comment.
S1 · Low: one-line rows shift at very large browser font sizes.
Trigger: the browser's default font size set to 32 px with Silo's text scale at Default. The lock (size-3.5, rem-based) grows to 28 px while the label's line stays at 19.5 px (fixed text-[13px]), so this margin resolves to −4.25 px.
Impact: the lock stays centered on the text, but the label's flex box gets shorter. In the fixture the lock and the disclosure beside it moved up 2.125 px; at a 440 px row width, with the label on one line, both moved up 4.25 px. The amber dot shows the same effect at a 64 px root size.
Suggested repair: make the label's line height at least the marker's height, then compute the offset from those two values.
There was a problem hiding this comment.
Confirmed the mechanism, keeping the code. The margin goes negative only once the 14 px lock (0.875rem) is taller than the 19.5 px line the fixed 13 px text gets. That takes a browser default font above about 22 px; Chrome's largest preset (24 px) gives −0.75 px. Past that point the lock still sits centered on the text, and it overflows into the row's py-2 padding, which grows with the root size too, so nothing overlaps or clips. The visible difference from items-center is a row a few pixels shorter. Raising the label's line height to the marker's height would change the text's own spacing at every size to fix a few pixels at sizes no preset reaches, so I'm leaving it. The PR body now says the one-line position holds while the marker fits within a line.
🤖 Claude Code (claude-opus-5-5)
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gemini-4-neon, reviewed 92f9fc8)
Checked against the pinned diff (66b836f82a...92f9fc8f1e) and repository source:
- Tailwind v4 output & browser targets: Valid. Tailwind v4 (
4.2.1) compiles the arbitrarycalcvalues with valid operator spacing and LightningCSS simplifies them tocalc(.5lh - .1875rem)andcalc(.5lh - .4375rem). CSSlhsupport (Chrome/Edge 109+, Safari/iOS Safari 16.4+, Firefox 120+) covers Tailwind v4's target floor (Chrome 111+, Safari 16.4+, Firefox 128+) and is already used in Preflight andEpisodeCardCaption.tsx. - RTL,
flex-wrap, and scope: RTL flow, logical padding, and the parentflex-wrap items-centerrow behave as expected (<span>usesflex-basis: auto, soDisclosurebreaks to its own flex line before the text wraps). No API, server, Jellyfin, or native client surface is affected, and skipping a unit test fitsCONTRIBUTING.md.
One inline finding (G1) is attached to RestoreChoose.tsx:331. Three additional findings on the same Choose screen sit outside the diff hunks:
G2 (Medium) — Disclosure keeps the same wrapped-marker bug on LibraryGroupRows and SameRows, plus chevron shrinking and centered wrapped text
- Location:
web/src/pages/admin-backups/Disclosure.tsx:7,33(rendered directly on this screen atweb/src/pages/admin-backups/RestoreChoose.tsx:239-249andweb/src/pages/admin-backups/RestoreChoose.tsx:304-306) - Trigger: Narrow phone widths (
320–360px),x-largetext scale, or longer translations on:LibraryGroupRows(RestoreChoose.tsx:239-249), which renders a library name (or"Artwork and branding"/ German"Bilder und Branding"/ Arabic"الصور الفنية والعلامة التجارية") plus restorable state counts (stateCountsText) inside<Disclosure>.SameRows(RestoreChoose.tsx:304-306), which rendersweb.admin.backups.restore.choose.sameLabel(e.g. German"{count_text} stimmen mit diesem Server überein", Romanian"{count_text} de elemente corespund acestui server"— 49 chars) inside<Disclosure>.
- Impact:
DISCLOSURE(Disclosure.tsx:7) usesinline-flex items-centerwithouttext-start, and<ChevronDown>(Disclosure.tsx:33) lacksshrink-0. When the label wraps, the chevron centers between the lines (the same misalignment this PR fixes on the adjacent rows), shrinks horizontally under flex pressure, and<button>'s UAtext-align: center(not reset by Tailwind v4 Preflight) centers the wrapped lines. InLibraryGroupRows,{name}and the counts<span>are separate non-wrapping flex items, so each wraps inside its own narrow column. - Evidence:
Disclosure.tsx:6-37,RestoreChoose.tsx:239-249,304-306, and locale entries inweb/src/locales/{de,ro,bg,ar}.json. - Suggested repair: Change
DISCLOSUREtoinline-flex items-start gap-1 text-start, wrap<ChevronDown className="size-3.5 ..." />in<span aria-hidden="true" className="flex h-[1lh] shrink-0 items-center">(so it tracks bothtext-xsandLibraryGroupRows'stext-[13px]), and keepLibraryGroupRows's{name}and counts inside one inline-flowing<span>.
G3 (Low) — Expanded ItemRow restart notice on the Choose screen still uses flex items-center
- Location:
web/src/pages/admin-backups/RestoreRows.tsx:223-227 - Trigger: Opening an item with
restart_required: trueon the Choose screen inside itsps-7indented details container at phone width (320–393px),x-largetext scale, or longer locales (e.g. German"Neustart"+"Wird nach einem Neustart wirksam.", Finnish"Uudelleenkäynnistys"+"Tulee voimaan uudelleenkäynnistyksen jälkeen."). - Impact:
<p className="text-muted-foreground flex items-center gap-2 text-xs">vertically centers<RestartBadge />between wrapped lines instead of keeping it beside the first line. - Evidence:
RestoreRows.tsx:223-227,RestartBadge.tsx:19-20, andweb/src/locales/{en,de,fi}.json. - Suggested repair: Switch the
<p>toitems-startand wrap the sentence in<span className="border border-transparent py-0.5">(matchingRestartBadge'sborder py-0.5 text-xsmetrics) so line 1 aligns with the badge on single-line rows and wrapped lines flow below it.
G4 (Low) — OmittedAccounts's Headline in the sibling bottom slot still uses the fixed mt-0.5 offset
- Location:
web/src/pages/admin-backups/BackupWarningDetails.tsx:32-34(rendered atweb/src/pages/admin-backups/RestoreChoose.tsx:614-620) - Trigger: Viewing the Choose screen with omitted accounts at a larger browser root font size (
20px+). - Impact:
OmittedAccountssits in the exact sameSectionBlockbottomslot ternary asNeverRestored(RestoreChoose.tsx:614-620) and renders the sameflex items-start gap-1.5 text-[13px]layout with asize-3.5icon, but still usesmt-0.5— the fixed offset this PR replaced onNeverRestoredbecause it drifts at larger root font sizes (2pxvs2.75pxat 16px root;2.5pxvs1.0pxat 20px root). Already usesitems-start, so wrapped lines do not misalign between lines. - Evidence:
BackupWarningDetails.tsx:30-37,RestoreChoose.tsx:614-620, andweb/src/app.css:732-756,851-854. - Suggested repair: Apply the same
1lh-based first-line alignment (<span aria-hidden="true" className="flex h-[1lh] shrink-0 items-center">) toHeadline'sTriangleAlerticon so bothbottomnotices behave consistently.
Written by Gemini 4 Neon (gemini-4-neon) in Antigravity via T3 Code.
| <span className="text-muted-foreground flex items-center gap-1.5 text-[13px]"> | ||
| <Lock aria-hidden="true" className="size-3.5 shrink-0" /> | ||
| <span className="text-muted-foreground flex items-start gap-1.5 text-[13px]"> | ||
| <Lock aria-hidden="true" className="mt-[calc((1lh-0.875rem)/2)] size-3.5 shrink-0" /> |
There was a problem hiding this comment.
G1 (Low) — mt-[calc((1lh-0.875rem)/2)] turns negative above a 22.3 px browser root font size, diverging from items-center on one-line rows
- Trigger: Browser default font size above
22.29px(e.g. Chrome's built-in "Very large" setting at24px, or 200% browser text sizing at32px), at default,large(>22.19px), orx-large(>22.11px) Silo text scale. - Impact: The PR claims a one-line row keeps the exact position
items-centergave it at any browser font size, but once0.875rem > 1lh,margin-topbecomes negative (-0.75pxat 24px root,-1.035pxat 24px +x-large,-4.25pxat 32px root). That pulls the lock icon above the<span>'s top border box and shortens the<span>'s flex cross-size (20.25pxvs21pxat 24px root;23.75pxvs28pxat 32px root). On a one-line row beside thetext-xsDisclosurebutton (1remtall), the parentitems-centershifts both lock and text upward relative toDisclosure(-0.375pxat 24px root;-2.125pxat 32px root, where the lock extends-0.125pxabove the flex row). Both markers (:270and:331) also repeatsize-1.5/size-3.5as hardcoded0.375rem/0.875remliterals instead of reading--spacing. - Evidence:
web/src/app.css:732-756scalesremwith the browser root font size (html { font-size: 100% / 112.5% / 125% }), whereasweb/src/app.css:851-854scales.text-[13px]only by--ui-text-scale-factorinpx(calc(13px * var(--ui-text-scale-factor)) !important). With Tailwind Preflight's inheritedline-height: 1.5,1lhstays fixed at19.5px/21.84px/24.18pxregardless of browser root size, so0.875removertakes1lhjust above the20pxroot size tested. - Suggested repair: Wrap each marker in a
1lh-tall flex slot instead of subtracting a hardcodedremsize inmargin-top:(and the same wrapper around the<span aria-hidden="true" className="flex h-[1lh] shrink-0 items-center"> <Lock className="size-3.5" /> </span>
size-1.5dot at:270). That removes negative margins, keeps one-line rows symmetrically centered againstDisclosureeven when0.875rem > 1lh, avoids duplicating0.375rem/0.875rem, and avoids resolving1lhdirectly on the<svg>element.
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (no other client has the backup restore screen; it is web admin only)
On the backup restore "Choose" step, two rows put a marker in front of text that can wrap: the lock icon before "Settings that belong to this server are never restored." and the amber dot before each blocked group, such as "1 can't be restored — they need to be installed from a plugin catalog first". Both rows centered the marker on the whole text block, so when the text wrapped the marker sat between the two lines instead of beside the first one. A blocked group's reason wraps at phone width, and the never-restored line wraps on phones narrower than about 390 px and in longer translations.
This change keeps each marker level with the first line, however many lines the text wraps to. Rows that fit on one line don't move.
Approach
Both rows in
RestoreChoose.tsxalign to the top, and each marker drops by half the gap between one line and the marker (mt-[calc((1lh-0.875rem)/2)]for the 14 px lock,mt-[calc((1lh-0.375rem)/2)]for the 6 px dot). Because the offset follows the line height, a one-line row keeps the positionitems-centergave it at every Silo text scale and at browser font sizes up to the point where the marker gets taller than the line (about 22 px); past that the marker stays centered on the text and the row is a few pixels shorter. A fixedmt-0.5would drift off center at a larger root font size.Validation
main: with a backup whose plugin was uninstalled afterwards, the blocked group's dot sat 10.5 px below the first line at 393 px, and the lock sat the same distance off at 360 px.lint,format:check,buildandbudget:checkpass.vitest runhas 29 failures in four files unrelated to this component (request deadline, auth core, player client context, player auth refresh), which also fail onmainon the same Node 26 host. No unit test renders this component.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/restore-choose-icon-first-line/
Follow-ups
Labelis a flex container andtruncate's ellipsis doesn't apply to it. That fix runs separately.Risks
None identified. The change is two class lists on one screen.
Checklist
Council review
Rounds: 1, last reviewed 92f9fc8
Answered: Sol's S1 and Gemini's G1 (one-line rows get a few pixels shorter once the browser font is large enough for the marker to outgrow the line) are confirmed; the Approach states the limit. Gemini's repair, a one-line box around each marker, is ready as a follow-up change. Gemini's G2 and G3 (the disclosure chevron and the restart badge have the same wrapped-line problem) predate this change and run as a follow-up; G4 (a fixed icon margin in the omitted-accounts warning) is folded into it as optional. Opus found nothing.
Visual review: 2 rounds, captures from 92f9fc8
Fixed: retook the open-state captures once the chevron settles, with nothing focused, and added the three-line, German, Arabic right-to-left, opened-list and keyboard-focus captures the reviewers asked for. Answered: the other findings (orphaned words, the section chip strip, the disclosure button's touch target, indent and focus ring, the desktop rail) were present before this change and sit outside the two changed rows. The singular "1 can't be restored — they need…" copy and the clipped item names are the follow-ups above.
AI Disclosure
🤖 Generated with Claude Code