Skip to content

fix(session-ui): escape direction:rtl bidi issue in message-part-directory via LRE/PDF wraps#36487

Closed
windlandneko wants to merge 1 commit into
anomalyco:devfrom
windlandneko:fix-rtl-dot-path
Closed

fix(session-ui): escape direction:rtl bidi issue in message-part-directory via LRE/PDF wraps#36487
windlandneko wants to merge 1 commit into
anomalyco:devfrom
windlandneko:fix-rtl-dot-path

Conversation

@windlandneko

Copy link
Copy Markdown

Problem

When direction: rtl + text-overflow: ellipsis is applied to a path starting with a leading dot (e.g. .config/opencode/), the Unicode bidirectional algorithm misplaces the dot, rendering it as /config/opencode./ in some browsers. This is a known issue with the direction: rtl trick for showing the end of a truncated path.

Fix

Wrap the directory text in LRE (\u202A) / PDF (\u202C) Unicode control characters, exactly as already done for apply-patch-directory in the same file (lines 1458, 2338) and for session-review-directory in session-review.tsx.

This forces LTR embedding inside the RTL context, preventing the bidi algorithm from misplacing leading dot characters.

Changes

  • packages/session-ui/src/components/message-part.tsx: Wrap getDirectory() output in LRE/PDF at all 3 message-part-directory usage sites (edit-trigger, write-trigger, and patch tool).

…ctory via LRE/PDF wraps

When direction: rtl is applied to a path starting with a leading dot
(e.g. .config/opencode/), the Unicode bidirectional algorithm misplaces
the dot, rendering it as /config/opencode./ in some browsers. This is a
known issue with the direction: rtl + text-overflow: ellipsis trick for
showing the end of a truncated path.

The same approach used in apply-patch-directory (wrapping text in LRE
\u202A / PDF \u202C Unicode control characters) is applied to
message-part-directory to force LTR embedding inside the RTL context.
Copilot AI review requested due to automatic review settings July 12, 2026 03:23
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a UI rendering issue where RTL direction + ellipsis truncation can cause leading-dot directories (e.g. .config/...) to be reordered incorrectly by the Unicode bidi algorithm. It does so by forcing an LTR embedding for the directory segment inside the RTL container, matching an existing pattern already used elsewhere in the same component.

Changes:

  • Wrap message-part-directory directory text with Unicode LRE (\u202A) / PDF (\u202C) control characters at all three usage sites.
  • Align behavior with existing apply-patch-directory handling in the same file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours. needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants