fix(web): preserve RTL reading order in thread search results #48223
main fromrefs/pull/48223/head·opened View on GitHubSummary#
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 result | Before | After |
|---|---|---|
| Sidebar title and message excerpt | ![]() | ![]() |
| Command palette message excerpt | ![]() | ![]() |
| Command palette project match hint | ![]() | ![]() |
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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
862512eMacroscope'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).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.tsxA 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 to86251-
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:
4-
Check name Status Explanation Title check 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, an… Description check 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 … 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 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
#27019and 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-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: c89933c
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
48582f27-c79a-4aaf-9205-9d1db8a9dc2d
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.tsxapps/web/src/components/ThreadSearchMatch.tsxapps/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.






macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes