Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): preserve RTL reading order in thread search results #48223

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

Summary

Searching for a message in Hebrew that begins with an English word can show the end of the sentence first. In the narrow sidebar, that can hide the beginning and even the matched word. A thread title or a project match hint has the same direction problem.

Give sidebar search titles, message excerpts, and match hints their own text direction using the existing detector. Excerpts and hints keep their labels outside the text that can be clipped, and matches stay highlighted. This extracts the search results changes from #27019.

Evidence

I ran the development app in Chromium with a demo project and a Replay thread, sent the same mixed Hebrew and English message through the composer, and searched for בבקשה. I also searched for לתכנון to surface the project match hint in the command palette.

Search resultBeforeAfter
Sidebar title and message excerptSidebar clips the start of the RTL text and the match highlightSidebar shows the start of the title and message including the highlighted match
Command palette message excerptMessage punctuation appears on the rightThe message reads right to left with the label on the left
Command palette project match hintProject hint reads left to rightProject hint reads right to left with the label kept in place

The three Chromium regressions failed on the base and passed with this change. The sidebar search and command palette suites passed all 12 tests. The scoped check also passed formatting, lint, Knip, typechecking, and React Compiler checks.

Merge risk

Revertible rendering change limited to thread search results.

Built with GPT-6.2 Sol through Codex in T3 Code.

    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Approved at 862512e

      Macroscope's review found this PR approvable — This change preserves RTL reading order in search-result titles, hints, and excerpts while keeping labels separate. Its effects are limited to presentation, with no changes to search behavior or stored data.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Search result excerpts, hints, and sidebar titles now apply text direction based on their content. Browser tests check clipping and punctuation placement for Hebrew text.

      Changes: Search result text direction

      Layer / File(s)Summary
      Render and verify bidirectional search text
      apps/web/src/components/ThreadSearchMatch.tsx, apps/web/src/components/sidebar/SidebarThreadRow.tsx, apps/web/src/components/Sidebar.search.browser.test.tsx
      A shared line component renders labeled, highlighted text in a direction derived from its content and uses start-aligned truncation. Search-result titles also use content-derived direction. Browser tests check clipping and punctuation placement.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: chenxin-yan, voltcrash

      Merge Risk: Minimal · up to 86251

      This change adjusts how thread search results are displayed for right-to-left text. It is limited to rendering and is easy to revert. No merge-blocking risk was identified.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the main change: preserving RTL reading order in thread search results. It uses the conventional commit format and matches the summarized changes to sidebar search titles, excerpts, an…
      Description checkPassedThe description follows the template. It states the problem (mixed Hebrew/English search results show the wrong end first and clip in the narrow sidebar) and the change (per-item text direction using …
      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 names the main change: preserving RTL reading order in thread search results. It uses the conventional commit format and matches the summarized changes to sidebar search titles, excerpts, and match hints.

      Full details: Description check

      Explanation

      The description follows the template. It states the problem (mixed Hebrew/English search results show the wrong end first and clip in the narrow sidebar) and the change (per-item text direction using the existing detector, labels kept outside clippable text). It links the source PR #27019 and gives Verification evidence with before/after screenshots, named Chromium regression results, and suite pass counts. The Scope section does not link an issue or explain why no issue is needed, which is a gap. The template asks for a linked bug issue or a reason for none. The agent-model line is present. The Problem section does not give explicit reproduction steps beyond the search example, but the Evidence section covers that.

      Resolution

      Add the issue link that shows the bug, or explain why a small obvious fix needs no issue. Consider stating the reproduction steps in the Problem section.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between c89933c0f53a5867369b77491889a166ba659ada and 862512eb6eabaa374aac7341410500e94797959e.

      Files selected for processing: 3

      • apps/web/src/components/Sidebar.search.browser.test.tsx
      • apps/web/src/components/ThreadSearchMatch.tsx
      • apps/web/src/components/sidebar/SidebarThreadRow.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Sign in to join this conversation.