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): long Issues and Pull Requests searches no longer end in a broken character - #42228
The Issues and Pull requests pages both cut the search (q) to 200 UTF-16 units when they read it from the URL. When an emoji sits on the cut, only its first half is kept, so the search box ends in � and the address is rewritten to end in %EF%BF%BD. To reproduce: open /issues?q= or /pull-requests?q= with 199 letters followed by an emoji and more text.
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 #41838 does for the empty-list text. The 200-unit limit is unchanged. On Issues the cut lives in the bounded helper, which that page's other text filters also go through, so they get the same cut.
Scope
A small fix for an obvious bug, so no issue. It is the same fix as the merged #41838, applied where the two pages read the search from the URL.
Verification
New case in apps/web/src/components/issue/issuesSearch.logic.test.ts. Before the fix it failed (issuesSearchFromUrl returned the 199 a plus half of the emoji); with the fix vp test run apps/web/src/components/issue/issuesSearch.logic.test.ts passes, 4 of 4. The Pull requests route has no test file, so its cut is covered by the scenario.
New web scenario scripts/scenarios/long-search-keeps-whole-characters.e2e.ts. In a local project with no remote it opens /issues?q= and /pull-requests?q= with 199 a followed by 😀 and more text, and checks that each search box holds exactly the 199 a. The search is wider than its box, so the scenario scrolls the box to its end before each capture.
One paired run, vp run scenarios:prove scripts/scenarios/long-search-keeps-whole-characters.e2e.ts --base upstream/main, exited 0. Base 0e34fe98f2 fails on the Issues box: expect.toHaveValue, observed the 199 a followed by �. Head 6908ce5509 passes both boxes.
The base run stops at its first failure, so it never reaches the Pull requests box. To see that half fail by itself, I ran the scenario once with only the Issues fix applied: the Issues check passed and the Pull requests box failed with the same observed value. That run's capture is the Pull requests "before" below.
vp run check:changed upstream/main: format, lint, knip, typecheck (2 packages), the test file and the React Compiler check pass.
Base 0e34fe98f2
Head 6908ce5509
Result
❌ failed: expect.toHaveValue on the Search issues box, observed 199 a then �
✅ passed
Issues
Pull requests
From the run with only the Issues fix; the route file is the same as on base.
The scenario ran locally on macOS Chromium. Not checked in the app: a search typed into the box rather than opened by link, and the other Issues filters that go through bounded. 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 half of a surrogate pair.
Reviewing files that changed from the base of the PR and between 6908ce5 and 2f6f95b.
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
Issue and pull-request search inputs now truncate long queries without splitting a surrogate pair at the 200-character limit. Unit and end-to-end tests cover queries with an emoji at that boundary.
Issue and pull-request search inputs use a 199-character limit when the 200-character boundary splits a surrogate pair. Unit and end-to-end tests check that the query ends before the emoji.
Long searches loaded from the URL on Issues and Pull Requests no longer end with a replacement character when an emoji falls at the 200-unit limit. The change is small and reversible, and I found no merge-blocking risk.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the fix and the affected pages: long Issues and Pull Requests searches no longer end in a broken character. The changeset truncates the q search string at 200 UTF-16 units without spli…
Description check
The description follows the template. It states the problem with reproduction steps, explains the change and its shared helper, gives a scope rationale (small obvious bug, same fix as merged #41838, n…
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 fix and the affected pages: long Issues and Pull Requests searches no longer end in a broken character. The changeset truncates the q search string at 200 UTF-16 units without splitting a surrogate pair, so the title matches the main change. It uses a conventional commit prefix and is one sentence, though at 84 characters it is slightly long.
Full details: Description check
Explanation
The description follows the template. It states the problem with reproduction steps, explains the change and its shared helper, gives a scope rationale (small obvious bug, same fix as merged #41838, no issue needed), and provides detailed verification with test results, a paired base/head scenario run, before/after screenshots, and the environment. It also notes what was not checked. Minor gaps: the template asks for the model and harness at the end, and the author gives 'Claude Fable 5.2 via T3 Code', which satisfies that line. The Scope section gives no linked issue, but the author justifies why none is needed.
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; 9 remain after this review.
Load /issues and /pull-requests with q containing 199 a characters followed by 😀 rest; wait for loading to settle and scroll the search box to its end. Chromium, 1280×800, light theme, fresh synthetic state on each commit. Base shows � and retains it in the rewritten URL; head keeps exactly 199 letters in both places. scenarios:prove exited 0.
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:M30-99 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
The Issues and Pull requests pages both cut the search (
q) to 200 UTF-16 units when they read it from the URL. When an emoji sits on the cut, only its first half is kept, so the search box ends in�and the address is rewritten to end in%EF%BF%BD. To reproduce: open/issues?q=or/pull-requests?q=with 199 letters followed by an emoji and more text.Change
When the cut would split a surrogate pair, it steps back one unit, using the shared
splitsSurrogatePairfrom@t3tools/shared/assistantCitations, as the merged #41838 does for the empty-list text. The 200-unit limit is unchanged. On Issues the cut lives in theboundedhelper, which that page's other text filters also go through, so they get the same cut.Scope
A small fix for an obvious bug, so no issue. It is the same fix as the merged #41838, applied where the two pages read the search from the URL.
Verification
apps/web/src/components/issue/issuesSearch.logic.test.ts. Before the fix it failed (issuesSearchFromUrlreturned the 199aplus half of the emoji); with the fixvp test run apps/web/src/components/issue/issuesSearch.logic.test.tspasses, 4 of 4. The Pull requests route has no test file, so its cut is covered by the scenario.scripts/scenarios/long-search-keeps-whole-characters.e2e.ts. In a local project with no remote it opens/issues?q=and/pull-requests?q=with 199afollowed by 😀 and more text, and checks that each search box holds exactly the 199a. The search is wider than its box, so the scenario scrolls the box to its end before each capture.vp run scenarios:prove scripts/scenarios/long-search-keeps-whole-characters.e2e.ts --base upstream/main, exited 0. Base0e34fe98f2fails on the Issues box:expect.toHaveValue, observed the 199afollowed by�. Head6908ce5509passes both boxes.vp run check:changed upstream/main: format, lint, knip, typecheck (2 packages), the test file and the React Compiler check pass.0e34fe98f26908ce5509expect.toHaveValueon theSearch issuesbox, observed 199athen�From the run with only the Issues fix; the route file is the same as on base.
The scenario ran locally on macOS Chromium. Not checked in the app: a search typed into the box rather than opened by link, and the other Issues filters that go through
bounded. 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 half of a surrogate pair.Claude Fable 5.2 via T3 Code