Skip to content

fix(web): keep restore account emails in order and from their start in right-to-left languages - #5010

Merged
Quick104 merged 1 commit into
mainfrom
fix/issue-4880-restore-merge-email-start
Nov 21, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/issue-4880-restore-merge-email-start

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #4880
Closes #4836
Related issue: N/A
Validation tasks: none

Other clients: N/A (web admin only: Apple, Android and Roku have no backup restore screen)

On the backup restore Choose step in a right-to-left language such as Arabic, an account's email could lose the part that identifies it. An account that already exists on this server and has data to add shows " · " under its name. When that line was cut short, the "…" landed on the email's start, so it read "…example.com" and couldn't be told apart from other addresses on the same domain.

#4836 reported two more problems on the same line. An address whose name part is only digits read domain-first after the Arabic summary ("…le.com@12345"). On an account with no summary, the line is only the email and was forced left to right, so a long address written in Arabic script lost its first letters. In English, a long summary could push the email off the line entirely.

Approach

The summary and the email are now separate parts, each cut at its own end, so each keeps its start. The summary follows the page. The email takes emailDir(), the helper the admin user lists use: a Latin or digits-only address reads left to right, and one whose name part is in Arabic script follows the page. Each part has its own tooltip, which reads in that part's direction. One cut line can't do this whatever its dir, because the "…" always falls at the line's end, so whichever part sits there loses its start.

When the summary and the email don't fit on one line, the email moves to its own line, so neither is cut short unless it's wider than the line on its own. The "·" is hidden whenever the email starts a line, using the same technique as the admin user page's header. A merging row is one line taller when that happens: on phones for most merging accounts, and on wider screens only when a long name leaves too little room.

The line keeps #4878's sizing (a short line sits under the name) and #4928's rule that an email already shown as the row's name isn't repeated. It no longer has a username part: the server labels an account with its username, or with its email when it has none (internal/backup/users_plan.go), so a username different from the label never reached the line.

The right-to-left section of web/src/i18n/README.md gets a rule for lines like this one.

