Repository navigation
fix(web): keep restore account emails in order and from their start in right-to-left languages - #5010
Conversation
…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 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:
|
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
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. |
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 itsdir, 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.mdgets a rule for lines like this one.Validation
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.src/pages/admin-backupsandsrc/lib/direction.test.tspasses (45 tests). No test added: this is layout only.Evidence: https://evidence.siloserver.org/r/silo-server/issue-4880/
Risks
emailDir, so the admin user lists show it the same way. A short prefix such as2024stays visible, and the tooltip has the full address. Found by Sol's background review and accepted.Checklist
Council review
Background review: 1 round, reviewed b58cec1
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 fixeddir="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
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
emailDirrule, and phone rows alternating between one and two lines were judged acceptable by both reviewers who raised it.AI Disclosure
🤖 Generated with Claude Code
Note
Fix RTL ordering and truncation of restore account emails in
AccountRowemailDir.AccountRowcontact line no longer includes the username; name width and truncation now key offhasContactinstead of the old joined string.Macroscope summarized b58cec1.