Skip to content

fix(web): wrap long never-restored setting keys on narrow phones - #4947

Merged
Quick104 merged 2 commits into
mainfrom
fix/restore-never-restored-keys-wrap
Nov 21, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/restore-never-restored-keys-wrap

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 (backup restore exists only in the web admin)

On a 320 px phone, the backup restore Choose step cuts off part of its list of settings that are never restored. Each setting key in that list (shown after "Show them" in the Settings section) was one unbreakable token, so recommendations.policy_marked_generation, which every restore set includes, ran about 25 px past its line. With larger browser text the same happens on wider phones. The reviewer of #4810 found it.

Approach

Each key now renders with BreakableKey, the helper the restore settings diff already uses, so it can break after a dot or underscore. Each key and its comma sit in one inline-block capped at the line width: a key that fits stays whole, and only a key longer than the line wraps inside itself. Adding break points without that box would split keys at every line end, even on desktop. A wrapped key indents its later lines by 1ch, and text-wrap: pretty keeps a short tail like id, off a line of its own in browsers that support it (Chromium and WebKit; Firefox ignores it).

BreakableKey no longer breaks before a *, so prefix entries such as s3.* keep their star. That only matters where a . or _ comes right before *, which the other callers' setting keys and labels don't contain.

Validation

  • Reproduced and checked in Chromium, WebKit, and Firefox with the real RestoreChoose component on a temporary dev-only page (not committed), fed the server's 43-entry never-restored list. A Silo dev deployment wasn't available.
  • At 320 px the list held 313 px of content in a 288 px box in Chromium before the fix (320 px in WebKit). After it, every key stays inside the screen at 320 px and at 375 px with 125% text, in all three engines. Nothing changes at 390 px and wider.
  • At 320 px with 200% text every key now fits inside the list, but 10 to 14 keys are still cut off at the screen edge (25 to 35 before). The list itself is wider than the screen there because the summary panel's "Review restore" button sets the minimum width of the Choose step's one-column phone grid. That is the same on main and outside this change.
  • The list's text content is unchanged, the space between keys on one line is the same in all three engines, and right-to-left pages still show each key left to right.
  • pnpm run lint, format:check, build, and budget:check pass. make test-web passes apart from three 5 s timeouts in AdminCollections.select.test.tsx and AdminHomeRows.concurrency.test.tsx on a heavily loaded host; both files pass with a longer timeout and neither imports this code.
  • No new test: the change is layout only.

Evidence: https://evidence.siloserver.org/r/silo-server/restore-never-restored-keys-wrap/

Risks

None identified. The change is CSS and markup in one admin list, plus the * rule in BreakableKey.

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

Background adversarial review: 1 round, reviewed 30ebd58 (before main was merged into the branch)

Member Round 1
Sol (gpt-6.2-sol, xhigh) 8/10 (not posted: GitHub returned 401)
Opus (claude-opus-5-5, high) 8/10
Gemini (gemini-4-neon, xhigh) unavailable (provider quota)

Answered: O1, a keyed Fragment in place of the outer <span>; the span predates this PR and the swap changes neither layout nor the accessibility tree.
Answered: S1, in Firefox a double-click inside a key that wraps selects only up to the line end (policy_marked_ instead of policy_marked_generation). Firefox ends a double-click selection at any soft line wrap; on a key that fits on one line the selection is the same with or without the break points, in all three engines. The only way to avoid it is not wrapping, which is the overflow this PR fixes.

Visual review: 2 rounds, on captures from a dev-only page that rendered the real component. Round 2 added WebKit, Firefox, 200% text, right to left, and the closed list.

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

Fixed: a wrapped key left a short tail such as id, flush left, where it read as its own setting; text-wrap: pretty and the 1ch hanging indent address it, and the captures were retaken full page with the disclosure settled. Answered:

  • Firefox doesn't apply text-wrap: pretty, so it can still leave id, on its own line; the indent marks it as part of the key above.
  • The clipping at 320 px with 200% text comes from the grid and summary panel described under Validation, and looks the same before the change.
  • At 200% text WebKit can start a wrapped key with a short first line such as ai.; pretty only adjusts the last line, and this happens only at that size.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, T3 Code, Codex (council review), Antigravity (council review), Playwright (captures)
  • Model(s): claude-opus-5-5 (implementation and review), claude-sonnet-5-5 (review finders), gpt-6.2-sol, gemini-4-neon
  • Involvement: Fully AI-generated. The agent verified it in three browser engines; a person has not verified it yet.
  • Adversarial review: a multi-agent code review on claude-opus-5-5 and claude-sonnet-5-5 (three finders and a validation pass, then a rerun on the final diff) found no defects; it led to one comment rewording and one readability change. Claims that the per-key box mirrors keys in right-to-left pages, widens the gap between keys in WebKit, or adds screen-reader stops were checked in the browser and didn't hold. The plan round was skipped because the fix is a few lines at the root cause using an existing helper. A simplify pass dropped one redundant argument. See Council review for the background and visual reviews.