Validation

  • Reproduced on main (3a8bd228) with the real Choose step and fixture data on a temporary dev-only page (no dev sandbox could start), in Chromium 153, Firefox 155 and WebKit 26.6, in Arabic and English, from 320 to 1440 px. In the page I measured whether each email's first character, each summary's first character and each summary's count is painted. Before, six of eleven accounts lost the email's start (45 cases, mostly Arabic at phone widths; one long row also at 720, 820 and 1440 px). After, none do, and every summary keeps its start and count. WebKit misreports glyphs hidden under an ellipsis, so it was checked by screenshot.
  • The email moved to its own line at 320–393 px, and at 720 px and wider only for an account with a long name and a long address. The "·" was hidden every time it did and shown every time both parts shared a line. Nothing is cut at 720 px and wider. Lines that fit keep the same width and position as before, rows stack at the same widths, and no page scrolls sideways.
  • [bug] Restore account email reads out of order or loses its start in Arabic #4836, all three engines: an address whose name part is only digits read domain-first before and reads in order after. A long Arabic-script address on a line with no summary lost its start at 320–360 px before and keeps it after.
  • Web typecheck, ESLint and Prettier pass. Vitest for src/pages/admin-backups and src/lib/direction.test.ts passes (45 tests). No test added: this is layout only.
  • Not checked: a live server, the page inside the admin sidebar, and native tooltips (they don't render in a headless browser).

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

Risks

  • Copying the whole line now puts line breaks between the summary and the email in Chromium and Safari, because each part is its own box. The accessibility tree reads the summary and then the email, without the "·".
  • An address whose name part is in Arabic script follows the page, as in the admin user lists. When one is too long for the row, the cut falls on the domain rather than on the name part. This is unchanged.
  • On an account with no summary, an address whose name part opens with a run of digits wider than the row and then has an Arabic letter (about 30 digits at phone width) now shows only the end of that run on a right-to-left page; before, the forced left-to-right line kept its first digits. It follows emailDir, so the admin user lists show it the same way. A short prefix such as 2024 stays visible, and the tooltip has the full address. Found by Sol's background review and accepted.

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 review: 1 round, reviewed b58cec1

Member Round 1
Sol (gpt-6.2-sol, xhigh) 1 finding (P3), accepted: a digit run wider than the row loses its first digits (see Risks), 8/10
Opus (claude-opus-5-5, high) no findings, 8/10
Gemini (gemini-4-neon, xhigh) no findings, 9/10

Plan round, before implementing: Sol and Opus. Gemini was unavailable (quota, retried once). Sol's findings changed the plan: the email takes emailDir() instead of a fixed dir="ltr", the unreachable username part was dropped, and WebKit is checked by screenshot because it misreports glyphs under an ellipsis. Opus found the plan minimal apart from two nits, both taken.

Visual review: 2 rounds

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

Fixed: the summary cut to a bare number on phones (the email now moves to its own line), uneven spacing around the "·", and, after round 2, a long address cut short beside the name on wide rows. That last fix and a rebase onto #4978's row layout came after the reviewed captures; both were checked by measurement and new captures, not re-reviewed. Answered: an address whose name part is in Arabic script follows the shared emailDir rule, and phone rows alternating between one and two lines were judged acceptable by both reviewers who raised it.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; T3 Code delegated tasks (Codex, Claude, Antigravity); Playwright for captures
  • Model(s): claude-opus-5-5; gpt-6.2-sol; gemini-4-neon; claude-sonnet-5-5
  • Involvement: Fully AI-generated. The agent verified it in the captures and measurements; a person has not checked it yet.
  • Adversarial review: a code review at xhigh (three finders, a verifier and a sweep), and a second pass after the layout changed, added the per-part tooltips, the README rule, and the hidden separator for screen readers. The plan round and the visual and background reviews are under Council review above.

🤖 Generated with Claude Code

Note

Fix RTL ordering and truncation of restore account emails in AccountRow

  • Fixes the account contact line in RestoreUsers.tsx so the pending summary and email keep correct order and direction in right-to-left languages. Each part now renders as a separate truncating flex item with its own title tooltip; the email span uses emailDir.
  • Drops the account username from the contact line, and shows the email only when it exists and differs from the row label. The line can wrap, with a middle-dot separator before the email when both parts are present.
  • Adds matching guidance to the i18n README for truncating mixed-direction lines.
  • Behavioral Change: AccountRow contact line no longer includes the username; name width and truncation now key off hasContact instead of the old joined string.

Macroscope summarized b58cec1.

…n right-to-left languages

On the backup restore Choose step, an account that already exists on this
server and has data to add shows what the restore will add, then its
email, under its name. That was one cut line in the page's direction, so
in Arabic the "…" fell on the email's start ("…example.com"), an address
whose name part is only digits read domain-first, and on an email-only
line a long Arabic-script address lost its first letters.

The summary and the email are now separate parts, each cut at its own
end. The email takes emailDir(), as in the admin user lists, and each
part carries its own tooltip. When both don't fit on one line, the email
moves to its own line and the separator before it is clipped, as in the
user detail header. The line drops its username part, which never showed:
the server labels an account with its username, or its email when it has
none. The i18n README gets a rule for lines like this one.

Closes #4880
Closes #4836

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

@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 28 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: ced17285-15aa-4962-bb5e-eb3e34b5dca7
Commits

Reviewing files that changed from the base of the PR and between 3a8bd22 and b58cec1.

Files selected for processing: 2

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

@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-21T10:25:27.050312Z b58cec1 PR opened
🔒 Security Review ✅ Completed 2026-11-21T10:27:13.031780Z b58cec1 PR opened
ℹ️ 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 merged commit ac8f4af into main Nov 21, 2026
19 checks passed
@Quick104
Quick104 deleted the fix/issue-4880-restore-merge-email-start branch November 21, 2026 10:33

@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 b58cec1)

Reviewed with Codex (gpt-6.2-sol).

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

1 participant