fix(web): follow prose direction in pull request editors #48233
main fromrefs/pull/48233/head·opened View on GitHubSummary#
Pull request Markdown editors lay out Hebrew and Arabic prose left to right. In a draft that starts with an English word, the opening word and ending punctuation can land on the wrong sides.
Apply the existing Markdown prose direction detector in the shared pull request textarea. Comments, review summaries, inline conversations, and descriptions now follow the prose as it changes. Code and URLs do not count toward the direction, and the draft text is preserved. This extracts the Markdown editor direction fix from #27019.
Evidence#
In the running T3 Code development app in Chromium, I typed mixed Hebrew and English drafts and a mixed Arabic and English review. The screenshots show the same unsent drafts before and after.
| Editor | Before | After |
|---|---|---|
| Comment | ![]() | ![]() |
| Review summary | ![]() | ![]() |
| Inline reply | ![]() | ![]() |
| Description | ![]() | ![]() |
The draft-direction regression failed on the base and passed with the fix. It checks that the editor changes direction as the prose changes and switches back to LTR when Hebrew appears only in inline code. All 37 focused browser tests passed, along with the scoped format, lint, typecheck, Knip, and React Compiler checks.
Merge risk#
Revertible change to presentation in one shared textarea.
Built with GPT-6.2 Sol through Codex in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Walkthrough
-
The Markdown textarea now derives its direction from the prose in its value. A browser test checks left-to-right direction for English, right-to-left direction for Hebrew prose, and left-to-right direction when Hebrew appears only inside inline code.
Changes: Markdown textarea direction
Layer / File(s) Summary Derive and test textarea direction
apps/web/src/components/pullRequest/PullRequestMarkdownTextarea.tsx,apps/web/src/components/pullRequest/PullRequestMarkdownEditor.browser.test.tsxThe textarea sets its direction with markdownProseDirection(value). The browser test checks direction changes for English, Hebrew prose, and Hebrew text inside inline code.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
saphid
Merge Risk:
Minimal · up toa8464-
The pull request editor textarea now follows the direction of the prose being typed, ignoring code and URLs. This is a small presentation change with no data or behavior risk identified, so it is ready to merge.
Pre-merge checks:
4-
Check name Status Explanation Title check The title follows the conventional commit format and names the main change: the pull request editors now follow prose direction. It matches the changeset, which applies the existing Markdown prose dir… Description check The description covers the problem (Hebrew and Arabic prose laid out left to right in mixed drafts starting with English), the change (applying the existing prose direction detector to the shared pull… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Title check
-
Explanation
The title follows the conventional commit format and names the main change: the pull request editors now follow prose direction. It matches the changeset, which applies the existing Markdown prose direction detector to the shared pull request textarea so the textarea dir follows the prose. The title is specific and does not rely on vague terms.
Full details: Description check
-
Explanation
The description covers the problem (Hebrew and Arabic prose laid out left to right in mixed drafts starting with English), the change (applying the existing prose direction detector to the shared pull request textarea, excluding code and URLs), and the scope (it extracts the Markdown editor direction fix from
#27019). It includes verification details: a regression test that failed on base and passed with the fix, 37 focused browser tests, and before/after screenshots in a table. Gaps against the template: the Scope section does not link a specific bug issue or explain why no issue is needed, so the reviewer cannot confirm it is a bug fix rather than a feature. The Verification section also does not clearly state anything that could not be checked. The description is mostly complete, so the check passes, but the missing issue link should be added.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Additional comments: 1-
apps/web/src/components/pullRequest/PullRequestMarkdownEditor.browser.test.tsx-115-116: 1
-
115-116: Trivial · Maintainability & Code Quality · Quick win **Unverified finding** Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Wait for the browser assertions.
Wrap the DOM assertions in
vi.waitForso they follow the browser-test waiting pattern. As per coding guidelines and path instructions, browser tests must assert throughexpect.elementorvi.waitFor.Also applies to: 120-121
Sources: Coding guidelines, Path instructions
-
Review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 9a08ffb
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
276f245e-46c1-4e03-986a-fedc5f7efe5b
Commits-
Reviewing files that changed from the base of the PR and between 9a08ffb84084c441dcf4a2f595682a44632ecc89 and a8464e6206cd8b9da9e221402c543306ac2e15b4.
Files selected for processing: 2-
apps/web/src/components/pullRequest/PullRequestMarkdownEditor.browser.test.tsxapps/web/src/components/pullRequest/PullRequestMarkdownTextarea.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
-
Sign in to join this conversation.








Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — Pull request editors now automatically derive text direction from Markdown prose. Human review is required to confirm this change to the editor’s default presentation.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).