Skip to content

fix: correct dot prefix display in directory names for RTL text rendering issue #9579 - #9591

Merged
adamdotdevin merged 1 commit into
anomalyco:devfrom
yxshee:dev
Jan 21, 2026
Merged

adamdotdevin merged 1 commit into
anomalyco:devfrom
yxshee:dev

Conversation

@yxshee

@yxshee yxshee commented Jan 20, 2026

Copy link
Copy Markdown

Fixes file path display bug where dot prefixes from directory names (e.g., .opencode/) were incorrectly appearing on filenames in the Session changes panel.

Problem:

  • Expected: .opencode/commands/README.md
  • Actual: opencode/commands/.README.md (dot moved from directory to filename)

Root Cause:
CSS direction: rtl (used for left-truncation of long paths) triggers Unicode Bidirectional Algorithm, which treats dots as neutral characters and reorders them visually.

Solution:
Wrapped directory paths with Unicode Left-to-Right Embedding (\u202A) and Pop Directional Formatting (\u202C) to isolate the directory text and prevent character reordering while preserving left-truncation behavior.

Files Changed:

  • packages/ui/src/components/session-review.tsx - Session Review panel
  • packages/ui/src/components/session-turn.tsx - Session Turn display

Closes #9579

Copilot AI review requested due to automatic review settings January 20, 2026 10:09
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #9586: "fix: correct dot prefix display in file paths for directories starting with dots"
#9586

Why it's related: This PR addresses the exact same issue - dot prefixes in directory names being incorrectly displayed in file paths. Both PRs appear to be fixing the same bug in the Session Review/changes panel where dots from directory names (like .opencode/) are being misplaced. You should verify if #9586 is still open and whether it covers the same fix or if there are differences in the implementation approach.

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 text rendering bug where dot prefixes from directory names were incorrectly appearing on filenames in the Session changes panel due to the Unicode Bidirectional Algorithm being triggered by CSS direction: rtl. The fix wraps directory paths with Unicode Left-to-Right Embedding (\u202A) and Pop Directional Formatting (\u202C) characters to prevent character reordering while maintaining the left-truncation behavior.

Changes:

  • Replaced ‎ (Left-to-Right Mark) with Unicode LRE/PDF wrapping in directory path display
  • Applied fix to Session Review and Session Turn components

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/ui/src/components/session-turn.tsx Wrapped directory path with Unicode LRE/PDF to fix dot reordering in session turn display
packages/ui/src/components/session-review.tsx Wrapped directory path with Unicode LRE/PDF to fix dot reordering in session review display

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

<div data-slot="session-review-file-name-container">
<Show when={diff.file.includes("/")}>
<span data-slot="session-review-directory">{getDirectory(diff.file)}&lrm;</span>
<span data-slot="session-review-directory">{`\u202A${getDirectory(diff.file)}\u202C`}</span>

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

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

The same RTL text rendering issue exists in message-part.tsx at lines 990 and 1039, where getDirectory is used with the same CSS direction: rtl styling. These locations also display directory paths with dots that could be reordered by the Unicode Bidirectional Algorithm. Consider applying the same Unicode Left-to-Right Embedding fix to these locations for consistency.

Copilot uses AI. Check for mistakes.
@yxshee
yxshee requested a review from adamdotdevin as a code owner January 20, 2026 10:31
@adamdotdevin
adamdotdevin merged commit 3723e1b into anomalyco:dev Jan 21, 2026
8 of 9 checks passed
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
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.

[Desktop] File path display incorrectly shows dot prefix on file names instead of directory names

3 participants