Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): follow prose direction in pull request editors #48233

OpenDananz(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48233/headopened View on GitHub

Summary

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.

EditorBeforeAfter
CommentMixed Hebrew comment starts on the leftMixed Hebrew comment reads from the right
Review summaryMixed Arabic review starts on the leftMixed Arabic review reads from the right
Inline replyMixed Hebrew reply starts on the leftMixed Hebrew reply reads from the right
DescriptionMixed Hebrew description starts on the leftMixed Hebrew description reads from the right

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

    2. 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).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →
      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.tsx
      The 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 to a8464

      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: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe 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 checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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
    4. 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.waitFor so they follow the browser-test waiting pattern. As per coding guidelines and path instructions, browser tests must assert through expect.element or vi.waitFor.

      Also applies to: 120-121

      Sources: Coding guidelines, Path instructions

      Review info

      Run configuration

      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.tsx
      • apps/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.