Skip to content

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

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

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

Conversation

@windlandneko

@windlandneko windlandneko commented Jul 12, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #36489

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

PR #9591 fixed a text rendering bug where direction: rtl + text-overflow: ellipsis on paths starting with a leading dot (e.g. .config/opencode/) causes the dot to be misplaced by the Unicode bidirectional algorithm. The fix wrapped directory text in LRE (\u202A) / PDF (\u202C) in session-review.tsx and session-turn.tsx.

This PR applies the same fix to the 3 message-part-directory sites in message-part.tsx that were missed in that change:

  • edit-trigger (line 2162)
  • write-trigger (line 2229)
  • patch tool (line 2411)

How did you verify your code works?

Verified by inspecting the rendered DOM in the opencode UI with .config/opencode/ paths.

Screenshots / recordings

Before Fixed
config/opencode./ .config/opencode/

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…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.
@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.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@windlandneko windlandneko marked this pull request as ready for review July 12, 2026 04:00
Copilot AI review requested due to automatic review settings July 12, 2026 04:00

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 bug in session-ui where directory paths with a leading dot (e.g. .config/opencode/) can be visually reordered under direction: rtl + text-overflow: ellipsis, causing the dot to appear at the end of the path segment. It applies the same LRE/PDF wrapping strategy already used elsewhere in the codebase to the remaining message-part-directory render sites.

Changes:

  • Wraps message-part-directory text with Unicode LRE (\u202A) and PDF (\u202C) to prevent bidi reordering.
  • Applies the fix to the edit-trigger, write-trigger, and patch-tool path directory displays in message-part.tsx.

💡 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

direction:rtl reorders leading dot in directory paths (.config → config.)

2 participants