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
Open
fix(session-ui): escape direction:rtl bidi issue in message-part-directory via LRE/PDF wraps#36488windlandneko wants to merge 1 commit into
windlandneko wants to merge 1 commit into
Conversation
…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.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Contributor
There was a problem hiding this comment.
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-directorytext 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #36489
Type of change
What does this PR do?
PR #9591 fixed a text rendering bug where
direction: rtl+text-overflow: ellipsison 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) insession-review.tsxandsession-turn.tsx.This PR applies the same fix to the 3
message-part-directorysites inmessage-part.tsxthat were missed in that change:How did you verify your code works?
Verified by inspecting the rendered DOM in the opencode UI with
.config/opencode/paths.Screenshots / recordings
Checklist