You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): a long pull request search no longer ends in a broken character - #41838
When a pull request search matches nothing, the empty list repeats the search as Nothing matches “…” (and as Searching every host for “…” while it runs), cut at 48 UTF-16 units with query.slice(0, 48). When an emoji sits on the cut, half of it stays behind and the text ends in �…. To reproduce: open Pull requests and search for 47 letters followed by an emoji and more text, or open /pull-requests?q= with such a search.
Change
When the cut would split a surrogate pair, it steps back one unit, using the shared splitsSurrogatePair from @t3tools/shared/assistantCitations, as the merged #41787 does for mobile draft titles. The 48-unit limit and the … suffix are unchanged.
Scope
A small fix for an obvious bug, so no issue.
Verification
New web scenario scripts/scenarios/pull-request-search-keeps-whole-characters.e2e.ts. It opens /pull-requests?q= with 47 a followed by 😀 and more text in a local project with no remote, waits for the Nothing matches title, and checks its text.
One paired run, vp run scenarios:prove scripts/scenarios/pull-request-search-keeps-whole-characters.e2e.ts --base upstream/main, exited 0. Base 700a4644a4 fails on the assertion: observed: text "Nothing matches “aaa…a\ud83d…”". Head 14b20c1830 passes. Both captures are from that run.
vp run check:changed upstream/main: format, lint, knip, typecheck (2 packages) and the React Compiler check pass.
Base 700a4644a4
Head 14b20c1830
Result
❌ failed: expect.toHaveText, observed text Nothing matches “aaa…a\ud83d…”
✅ passed
No matches
The scenario ran locally on macOS Chromium. Not checked: the Searching every host for “…” caption, which shows only while a search is in flight and uses the same cut value. The cut works per code point, so it can still split a grapheme cluster such as a flag or a ZWJ sequence, but it never leaves a lone surrogate.
Reviewing files that changed from the base of the PR and between 14b20c1 and b5f6d46.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Long pull-request search queries now avoid truncating between the two UTF-16 units of a surrogate pair. An end-to-end test checks the displayed title for a query with an emoji at the truncation boundary.
Changes: Pull-request search query truncation
Layer / File(s)
Summary
Safe truncation and end-to-end validation apps/web/src/components/pullRequest/PullRequestListEmptyState.tsx, scripts/scenarios/pull-request-search-keeps-whole-characters.e2e.ts
For queries longer than 48 characters, truncation uses 47 characters if the 48-character boundary splits a surrogate pair. The test checks that the no-matches title displays the expected 47-character prefix and an ellipsis.
Long pull request search queries no longer end with a broken emoji character in the search captions. The change is small and covered by an end-to-end scenario, so merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title states the main change: a long pull request search no longer ends in a broken character. It matches the fix that stops the 48-unit truncation from splitting an emoji surrogate pair. It uses …
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, the reproduction steps, and the expected behavior. The Change section…
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 states the main change: a long pull request search no longer ends in a broken character. It matches the fix that stops the 48-unit truncation from splitting an emoji surrogate pair. It uses the conventional commit format with a web scope. The title is clear and specific, and it is 73 characters, which is slightly long but acceptable.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, the reproduction steps, and the expected behavior. The Change section explains the fix and cites the shared helper. The Scope section says the fix is small and needs no issue. The Verification section lists the scenario test, a paired before/after run, and the repo checks, and it states what was not checked. The UI before/after screenshots are included as links. The author also names the model used, as the template asks for agent work. The description is mostly complete.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Real web app, Chromium, 1280×800, light theme, fresh database and one synthetic project on each commit. Open Pull requests, enter 47 lowercase a characters followed by 😀 and the rest of the search, and wait for the empty state.
Proven: the base retains a lone U+D83D, visibly rendering a broken character before the ellipsis. The head displays exactly 47 a characters followed directly by the ellipsis. scenarios:prove exited 0.
The transient “Searching every host” caption was not separately captured or verified.
Not shown:
The transient “Searching every host” caption after appending ' zzqx' was not separately exercised; this proof covers the settled “Nothing matches” preview.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a pull request search matches nothing, the empty list repeats the search as
Nothing matches “…”(and asSearching every host for “…”while it runs), cut at 48 UTF-16 units withquery.slice(0, 48). When an emoji sits on the cut, half of it stays behind and the text ends in�…. To reproduce: open Pull requests and search for 47 letters followed by an emoji and more text, or open/pull-requests?q=with such a search.Change
When the cut would split a surrogate pair, it steps back one unit, using the shared
splitsSurrogatePairfrom@t3tools/shared/assistantCitations, as the merged #41787 does for mobile draft titles. The 48-unit limit and the…suffix are unchanged.Scope
A small fix for an obvious bug, so no issue.
Verification
scripts/scenarios/pull-request-search-keeps-whole-characters.e2e.ts. It opens/pull-requests?q=with 47afollowed by 😀 and more text in a local project with no remote, waits for theNothing matchestitle, and checks its text.vp run scenarios:prove scripts/scenarios/pull-request-search-keeps-whole-characters.e2e.ts --base upstream/main, exited 0. Base700a4644a4fails on the assertion:observed: text "Nothing matches “aaa…a\ud83d…”". Head14b20c1830passes. Both captures are from that run.vp run check:changed upstream/main: format, lint, knip, typecheck (2 packages) and the React Compiler check pass.700a4644a414b20c1830expect.toHaveText, observed textNothing matches “aaa…a\ud83d…”The scenario ran locally on macOS Chromium. Not checked: the
Searching every host for “…”caption, which shows only while a search is in flight and uses the same cut value. The cut works per code point, so it can still split a grapheme cluster such as a flag or a ZWJ sequence, but it never leaves a lone surrogate.Claude Opus 5.5 via T3 Code