Skip to content

fix(web): keep the start of emails and folder paths in right-to-left admin lists - #4735

Merged
Quick104 merged 6 commits into
mainfrom
fix/admin-email-rtl-truncation
Nov 21, 2026
Merged

Quick104 merged 6 commits into
mainfrom
fix/admin-email-rtl-truncation

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 (web admin only: Apple, Android and Roku have no user, access group, dashboard or library management screens)

In a right-to-left language such as Arabic, three web admin screens cut a long email at its start:

  • Admin → Users on phones and tablets.
  • An access group's member list.
  • The dashboard's Users widget.

The admin sees "…" followed by the last few letters of the name part and the domain, so the part that identifies the person is gone. On the Libraries cards (phones and tablets), a library's folder paths sit against the card's far edge instead of under the folder count. English is not affected.

This change makes those email lines read left to right in every language, so a long email keeps its start and ends in "…". The email lines and the folder list now sit on the page's start side.

The email lines inherited the page's direction. In a right-to-left page, text-overflow: ellipsis cuts the left side of the line, and that is where a left-to-right email begins. The folder list already read left to right, but as one block spanning the card's full width, so its paths started at the card's left edge.

Approach

  • The email lines on the three screens read left to right, and are only as wide as their text (w-fit max-w-full). A short email still starts under the username, and a long one still truncates.
  • An address whose name part (before the @) starts in a right-to-left script keeps the page's direction, as before. The account email validator accepts such addresses. Forcing them left to right would cut their start instead, because the first character of a right-to-left run sits at its right end, where the ellipsis goes.
  • "Starts in a right-to-left script" means the name part's first strong character in the bidi algorithm's sense is right to left. Strong characters are letters, plus right-to-left punctuation and digits such as the Hebrew maqaf and Adlam digits. ASCII, Persian, fullwidth and Arabic-Indic digits are weak and are skipped. A name part with no strong character reads left to right, except one of Arabic-Indic digits, which follows the domain.
  • emailDir in web/src/lib/direction.ts makes the choice. Unlike dir="auto", it never turns an email right to left on a left-to-right page.
  • Each path on a Libraries card reads left to right and is only as wide as its text, so every path sits on the page's start side, even beside a path long enough to wrap. Sizing the whole list to its longest path, as the restore screen does, would leave short paths at the far edge on a phone whenever one path wraps.
  • dir="auto" and the .bidi-text helper were rejected for the reasons fix(web): keep the start of emails and folder paths in right-to-left restore rows #4711 found. dir="auto" reverses an email whose name part starts with Arabic letters, and .bidi-text loses or misplaces the ellipsis in Firefox and WebKit.

Validation

  • Not reproduced on a live server, because no test server could be started. Instead, a temporary dev-only page rendered the four real components with the app's styles, fonts and Arabic text, in Chromium at 393, 834 and 1440 px. The page was removed before commit.

  • On main, the first character of a long email fell outside its line:

    • in the users list and the member list at 393 px;
    • in the Users widget at its narrowest dashboard width.

    Folder paths started up to 748 px from the card's start edge.

  • With this change:

    • the email keeps its first character and ends in "…";
    • short emails start where their username starts;
    • an address written in Arabic script, or with Adlam digits, keeps its start, as on main;
    • a name part of ASCII or Persian digits now keeps its first digit (on main it was clipped);
    • Arabic-Indic digits before a Latin name keep the Latin part's start;
    • every folder path sits at the card's start padding, including a short path next to one that wraps, and the cards with their paths collapsed.
  • English captures are identical before and after, apart from the "Last scanned" clock.

  • Firefox and WebKit were not run for this change. fix(web): keep the start of emails and folder paths in right-to-left restore rows #4711 checked the same dir="ltr" truncation in all three engines.

  • A table test for emailDir (web/src/lib/direction.test.ts) covers each address case above. It fails on the PR's previous head 477261dc at the Arabic-Indic-digit cases, and passes now.

  • Web checks pass: pnpm run lint, format:check, build and budget:check, and the access groups page tests.

  • Repository checks pass: make lint-changed, verify-bidi, verify-local-paths, verify-size-ratchet and verify-case-collisions.

Evidence

Surface and build: web admin (Users list, Access groups → members, dashboard Users widget, Libraries cards), Arabic and English, at 393, 834 and 1440 px. Before on main (262ac3d), after on b8811b67.

Evidence: https://evidence.siloserver.org/r/silo-server/admin-email-rtl/

Risks

