t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Pull request search drops matches for partial words once the GitHub host search answers

Open AustinKostreba opened this issue 1 month ago • 3 comments

What happened

The pull request search bar drops matching PRs while I type. A PR titled "…for Chronic Absence" shows up when I type c and ch. At chr and chro the list empties and says "Nothing matches "chr". The hosts were searched for it." The PR shows up briefly between keystrokes, then disappears.

Diagnosis

The local filter and the host search disagree on what matches, and the host's answer wins once the debounce settles.

  • While a query is debouncing, pullRequestGroups (apps/web/src/components/pullRequest/pullRequestListGroups.logic.ts) filters loaded rows with matchesPullRequestQuery, a substring match. chr matches "Chronic".
  • After SEARCH_DEBOUNCE_MS (250 ms), sentQuery catches up and answeredLocally becomes true. For any host with searchesOnHost, the list then shows the host's rows as-is and skips local narrowing ((answeredLocally && searchingHosts.has(entry.host)) || matchesPullRequestQuery(...)).
  • The GitHub provider sends the text as a quoted phrase (searchPhrase in packages/source-control-github/src/server/GitHubPullRequestApi.ts), so the search is is:pr is:open "chr" ... repo:.... GitHub search matches whole tokens, not prefixes, so a partial word returns 0 results.
  • Search with a query also skips the fallback to the repository listing (hasQuery in listPullRequests), so nothing fills the gap.

Possible fix: when the host answers, also keep loaded rows that match the text locally, so the host search can add matches but cannot remove rows the local filter already accepted.

Steps to reproduce

  1. Open Pull Requests for a workspace with a GitHub repository that has an open PR whose title contains a word like "Chronic".
  2. Type c, then ch into the search bar. The list narrows locally and still shows that PR.
  3. Keep typing: chr, chro. About 250 ms after each keystroke the list empties.

Expected: the PR stays listed while the typed text is a prefix of a word in its title.

Version

0.1.5-nightly.20261029.3877 (desktop). Same code on main at 9e09926d97.

Environment

macOS 26, desktop app, GitHub.com repositories.

Evidence

# GitHub GraphQL search, same private repository, q = "is:pr is:open <text> sort:updated-desc repo:<owner>/<repo>"
"chr"              -> 0 results
"chro"             -> 0 results
"chronic"          -> 1 result (the expected PR)
"chronic absence"  -> 1 result

A screen recording of the PR appearing for c/ch and then "Nothing matches" for chr/chro is available on request.

Related issues

None found. Closest is #13390 (# PR suggestions only search the project's repo), which is a different problem.

Fix applied or workaround

Nothing changed on the machine. Workaround: type complete words.

Filed by

Claude Code (claude-opus-5-5), investigated against the T3 Code source at 9e09926d97.

AustinKostreba avatar Oct 29 '26 12:10 AustinKostreba

I filed this from the CLI, so the template labels didn't apply. Could a maintainer add via-triage (an agent did the investigation) or bug/needs-triage? Thanks.

AustinKostreba avatar Oct 29 '26 12:10 AustinKostreba

Closing to refile through the triage issue form so the template labels apply. The new issue will be linked here.

AustinKostreba avatar Oct 29 '26 12:10 AustinKostreba

Refiled as #26950.

AustinKostreba avatar Oct 29 '26 12:10 AustinKostreba