🤖 Generated with Claude Code

Note

Fix never-restored settings key wrapping on narrow phones

Makes the expanded never-restored settings list in the admin-backups restore dialog wrap cleanly on narrow screens. Keys render in BreakableKey with hanging indentation, commas stay attached to their keys, and entries separate with spaces instead of a shared separator (see RestoreChoose.tsx). Also updates BreakableKey in RestoreRows.tsx so dots and underscores no longer break before an asterisk, and dots do not break before digits or other dots.

Macroscope summarized 67df1a5.

The restore Choose step listed the settings a restore never writes as
unbreakable code tokens, so recommendations.policy_marked_generation ran
past its line on a 320 px phone, and larger browser text pushed more keys
off wider screens.

Each key now uses BreakableKey and sits with its comma in one inline-block
capped at the line width: it stays whole when it fits and otherwise wraps
at a dot or underscore, with a hanging indent and text-wrap: pretty to keep
a short tail off its own line. BreakableKey no longer breaks before "*", so
a prefix such as s3.* keeps its star.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 17 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: 05ba32e9-18e8-440c-91f2-87c2626fe48d
Commits

Reviewing files that changed from the base of the PR and between 2b08e47 and 67df1a5.

Files selected for processing: 2

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

@silo-triage silo-triage Bot added the size/S 0–49 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: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T06:20:48.645222Z 67df1a5 New commits
🔒 Security Review ✅ Completed 2026-11-21T06:22:33.941436Z 67df1a5 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 javascript Pull requests that update javascript code 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 30ebd58)

I reviewed this for cuts: a simpler approach, an existing helper, or parts the reported overflow doesn't need. One small cut survived, posted inline as O1.

Things I tried to cut but kept, because the fix needs them:

  • BreakableKey is the directory's existing helper for "break at dots and underscores, not inside a word". break-words on the <p> alone would fix the overflow, but it would split recommendations.policy_marked_generation at an arbitrary letter.
  • The inline-block span keeps each key whole when it fits. Without it, keys break at their dots wherever a line ends, even when the next line has room for the whole key.
  • max-w-full together with break-words covers a segment longer than the line at large text. Shrink-to-fit width alone stops at min-content.
  • The comma sits inside the inline-block so it can't start a line. That needs the two constants in place of one KEY_SEPARATOR.
  • The regex change prevents a lone * line for notifications.push_relay_* when the available width is between 25 and 27 characters, and Firefox has no text-pretty to fall back on. I ran the old and new regex over the real keys, plus silo.tmdb 1.2.3, a..., and My_Movies. Only the two * prefixes change.

Score: 8/10.

AI disclosure: this review was written by Claude Opus 5.5 (claude-opus-5-5) running in Claude Code.

className="text-muted-foreground ps-5 pt-1 text-xs leading-relaxed break-words"
>
{neverRestoredSettings(keys).map((key, position, entries) => (
<span key={key}>

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.

O1 (nit): this outer <span> no longer does anything. Before this PR it held the separator and the <code>. Now it holds only the KEY_GAP text node and the inline-block span, which carries the layout itself. The gap is a plain text node between inline-blocks, so it wraps the same way whether it sits in this span or directly in the <p>.

Trigger: every rendered key. Impact: one extra wrapper element per key (43 today) and a nesting level readers have to work out. Layout and the accessibility tree stay the same either way, because a span is a generic node.

Suggested repair: use a keyed fragment and add Fragment to the react import:

<Fragment key={key}>
  {position > 0 ? KEY_GAP : null}
  <span className="inline-block max-w-full ps-[1ch] -indent-[1ch] text-pretty">…</span>
</Fragment>

The fix still works without the span: wrapping and spacing come from the inline-block spans and the gap text node between them, and both stay.

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.

Leaving this as is. The keyed <span> predates this PR (it held the separator and the <code> before), and swapping it for a Fragment changes neither layout nor the accessibility tree, as you note. Keeping it kept the diff to the fix. It's a fine cleanup for whoever next edits this list.

🤖 Claude Code (claude-opus-5-5)

…tored-keys-wrap

# Conflicts:
#	web/src/pages/admin-backups/RestoreChoose.tsx
@Quick104
Quick104 merged commit 4e78401 into main Nov 21, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/restore-never-restored-keys-wrap branch November 21, 2026 06:32
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 javascript Pull requests that update javascript code 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