None identified. The change sets text direction and width on four elements of admin screens. In a left-to-right page nothing moves.

Out of scope, each being fixed separately:

  • Long usernames in the same rows still lose their start in a right-to-left language.
  • The invitations list cuts a long email at its start.
  • Several other screens cut a file path at its start.
  • The restore screen's email line and folder list can sit on the far side on a phone.

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

Rounds: 3, last reviewed a757b425

Member Round 1 (bdfa0b1b) Round 2 (f848b2cb) Round 3 (a757b425)
Sol (gpt-6.2-sol, xhigh) 8/10 8/10 8/10 (findings below; its review didn't post)
Opus (claude-opus-5-5, high) 9/10, no findings 9/10, no findings 9/10, no findings
Gemini (gemini-4-neon, xhigh) failed (provider quota) 8/10 (retry)

Visual review: 2 rounds, final captures from bdfa0b1b. Round 2 covered the Libraries cards.

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

Fixed:

  • An email written in Arabic script lost its start when cut short, because the branch's first version forced every email left to right. Such an address now keeps the page's direction, as on main (Sol S1, background round 1, f848b2c).

  • Two numeric name parts still lost their start in Arabic. A name part of Adlam digits lost its start because the helper only looked at letters, so the domain decided (a regression from main). A name part of ASCII digits before an Arabic domain lost its first digit (also clipped on main). The direction now comes from the name part only, and right-to-left digits count like right-to-left letters (Sol S2 and S3, background round 2, a757b42).

  • Three more name parts got the wrong direction:

    • A name part that is only the Hebrew maqaf (right-to-left punctuation) read left to right and lost its start.
    • Persian digits before a Latin domain lost their first digit.
    • A fullwidth digit before an Arabic name forced it left to right.

    The rule now counts only characters that set a line's direction (Sol S4 and S5, background round 3, 477261d).

  • 477261d counted Arabic-Indic digits as right to left, so ١٢٣.alice…@example.test lost its Latin start. Only strong characters decide now. A name part of Arabic-Indic digits alone follows its domain, and a table test covers each case (Gemini G1, background round 3, b8811b6).

Round 3 was the last background round, so the fixes in 477261d and b8811b6 had no review round of their own. They were checked with the table test and in Chromium.

  • A short folder path went back to the card's far edge whenever a path beside it wrapped. Each path now sits on the start side on its own (Gemini and Opus, round 1).

Answered:

  • Long usernames in the same rows are cut at their start too. That happens on main as well, and it is being fixed separately (all three, round 1).
  • A cut email's "…" stops a few pixels short of the username's edge. The gap is the space left after the last whole character, which CSS ellipsis always leaves (all three, round 1).
  • The dashboard widget's "Manage ›" link already draws its mark mirrored in Arabic (Gemini, round 1).
  • A long path breaks inside a folder name because of break-all, which is unchanged from main. A wrapped path's second line starts from the left, as wrapped left-to-right text does (round 2).

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code; T3 Code delegated tasks for the council (Codex, Claude, Antigravity); Playwright for captures
  • Model(s): claude-opus-5-5 (implementation); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (council); claude-opus-5-5 and claude-sonnet-5-5 (code-review subagents)
  • Involvement: Fully AI-generated. The agent verified it in a dev-only page with the real components; a person has not verified it yet.
  • Adversarial review: no plan round, because the fix is mechanical. Code review ran at xhigh effort with three finders, a sweep, a verifier and a 1.0 validation check. It changed nothing; no passed case is affected. A three-model visual review checked the captures, and a background review runs on the PR. See Council review.

🤖 Generated with Claude Code

Note

Fix email and folder-path direction in right-to-left admin lists

Adds an emailDir helper in direction.ts that sets left-to-right direction on emails unless their local part (or domain, when the local part has only Arabic digits) starts right-to-left, in which case direction stays inherited. Covers this behavior with parameterized tests in direction.test.ts.

  • Applies the helper to member and user emails in AccessGroupMembers.tsx, UsersWidget.tsx, and AdminUserCompactList.tsx, each with a text-sized max-width box so truncated text keeps the email start visible.
  • In LibraryCardList.tsx, moves left-to-right direction from the whole path list to each path item so the list inherits the page direction while paths read left to right.
  • Risk: startsRightToLeft now uses a renamed regex with unchanged matching; only email direction and path-item layout change.

Macroscope summarized 072644c.

…admin lists

In Arabic, the admin users list, an access group's member list and the
dashboard's Users widget cut a long email at its start, and the Libraries
cards put a library's folder paths on the card's far side.

The email lines and each folder path now read left to right in any
language, so a cut email keeps its start and ends in "…". They are sized
to their text so they stay on the page's start side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 36 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: c4b19f98-b2ca-4ca4-97c8-0705ddd0bb2b
Commits

Reviewing files that changed from the base of the PR and between c1e36dc and 072644c.

Files selected for processing: 6

  • web/src/components/admin/access-groups/AccessGroupMembers.tsx
  • web/src/components/admin/dashboard/widgets/UsersWidget.tsx
  • web/src/components/admin/libraries/LibraryCardList.tsx
  • web/src/components/admin/users/AdminUserCompactList.tsx
  • web/src/lib/direction.test.ts
  • web/src/lib/direction.ts
  • 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-21T03:57:01.313913Z 072644c New commits
🔒 Security Review ✅ Completed 2026-11-21T03:59:39.817892Z 072644c 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 size/S 0–49 added + deleted lines (all files); change volume, not priority. 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 (gpt-6.2-sol, reviewed bdfa0b1)

The layout works for ASCII addresses and folder paths. Right-to-left addresses lose their beginning when truncated. 8/10.

Validated features

The diff changes how the compact list presents account emails in #1197 C1. In #1200 C1/C2, the row-selection display can change, and the View As action and impersonation flow use the same handlers. I traced those paths in source and reproduced the text rendering in browser fixtures.

Forcing the email lines left to right kept the start of a Latin address
on a right-to-left page, but cut the start of one written in Arabic
script, which the account email validator accepts: the Arabic run's
first letter sits at its right end, where the ellipsis goes.

An email line now reads left to right only when its first letter is from
a left-to-right script. An Arabic or Hebrew address keeps the page's
direction, as before this branch, so it keeps its start too. Left-to-right
pages are unchanged.

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 ❌

@silo-triage silo-triage Bot removed the size/S 0–49 added + deleted lines (all files); change volume, not priority. label 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 (gpt-6.2-sol, reviewed f848b2c)

S1 is resolved in all three layouts. Two numeric mailbox cases still lose the start of the address in a narrow Arabic Users widget.

Score 8/10.

Comment thread web/src/lib/direction.ts Resolved
Comment thread web/src/lib/direction.ts Resolved
An email whose name part is Adlam digits lost its start in Arabic: the
helper only looked at letters, so the Latin domain forced it left to
right. One whose name part is ASCII digits before an Arabic domain lost
its first digit, because the domain set the direction.

emailDir now reads only the part before the @, treats right-to-left
digits like right-to-left letters, and reads left to right when that
part has only ASCII digits or punctuation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 ❌

…part

emailDir took the first letter or non-ASCII digit of the name part. It
skipped right-to-left punctuation such as the Hebrew maqaf, so a name
part made of it read left to right and lost its start. And it counted
every non-ASCII digit as setting the direction: Persian digits before a
Latin domain kept the page's direction and lost their first digit, and a
fullwidth digit before an Arabic name forced it left to right.

It now counts letters, the right-to-left punctuation and digits that set
direction (bidi class R), and Arabic-Indic digits, and skips other digits
and punctuation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 ❌

@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 (gemini-4-neon, reviewed a757b42)

The four component layout changes and folder-path alignment hold in RTL and LTR across Chromium, Firefox, and WebKit, and the earlier Arabic, Adlam-digit, and ASCII-digit truncation issues are fixed; one edge-case regression remains in emailDir for Arabic-Indic and Extended Arabic-Indic (Persian/Urdu) digits.

Score: 8/10

Comment thread web/src/lib/direction.ts Resolved
emailDir counted Arabic-Indic digits as right to left, so an address
such as "١٢٣[email protected]" kept a right-to-left page's direction
and lost the start of its Latin name, the bug this branch fixes for
Latin addresses. Those digits (bidi class AN) don't set direction.

The name part's first strong character (a letter, or right-to-left
punctuation or digits of bidi class R) now decides. A name part of
Arabic-Indic digits alone follows the domain's first strong character,
so one before an Arabic domain still keeps the page's direction. A table
test covers each case reviewers raised.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 ❌

…runcation

# Conflicts:
#	web/src/components/admin/access-groups/AccessGroupMembers.tsx
#	web/src/lib/direction.ts
@Quick104
Quick104 merged commit b300880 into main Nov 21, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/admin-email-rtl-truncation branch November 21, 2026 05:00
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/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant