Skip to content

fix(web): long Issues and Pull Requests searches no longer end in a broken character - #42228

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/search-keeps-whole-characters
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
tiliakoos:fix/search-keeps-whole-characters

Conversation

@tiliakoos

Copy link
Copy Markdown
Contributor

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 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.

Claude Fable 5.2 via T3 Code

…roken character

Both pages cut the search to 200 units, which could keep 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:M 30-99 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 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.

Changes: Search truncation

Layer / File(s) Summary
Bound search inputs without splitting surrogate pairs
apps/web/src/components/issue/issuesSearch.logic.ts, apps/web/src/routes/_chat.pull-requests.tsx, apps/web/src/components/issue/issuesSearch.logic.test.ts, scripts/scenarios/long-search-keeps-whole-characters.e2e.ts
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.

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

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#41838: Also updates pull-request search truncation to avoid leaving a lone surrogate, using the shared splitsSurrogatePair helper.

Suggested labels: bugfix

Suggested reviewers: macroscopeapp, juliusmarminge, bil0000

Merge Risk: Minimal · previous review 6908c

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

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

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8b70e73 and 6908ce5.

Files selected for processing: 4

  • apps/web/src/components/issue/issuesSearch.logic.test.ts
  • apps/web/src/components/issue/issuesSearch.logic.ts
  • apps/web/src/routes/_chat.pull-requests.tsx
  • scripts/scenarios/long-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; 9 remain after this review.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the fix/search-keeps-whole-characters branch from 809c890 to 2f6f95b Compare November 24, 2026 15:37
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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.

Surface Before — fdce61c022 After — 2f6f95b490
Issues Before: broken search tail After: whole search tail
Pull Requests Before: broken search tail After: whole search tail
Recording Before recording After recording

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 24, 2026
@juliusmarminge
juliusmarminge merged commit cb207e9 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/search-keeps-whole-characters branch November 24, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 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