Skip to content

feat(app): support bidirectional chat text - #38079

Closed
miladjs wants to merge 1 commit into
anomalyco:devfrom
miladjs:feat/bidirectional-chat-text
Closed

feat(app): support bidirectional chat text#38079
miladjs wants to merge 1 commit into
anomalyco:devfrom
miladjs:feat/bidirectional-chat-text

Conversation

@miladjs

Copy link
Copy Markdown

Issue for this PR

Closes#32726

Related: #35319 and #37249

Type of change

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

What does this PR do?

Adds dir="auto" to user-message text and both the legacy and v2 prompt editors.

The browser determines direction from the first strong character, so Persian, Arabic, and Hebrew text renders RTL while English remains LTR. Mixed RTL/LTR text continues to use the browser's Unicode bidirectional handling.

This complements #37249, which handles rendered Markdown and tables but was opened before the current v2 prompt input was added.

How did you verify your code works?

  • Ran the session-ui test suite: 75 tests passed.
  • Ran type checking for packages/session-ui and packages/app.
  • Ran the full pre-push type check across 30 packages.
  • Verified Persian and English text use the expected direction in user messages and the prompt editor.

Screenshots / recordings

Before/after examples of the RTL rendering issue are available in #35319.

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

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

The PR #37249 appears in the results, which is already mentioned in the current PR's description as a related PR. Since PR #38079 is the current PR and #37249 is explicitly noted as related (handling rendered Markdown and tables while this PR handles the prompt editor), these are complementary changes rather than duplicates.

No duplicate PRs found

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hebrew/Arabic (RTL) text renders left-to-right in messages and the composer

1 participant

@miladjs