Skip to content

fix(web): a long pull request search no longer ends in a broken character - #41838

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/pr-search-broken-character
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/pr-search-broken-character

Conversation

@tiliakoos

Copy link
Copy Markdown
Contributor

Problem

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.

Claude Opus 5.5 via T3 Code

…cter

The search shown in the empty pull request list is cut at 48 units, which
could leave half of an emoji. The cut now stops one unit earlier then.
@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 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 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 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.

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

Change: Bug fix

Suggested reviewers: maria-rcks

Merge Risk: Minimal · previous review 14b20

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 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 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 364ca47 and 14b20c1.

Files selected for processing: 2

  • apps/web/src/components/pullRequest/PullRequestListEmptyState.tsx
  • scripts/scenarios/pull-request-search-keeps-whole-characters.e2e.ts

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

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

Copy link
Copy Markdown
Member

Evidence

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.

Before After
Before: search preview ends with a broken character After: search preview ends cleanly with the ellipsis
d572ce9afe b5f6d46fd9
Before recording After recording

Scenario source

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.

@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 24, 2026
@juliusmarminge
juliusmarminge merged commit 5bf6b12 into pingdotgg:main Nov 24, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
@tiliakoos
tiliakoos deleted the fix/pr-search-broken-character branch November 24, 2026 02:30
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