Skip to content

fix(web): long Pull Requests author and label filters no longer end in a broken character - #42563

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-list-filter-surrogate-slice
Nov 25, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-list-filter-surrogate-slice

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

The Pull Requests page caps URL search values at 200 UTF-16 units. #42228 updated the search query (q) to stop before an emoji that the limit would split, but author and each entry in labels still truncate with a plain slice(0, 200).

When an author or label has 199 characters followed by an emoji (for example in a long shared or saved link), the 200-unit cut leaves half of a surrogate pair at the end: the Filters menu's Author and Labels items show a trailing broken character (�), and the router rewrites author in the address bar to end in %EF%BF%BD.

Change

Added a sliceSearchText helper in apps/web/src/routes/_chat.pull-requests.tsx that reuses splitsSurrogatePair and cuts at 199 units when unit 200 would split a surrogate pair. q, author, and each label in labels now go through this helper.

Technical caps (selectedUrl, repository, host, selectedHost) are unchanged. The filter menus' host search (PullRequestListFilters.tsx, 100-unit cut of the typed query) is also unchanged because it only bounds the query sent to the host and is never displayed.

Desktop renders the same web route; mobile has its own Pull Requests filters and does not read these URL values.

Scope

Small fix of an obvious bug — the same surrogate-pair split that #42228 fixed for q, left behind on author and labels — so no separate issue is needed.

Verification

Checked in Web on Linux (headless Chromium at 2560x1600), dev build with fresh isolated data and no projects. Opened /pull-requests?author=<199 a>😀&labels=<199 b>🐛, then opened Filters → Author and Filters → Labels. To make the end of each value visible in the screenshots, the capture turns off the menu item's ellipsis truncation.

On b6869fad67e (main), the router rewrote author in the URL to end in %EF%BF%BD (length 200) and both the Author and Labels menu items showed a trailing �. On 00aebc84 (this PR), both stop at 199 whole characters before the emoji.

b6869fad67e (main) 00aebc84 (this PR)
Before: the selected author ends in a broken character (�) where the emoji was cut
Before: the selected author ends in a broken character (�) where the emoji was cut
After: the selected author ends on whole characters, before the emoji
After: the selected author ends on whole characters, before the emoji
Before: the selected label ends in a broken character (�)
Before: the selected label ends in a broken character (�)
After: the selected label ends on whole characters
After: the selected label ends on whole characters

Tests:

  • pullRequestsRouteSearch.test.ts adds a case for a 199-character author + 😀 and a 199-character label + 🐛: it fails on b6869fad67e (main) with both values ending in a lone surrogate, and passes 3 of 3 runs on 00aebc84 (4/4 tests passing).
  • vp run check:changed passes.

An AI agent ran each check.

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 00aebc8 and 4cab2f8.

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

Pull request search parsing now uses a shared helper to limit text to 200 UTF-16 code units without splitting surrogate pairs. A test covers long author and label values followed by an emoji.

Changes: Pull request search text

Layer / File(s) Summary
Truncate search values
apps/web/src/routes/_chat.pull-requests.tsx, apps/web/src/components/pullRequest/pullRequestsRouteSearch.test.ts
A shared helper applies the 200-code-unit limit without splitting surrogate pairs. Label, query, and author parsing use the helper. The test checks long author and label values followed by an emoji.

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

Change: Bug fix

Suggested reviewers: tiliakoos

Merge Risk: Minimal · previous review 00aeb

Long author and label filters in the Pull Requests view will no longer end in a broken character. The change is small, covered by a regression test, and easy to revert, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a fix in the web Pull Requests author and label filters so long values no longer end in a broken surrogate-pair character. It matches the changeset, which adds sliceSe…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem and Change sections explain the surrogate-pair split and the helper. Scope explains why no i…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a fix in the web Pull Requests author and label filters so long values no longer end in a broken surrogate-pair character. It matches the changeset, which adds sliceSearchText and applies it to author and labels.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem and Change sections explain the surrogate-pair split and the helper. Scope explains why no issue is linked and why this is a small bug fix. Verification gives before and after results, test results, and the agent note. The template's Scope asks for a linked issue. The author gives a reason instead, which the template allows for small obvious fixes. The template's embedded comment asks for screenshots in Verification, and the description includes before and after images.

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 7e0d1cb and 00aebc8.

Files selected for processing: 2

  • apps/web/src/components/pullRequest/pullRequestsRouteSearch.test.ts
  • apps/web/src/routes/_chat.pull-requests.tsx

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 25, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Real web app, light theme, 1920×900, fresh synthetic state on each commit. Open the Pull Requests route with author = 199 a characters + 😀 and labels = 199 b characters + 🐛, then inspect Filters → Author and Filters → Labels.

Proven: the scenario fails on base and passes on head. Base renders broken trailing characters and persists U+FFFD for author and a lone U+D83D for the label. Head renders and persists exactly 199 ASCII characters for each filter.

Before f46f17e46f After 4cab2f889f
Author Before: broken author ending After: clean author ending
Labels Before: broken label ending After: clean label ending
Recording Before After

Scenario source

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 25, 2026
@juliusmarminge
juliusmarminge merged commit 3d4fd83 into pingdotgg:main Nov 25, 2026
57 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants