Repository navigation
fix(web): keep a short email or folder path under its name in right-to-left restore rows - #4878
Conversation
…o-left restore rows When a restore row is too narrow for the name and its detail side by side, the detail moves under the name and stretched across the column. The account email and a library's folder paths read left to right, so in Arabic in Chromium-based browsers a short one sat at the far left of the row, next to the state tag, away from the name on the right. (Firefox and Safari give right-to-left list items a right text alignment, so they already showed it under the name.) The detail now takes only the width of its text, so it sits under the name on the page's start side in every browser, and a long one still fills the line and keeps its start when cut short. 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 3 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. |
| title={secondary} | ||
| dir={item.kind === "library" ? "ltr" : undefined} | ||
| className="text-muted-foreground min-w-0 truncate text-xs" | ||
| className="text-muted-foreground w-fit max-w-full min-w-0 truncate text-xs" |
There was a problem hiding this comment.
Truncated account emails can lose their logical start in RTL
In a right-to-left interface, truncation can clip the logical start of a long account email. Resolve the mailbox direction explicitly, including strong RTL digits and weak numeric prefixes, and test mixed local parts and domains at narrow widths.
Kody rule violation: Preserve the logical start of bidirectional truncated text
Prompt for LLM
File web/src/pages/admin-backups/RestoreRows.tsx, line 350:
Truncated account emails can lose their logical start in RTL
The truncated account email inherits the interface direction rather than choosing its direction from the mailbox’s Unicode bidi behavior. In a right-to-left interface, this can clip the logical start of a long email. Resolve the mailbox direction explicitly, including strong RTL digits and weak numeric prefixes, and test mixed local parts and domains at narrow widths.
Kody rule violation: [Preserve the logical start of bidirectional truncated text](https://kodus.siloserver.org/settings/code-review/1247142351/kody-rules/543088f5-5d79-48a9-804f-7c9ce6776d3a?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
This line is ItemRow, which doesn't show account emails; the account email is in AccountRow (RestoreUsers.tsx). This PR doesn't change either line's direction. It only adds w-fit max-w-full, so the line takes its text's width. An account line that is only the email has been dir="ltr" since #4711, which keeps the email's start when it's cut short. That PR tried dir="auto" and dropped it because it reversed an address starting with Arabic letters. The case still open is a merging account whose line starts with the pending summary and ends with the email: in Arabic it loses the email's start. That's #4880, to fix after this PR.
🤖 Claude Code (claude-opus-5-5)
There was a problem hiding this comment.
Thanks for the correction. The suggestion is misplaced: ItemRow does not display account emails, and this PR changes the sizing classes, not the text direction.
The separate truncation issue for merging accounts is tracked in #4880. I’ll treat this suggestion as not applicable to the changed line.
| title={secondary} | ||
| dir={item.kind === "library" ? "ltr" : undefined} | ||
| className="text-muted-foreground min-w-0 truncate text-xs" | ||
| className="text-muted-foreground w-fit max-w-full min-w-0 truncate text-xs" |
There was a problem hiding this comment.
Mixed-direction folder paths can reorder their delimiters
Rendering the library detail as one left-to-right text run can misrepresent mixed-direction paths. Isolate path components while preserving delimiters and filename punctuation, and verify visual order and copied text for Arabic, Hebrew, and Latin paths.
Kody rule violation: Isolate bidirectional URL components without reordering delimiters
Prompt for LLM
File web/src/pages/admin-backups/RestoreRows.tsx, line 350:
Mixed-direction folder paths can reorder their delimiters
The library detail is rendered as one left-to-right text run, so mixed-direction folder names can reorder path delimiters. Render path components in bidi-isolated segments while preserving their delimiters and filename punctuation, and verify both visual order and copied text for Arabic, Hebrew, and Latin paths.
Kody rule violation: [Isolate bidirectional URL components without reordering delimiters](https://kodus.siloserver.org/settings/code-review/1247142351/kody-rules/045e17ea-e5d3-40d1-8e9f-044195c20418?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Confirmed, but it doesn't come from this PR: the row's text and its dir="ltr" are unchanged here. Each path is already its own left-to-right run (U+2066…U+2069), so two paths keep their order. Within one path, neighbouring right-to-left folder names still display right to left: in Chromium, /media/أفلام/عربية shows عربية to the left of أفلام. Every place the web app shows a path as one left-to-right run does the same, including the expanded folder list on this page, the folder browser and library locations. Isolating path components is therefore an app-wide change, and I've raised it with the maintainer rather than add it here.
🤖 Claude Code (claude-opus-5-5)
There was a problem hiding this comment.
Thanks for clarifying. Since the mixed-direction path behavior predates this PR and affects multiple parts of the app, it makes sense to address it separately. The suggestion should not block this alignment fix.
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed 99d7677)
One low-severity finding. The /silo run posted it on the reviewer's behalf, because the reviewer's tool couldn't pin the commit, and reproduced it in the real component first. Score: 9/10.
| title={secondary} | ||
| dir={item.kind === "library" ? "ltr" : undefined} | ||
| className="text-muted-foreground min-w-0 truncate text-xs" | ||
| className="text-muted-foreground w-fit max-w-full min-w-0 truncate text-xs" |
There was a problem hiding this comment.
S1 · low: a short path can lose the edge of its last glyph. w-fit makes the span exactly as wide as its text, and truncate's overflow: hidden then clips ink that reaches past the last glyph's advance width, even when the whole path fits. With /media/भालू as a library's only folder, about 1 CSS px of the final vowel sign's hook is cut off in Chromium, Firefox and WebKit, on English and Arabic pages. Before this change a stacked line had the rest of the column beside it. The same clipping already happens wherever a truncate span is sized to its text, including these rows when the name and detail sit side by side.
Suggested repair: keep the span stretched and give the left-to-right detail text-align: match-parent (with the -webkit-match-parent fallback) below @2xl.
Problem
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (no backup restore screen); Android N/A (no backup restore screen); Roku N/A (no backup restore screen)
In Chrome, Edge and other Chromium-based browsers, the backup restore Choose step in Arabic (or another right-to-left language) showed a short account email or library folder path at the far left of a narrow row, next to the state tag, while its name sat at the right edge. This change keeps the email or path under its name in every browser.
Below 42rem a restore row puts the name above its detail line, and the detail stretched across the column. The account email and a library's folder paths are set
dir="ltr"so a long one keeps its start when cut short (#4711). In Chromium that also aligned their text to the left edge of the stretched box. Firefox and Safari didn't show it: in a right-to-left list they give list items a right text alignment, which the line inherited. A long email that fills the line hid the problem; a short one, such as a six-letter name at example.com or/media/movies, showed it. It happened on phones, and at desktop widths where the list sits beside the restore summary and its rows stack.Approach
The account row's contact line (
AccountRow) and the item row's detail line (ItemRow) now take the width of their text (w-fit), so the stacked line sits at the row's start side, under the name, in either direction, whatever text alignment it inherits.max-w-fullcaps it at the space beside the checkbox, so a long email or path still ends in "…" and keeps its start. The expanded folder list on the same page already usesw-fitfor the same reason. Rows wide enough to show the name and detail side by side don't change, and neither does English.Validation
RestoreChoosestep and fixture data in a temporary dev-only route (not committed), in Arabic and English at 360, 393, 820, 1024 and 1440 px. No dev sandbox could start at the time (the build host had no free Docker network address pools), so this was not checked against a live server.pnpm run lint,format:check,build,budget:check,make lint-changed,make verify-local-pathspass. The restore page's tests pass.make test-webfails in 9 files outside this page (request deadlines, auth refresh, player range reads, admin collections, home rows, sign-in settings); run alone onmain, six of the nine fail too and the rest fail intermittently under load. None imports the changed components.Evidence
Surface and build: web admin, backup restore Choose step; local dev build of this branch, Arabic and English, Chromium, Firefox and WebKit.
Evidence: https://evidence.siloserver.org/r/silo-server/restore-rtl-detail-align/
Risks
None identified. Class changes on two spans in one admin page.
Follow-ups
CardPath); a separate fix is in progress.Council review
Background review: 1 round on 99d7677
Open after merge: S1 (Sol). A short stacked path whose last glyph overhangs, such as a Devanagari folder name, loses about 1 CSS px of that glyph's ink, because the span is now exactly as wide as its text. Reproduced in Chromium, Firefox and WebKit. Every other
truncatelabel sized to its text clips the same way, including these rows when name and detail sit side by side. Left for the maintainer to decide.Visual review: 2 rounds, captures from fbb0038f (the head since then changes only comments)
Fixed: full-page captures, the stacking point, an Arabic-script name and Firefox and WebKit captures were added (all three, round 1). The evidence now says the bug showed only in Chromium (Sol, Opus and Gemini, round 2, on the Firefox and WebKit before captures). Answered: small Arabic status text at 820 px, the second folder hidden when a path is cut, a long path starting away from its name, slack before "…", contrast and tap targets, and status labels not lining up between rows all look the same before and after and are outside this change. Filed separately: a merging account's email loses its first part when its line is cut short in Arabic (Gemini, round 1); its fix edits the same line, so it waits for this PR (#4880).
Checklist
AI Disclosure
🤖 Generated with Claude Code