Repository navigation
fix(web): keep the start of emails and folder paths in right-to-left restore rows - #4711
Conversation
…restore rows In a right-to-left language the restore screen's account and library rows cut their left-to-right data at its start: an account showed "…[email protected]" and a library "…x-media/television4k/", with the leading "/" moved to the far end. The one-line details inherited the page's direction, so the ellipsis landed on the side where the email or path begins. An account's contact line now takes its direction from its first letter, so an email on its own reads left to right and keeps its start, while a line that opens with the translated pending-data summary still follows it. A library's folder paths read left to right, as paths do elsewhere in the app, both on the row and in its expanded list; the list is sized to its text so it stays on the page's side. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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 40 minutes. View limit details
|
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:
|
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. |
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (Opus 5.5, reviewed c85d630)
One nit, nothing blocking. The direction fix holds: every ItemRow caller in RestoreChoose.tsx gets its items from groupSectionItems, so a same-state library (whose line is a translated sentence) never reaches the new dir="ltr", and dir="auto" changes nothing on the English page.
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed c85d630)
Two low-severity findings. The contact can lose part of a valid email’s local name on the English page, and a collapsed library row can show the second Arabic folder first.
Reviewed with Codex in T3 Code (gpt-6.2-sol).
Review follow-ups to the right-to-left restore rows: - The account contact line reads left to right whenever it is only the email, instead of taking its direction from the first letter. An email whose name part starts with Arabic letters kept its order on the English page before, and `dir="auto"` reversed it. - Each of a library's folder paths on the row is its own left-to-right run, so two folders with Arabic names side by side no longer swap places. - The expanded folder list drops `max-w-full`, which changed nothing: with `break-all`, `w-fit` already keeps it inside the row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (Gemini 4 Neon, reviewed c85d630)
The three changed elements match their factual claims against the source (users_plan.go:216-221, restoreGroups.ts:141-159, 311-317, RestoreChoose.tsx:200-226, 481-505, format.ts:221-241), and native clients have no admin backup restore UI. Two remaining gaps turned up: one in the two edited Restore files (inline on RestoreUsers.tsx), and one across sibling admin screens showing the same data (below).
G2 — Sibling admin screens still clip truncated emails at their start or push LTR path lists to the far side in RTL
- Severity: low (follow-up outside this PR's bounded Restore diff)
- Trigger: Open Admin -> Users below
lg(AdminUserCompactList), Admin -> Access Groups -> Members (AccessGroupMembers), Admin Dashboard -> Users (UsersWidget), or Admin -> Libraries cards (LibraryCardList) in Arabic (dir="rtl"). - Impact: Long emails in the three user lists inherit
dir="rtl"ontruncatecontainers and lose their start (…[email protected]), matching the bug fixed inAccountRow. InLibraryCardList(cited as precedent fordir="ltr"on paths), the full-width<ul dir="ltr">lacksw-fit max-w-full, so short folder paths sit on the far left (end side) of the card in RTL rather than on the page's start side. - Evidence:
web/src/components/admin/users/AdminUserCompactList.tsx:60-62(<span className="text-muted-foreground block truncate text-sm">{user.email}</span>)web/src/components/admin/access-groups/AccessGroupMembers.tsx:338-340(<span className="text-muted-foreground truncate text-xs">{member.email}</span>inside aflex-collink)web/src/components/admin/dashboard/widgets/UsersWidget.tsx:110-112(<div className="text-muted-foreground hidden truncate text-[10px] sm:block">{u.email}</div>)web/src/components/admin/libraries/LibraryCardList.tsx:170(<ul className="text-muted-foreground space-y-1 font-mono text-xs break-all" dir="ltr">)
- Suggested repair: Either include or file a follow-up to add
dir="auto"(ordir="ltr") withw-fit max-w-fullon those full-width email blocks, and addw-fit max-w-fulltoLibraryCardList.tsx:170.
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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (Claude Opus 5.5, reviewed 46a5428)
One new nit. Round-1 items O1, S1 and S2 are fixed at this head. The pending condition on the contact span matches the data: pendingSummary returns null when nothing is pending, and without it the line is the email alone. The library string from rowSecondary reaches only ItemRow, because same-state libraries return earlier and go to SameRow. An empty path list still renders nothing.
| return item.library?.paths.join(", ") ?? null; | ||
| // Each path is its own left-to-right run (U+2066 … U+2069), so two folders | ||
| // with Arabic names side by side keep their order on the row. | ||
| return item.library?.paths.map((path) => "\u2066" + path + "\u2069").join(", ") ?? null; |
There was a problem hiding this comment.
O2 (nit): copying a library's folder path now picks up two invisible characters.
Trigger: on the Restore "Choose" step, in any language including English, select a library row's folder path and copy it. A library with a single folder shows its path only on this line, because the expanded list appears only for more than one path.
Impact: the clipboard holds U+2066 /media/movies U+2069. In Chromium, Firefox and WebKit, both a selection read and a real Cmd+C / Cmd+V into a textarea return those code points. If the admin pastes that into a shell or a folder field, the path doesn't match. On main, the copied text was the plain path.
Repair: wrap only when there are at least two paths (paths.length > 1). The span's dir="ltr" already keeps a single path in order. A multi-path row can then still be copied cleanly path by path from the expanded <ul>. To keep the clipboard clean in every case, isolate in the DOM instead: render each path in ItemRow as its own <bdi> or <span dir="ltr"> joined by ", ", and use the plain join(", ") for title.
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (Gemini 4 Neon, reviewed 46a5428)
Round-1 fixes resolve O1, S1, and the visual ordering bug in S2, but S2's string-level U+2066/U+2069 fix in rowSecondary introduces a copy/paste regression across all languages and single-path libraries (G3). Two lower-severity pre-existing gaps remain on the touched paths (G4, G5).
Round-1 record
- O1: resolved —
max-w-fullremoved inweb/src/pages/admin-backups/RestoreRows.tsx:206;w-fitwithbreak-allinside the block container already caps at 100% width. - S1: resolved —
web/src/pages/admin-backups/RestoreUsers.tsx:203restoresdir={pending ? undefined : "ltr"}; verified againstinternal/backup/users_plan.go:216-221that withoutpending,contactholds onlyaccount.email, so Arabic-local-part emails stay LTR on both English and Arabic pages. - S2: resolved (visual order) —
web/src/pages/admin-backups/restoreGroups.ts:318preserves multi-path Arabic folder order underdir="ltr", though embeddingU+2066/U+2069in the text node causes G3 below. - G1: still open — pre-existing on
main, untouched by this PR, and deferred to #4720 (reasonable deferral given the in-progressLabelclass rewrite;SameRow's<span>atRestoreRows.tsx:344is not aLabel, though fixing all three row labels together in #4720 makes sense). Non-blocking here. - G2: still open — pre-existing in other admin screens (
AdminUserCompactList.tsx:61,AccessGroupMembers.tsx:339,UsersWidget.tsx:110,LibraryCardList.tsx:170); deferred to a separate follow-up fix run (no tracking issue cited yet). Non-blocking here.
Additional finding (outside diff hunks)
- G5 (low, pre-existing) —
web/src/pages/admin-backups/RestoreRows.tsx:214(cantOpenmissing-paths sentence): The premise thatweb/src/i18n/format.tsalready isolates{paths}does not hold for root-level Arabic folders (the S2 case).- Trigger: Expand a
folder_missinglibrary whosemissing_pathscontains a root-level Arabic folder (e.g.["/أفلام"],["/أفلام/movies"], or["/أفلام", "/مسلسلات"]) in Arabic, or two such paths in English. - Impact: In RTL,
format.ts:237wraps{paths}inFSI(U+2068)…PDI(U+2069), which takes its direction from the first strong character;/is weak (CS) andأis strongAL, soFSIresolves to RTL, flipping leading/to the far end (أفلام/), reversing"/أفلام/movies"(movies/أفلام/), and swapping two paths (مسلسلات/ ,أفلام/). In LTR (English),format.ts:230adds no isolate, so["/أفلام", "/مسلسلات"]merges across", /"and swaps paths (This server can't open /مسلسلات/ ,أفلام.). - Evidence:
RestoreRows.tsx:214passesmissingPaths.join(", ")as a plain string;format.ts:228-237usesFSIonly whenrtlis true. Verified with ICU UAX #9 (ubidi_writeReordered). - Suggested repair: Pass a
ReactNodetot("web.admin.backups.restore.rows.cantOpen", { paths })(Translateinweb/src/i18n/hooks.ts:17-20acceptsRichValues) wrapping the list in<span dir="ltr">with each path in its own<span dir="ltr">{path}</span>separated by", ".
- Trigger: Expand a
| return item.library?.paths.join(", ") ?? null; | ||
| // Each path is its own left-to-right run (U+2066 … U+2069), so two folders | ||
| // with Arabic names side by side keep their order on the row. | ||
| return item.library?.paths.map((path) => "\u2066" + path + "\u2069").join(", ") ?? null; |
There was a problem hiding this comment.
G3 (medium): Literal U+2066/U+2069 characters in rowSecondary break path copy/paste in every language (including single-path ASCII libraries)
- Trigger: Open Restore → Choose in any language (including English) with any restorable or blocked library (even a single-path ASCII library like
["/mnt/media/movies"]), copy the path from the row's muted secondary text, and paste it into a terminal, config file, or path input. - Impact: The DOM text node contains literal
U+2066(UTF-8E2 81 A6) before/andU+2069(E2 81 A9) at the end. For single-path libraries,hasItemDetails/itemDetails(RestoreRows.tsx:185,195) omit the expanded<ul>, so this<span>is the only place the path is shown standalone. Pasting it into a shell fails (ls: /tmp: No such file or directory) because byte 0 is not/, and Go'sfilepath.IsAbsreturnsfalse. It also breaks in-page find across joined paths ("/a, /b"or"/a,"), adds isolates on single-path rows where<span dir="ltr">already isolates the sole path with nothing to swap, and mutates English output from the exportedrowSecondaryhelper (diverging fromweb/src/i18n/format.ts:219). - Evidence:
restoreGroups.ts:318wraps every path unconditionally;RestoreRows.tsx:294,298renders{secondary}directly as the text node andtitle. All callers ofrowSecondaryareRestoreChoose.tsx:220(ItemRow) andRestoreChoose.tsx:313(SameRow, which hits theitemState === "same"return at line 313). Verified in zsh:p=$'\u2066/tmp\u2069'; ls -d "$p"fails withNo such file or directory. - Suggested repair: Return plain
item.library?.paths.join(", ") || nullfromrowSecondary. InItemRow(RestoreRows.tsx:293-299), isolate multi-path libraries with HTML markup: whenitem.kind === "library" && itemState(item) !== "same" && (item.library?.paths.length ?? 0) > 1, render each path in<span dir="ltr">{path}</span>separated by", "(per HTML §15.3.5,[dir="ltr"]appliesunicode-bidi: isolate; direction: ltrwith zero invisible characters in DOM text, clipboard copy, or find-in-page). Keeptitleplain for single-path rows (the outerdir="ltr"already sets LTR tooltip direction); if multi-path Arabic order in the native hover tooltip matters, applyU+2066…U+2069only to the non-copyabletitleattribute whenpaths.length > 1. Re-check truncation with nested<span dir="ltr">across the three browser engines.
| // start when cut short. With the summary first, the line follows the page. | ||
| <span | ||
| title={contact} | ||
| dir={pending ? undefined : "ltr"} |
There was a problem hiding this comment.
G4 (low, pre-existing): Unisolated email after pending in RTL reverses at full width for digit-, punctuation-, or Arabic-starting local parts
- Trigger: View a matched selectable account with pending merge data (
pendingnon-null) on the Arabic page (dir="rtl") whose email starts with digits, punctuation, or Arabic letters (e.g.[email protected],[email protected],[email protected], orأحمد@example.com), even at full desktop width without truncation. - Impact: Restoring
dir={pending ? undefined : "ltr"}fixes S1 whenpendingis absent, and the PR documents start-truncation whenpendingis present in Arabic. However, leavingaccount.emailunisolated in the RTLcontactstring also reverses the address itself without any truncation: under UAX feat(search): add TMDB-backed Request to Add section to search surfaces #9, the ArabicALprefix acrosspending's opaqueFSI…PDIisolate turns leadingENdigits intoAN(rule W2), and@/./_/-betweenAN/ALandLtakes embedding directionR(rules N1/N2), rendering[email protected]asexample.com@123,[email protected]as[email protected],[email protected]as[email protected]_, andأحمد@example.comasexample.com@أحمد. - Evidence:
RestoreUsers.tsx:163-169,203joinspendingandaccount.emailwith" · "and leavesdir={undefined}whenpendingis truthy. Verified with ICU UAX feat(search): add TMDB-backed Request to Add section to search surfaces #9 (ubidi_writeReordered) on"ستتم إضافة \u206812 مشاهدة\u2069 · [email protected]"('example.com@123 · ...') vs isolating the email ('[email protected] · ...'). - Suggested repair: Keep
dir={pending ? undefined : "ltr"}on the outer<span>, and when bothpendingandaccount.emailare present, render the email inside an inline<span dir="ltr">{account.email}</span>afterpendingand" · "so the summary follows the page while the email stays LTR without adding bidi control characters.
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (web admin only: Apple, Android and Roku have no backup restore screen)
In a right-to-left language such as Arabic, the backup restore screen cuts an account's email and a library's folder paths at their start. An admin choosing which accounts to restore sees only the last letter of the name part of the address, then the domain, so the part that identifies the person is gone. A library row shows "…x-media/television4k/", having lost its first folder, with the leading "/" moved to the far end. Expanding the library row lists each folder the same way ("sandbox-media/television/"). English is not affected.
This change makes those lines read left to right in every language, so they keep their start and end in "…".
The one-line details inherit the page's direction. In a right-to-left page,
text-overflow: ellipsiscuts the line's end, which is the left side. For left-to-right text, that is where the email or path begins.Approach
dir="ltr"). A line that opens with the summary keeps the page's direction, as before.dir="ltr"), as paths already do on the Libraries and folder-browser pages. On the row, each path is its own left-to-right run (U+2066 … U+2069), so two folders with Arabic names next to each other keep their order. The expanded list is sized to its text so it stays on the page's start side..bidi-texthelper (unicode-bidi: plaintext). In Firefox and WebKit it loses or misplaces the ellipsis on a truncated line. It also reverses mixed lines such as a library name followed by Arabic status text.dir="auto"on the email reverses an address whose name part starts with Arabic letters.Validation
mainwith the admin profile in Arabic. At 360 and 1024 px the email and paths lost their start, and the expanded paths showed the "/" at the wrong end.main. No console errors.dir="ltr"keeps the start and the ellipsis; an email whose name part starts with Arabic letters keeps its order; two root-level Arabic folder paths keep their order with the per-path isolates.pnpm run lint,format:check,buildandbudget:checkpass.make verify-local-paths,verify-size-ratchetandverify-bidipass.make test-web: 7 unrelated files fail (request deadlines, auth refresh, range reads, collections select). They fail the same way onmain, and none of them imports the restore screen.Evidence
Surface and build: web admin, Admin → Backups → Restore, Arabic and English, at 360, 820, 1024 and 1440 px; before on
main(28dd148), after on 46a5428 (this head), same sandbox data.Evidence: https://evidence.siloserver.org/r/silo-server/pr-4711/
Risks
None identified. The change sets text direction on three elements of the admin restore screen and marks each folder path on the library row as its own left-to-right run. In a left-to-right page nothing visible changes.
An account that already exists on the server, with data to add, still loses the start of a long email in Arabic. Its line opens with the translated summary, and one truncated line that holds both directions can't keep the start of both. The full line is in the tooltip.
Follow-ups
AccountRow,ItemRow,SameRow) also lose the start of left-to-right names in right-to-left languages: [bug] Restore screen cuts left-to-right names at their start in right-to-left languages #4720. It follows an in-progress change that rewrites those labels.Checklist
Council review
Rounds: 2, last reviewed 46a5428
Visual review: 1 round, captures from c85d630
Fixed: the expanded folder list was added (Gemini, plan round); the width classes were kept off the one-line details (Sol and Opus, plan round); the email is
dir="ltr"again instead ofdir="auto", which reversed an Arabic-prefixed address (Sol, round 1); each path on the row is isolated, so Arabic folder names keep their order (Sol, round 1); the folder list drops a class that did nothing (Opus, round 1). Answered: the row names have the same problem onmainand are tracked in #4720 (Gemini, round 1); other admin screens with the same email truncation are being fixed separately (Gemini, round 1).Open after merge: round 2 found that copying a library row's folder path also copies the two invisible isolate marks this PR added (Opus O2, Sol S3, Gemini G3). The same round found two older cases where an email or a missing-folder path inside translated text isn't isolated (Gemini G4, G5). All three are being fixed in one follow-up.
AI Disclosure
🤖 Generated with Claude Code