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): mention menu highlight moves to new results - #47210
When an @ file search resolves while the menu still shows the previous query's results, the old top row stays highlighted if it also appears in the new results, so Enter or Tab inserts that file instead of the new top match. Found while keyboard-testing @ file mentions in the web composer.
useProjectPathSearch keeps prior entries visible while a new search loads; during that window ChatComposer stamped the top-row fallback into highlight state under the new key, so resolveComposerMenuActiveItemId kept it active once fresh results arrived.
Change
ChatComposer.tsx: store highlight state only on arrow-key or hover picks (manual picks stay put while same-query results refine) and clear on close, query change or missing row instead of storing the fallback. Arrow keys step from activeComposerMenuItemId and save the search key.
ChatView.browser.test.tsx: regression test proving #45614's kept results stay visible while a longer query loads (alongside queries.pathSearch.browser.test.tsx) and highlight moves to the new top match.
Scope
Small bug fix; no issue needed. Web only (mobile's popover is touch-only).
Verification
Setup: Linux, isolated web dev build in the Browser panel, light theme, 1280x800, fresh isolated data on each commit, local repo with docs/my notes file.md, docs/café-résumé.txt, src/index.ts, lib/index.ts and alpha.txt.
Steps: type @notes → Enter → type @caf → wait for results → Enter.
When a composer @ file search resolves while the menu still shows the previous query's kept entries, ChatComposer had stamped the derived top-row fallback into highlight state under the new query's key during render, leaving the stale row selected if it still appeared lower in the fresh results.
Keep highlight state only for explicit user highlights from arrow keys or pointer hover, and let the derived active item fall back to the first match until the user moves it.
Macroscope's review found this PR approvable — Fixes mention-menu highlighting when updated search results arrive and keeps keyboard navigation aligned with the visible selection. The existing first-result fallback remains unchanged, with effects limited to transient composer UI state.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 95f041f and a19c685.
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
The composer now keeps mention highlighting aligned with the active item for the current search. A browser test covers selecting a result after a successive search response arrives.
Changes: Mention search highlighting
Layer / File(s)
Summary
Search-specific highlight state apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/components/ChatView.browser.test.tsx
The composer clears a stored highlight when it does not match the active item, and arrow-key navigation uses the active item ID. A browser test checks selection after a delayed successive search response.
This change keeps the @ file menu highlight in step with the current search results, so Enter or Tab no longer inserts a stale match. A regression test covers the scenario. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(web): mention menu highlight moves to new results" matches the main change. The ChatComposer change stops a stale top-row fallback from staying highlighted when new @ file search result…
Description check
The description follows the template well. It has Problem, Change, Scope, and Verification sections. The problem and root cause are explained clearly. The change lists the ChatComposer and regression …
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 "fix(web): mention menu highlight moves to new results" matches the main change. The ChatComposer change stops a stale top-row fallback from staying highlighted when new @ file search results arrive. The title is a conventional commit, short, and names the web mention menu and the highlight behavior.
Full details: Description check
Explanation
The description follows the template well. It has Problem, Change, Scope, and Verification sections. The problem and root cause are explained clearly. The change lists the ChatComposer and regression test updates. Scope explains why no issue is needed and that the fix is web-only. Verification gives concrete steps, before and after screenshots, automated check results, and items not checked (desktop and mobile). The template's closing line asks for the model and harness, and the description ends with 'Generated with Gemini 4 Neon in T3 Code Nightly', so that line is covered.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between ed4188e and 95f041f.
Files selected for processing: 2
apps/web/src/components/ChatView.browser.test.tsx
apps/web/src/components/chat/ChatComposer.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Web client, real local dev server and browser at 1280×800 in light theme, driven by scenarios:prove on fresh isolated databases for each commit. t3.project seeded synthetic docs/my notes file.md, docs/café-résumé.txt, alpha.txt, lib/index.ts and src/index.ts; opened the new draft. No provider turn was needed.
In a fresh project draft, type @notes, wait for results, press Enter; type @Caf, wait for café-résumé.txt to appear, capture the highlight, press Enter and capture the chips. Clear the composer, type @Caf and press Tab; type the uncached @note, wait until my notes file.md is the first result, capture the highlight, press Tab and capture the chips.
Scenario: Fresh mention results select the new top match for Enter and Tab
Preservation of an explicit user-selected row for the same query was not exercised; this proof covers the reported implicit-selection Enter and Tab paths.
…ingdotgg#45341
Ported prerequisite pingdotgg#45341 (open-popups) and 27 of 28 upstream commits
from b4b58d2..7538a0f, preserving all locked T4 customizations,
zero telemetry, and T4 branding:
- Bounded command projection reads (pingdotgg#47115)
- Move threads between projects & recover missing workspace folders (pingdotgg#47234)
- Mention menu highlight update (pingdotgg#47210, enabling files mention in test for T4 Lock pingdotgg#18)
- Mobile image-chip-without-text send (pingdotgg#47173)
- Antigravity Argon pricing (pingdotgg#47202), OpenCode 64-char MCP tool names (pingdotgg#43800)
- GitHub HTTPS->SSH clone fallback (pingdotgg#47239), open popup coordination (pingdotgg#47167)
- Plus 19 additional upstream fixes across server, web, mobile, and providers
- Auto-synced all 30 GT v12 i18n catalogs via sync:t4-i18n (0 untranslated)
- Deferred pingdotgg#47163 (depends on unported workflow-subjects) in .t4-upstream-sync.json
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:S10-29 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
When an
@file search resolves while the menu still shows the previous query's results, the old top row stays highlighted if it also appears in the new results, so Enter or Tab inserts that file instead of the new top match. Found while keyboard-testing@file mentions in the web composer.useProjectPathSearchkeeps prior entries visible while a new search loads; during that windowChatComposerstamped the top-row fallback into highlight state under the new key, soresolveComposerMenuActiveItemIdkept it active once fresh results arrived.Change
ChatComposer.tsx: store highlight state only on arrow-key or hover picks (manual picks stay put while same-query results refine) and clear on close, query change or missing row instead of storing the fallback. Arrow keys step fromactiveComposerMenuItemIdand save the search key.ChatView.browser.test.tsx: regression test proving#45614's kept results stay visible while a longer query loads (alongsidequeries.pathSearch.browser.test.tsx) and highlight moves to the new top match.Scope
Small bug fix; no issue needed. Web only (mobile's popover is touch-only).
Verification
Setup: Linux, isolated web dev build in the Browser panel, light theme, 1280x800, fresh isolated data on each commit, local repo with
docs/my notes file.md,docs/café-résumé.txt,src/index.ts,lib/index.tsandalpha.txt.Steps: type
@notes→ Enter → type@caf→ wait for results → Enter.my notes file.md stays highlighted at row 3
café-résumé.txt is highlighted at row 1
Enter inserts my notes file.md a second time
Enter inserts café-résumé.txt
Also checked on head:
@ind→ ArrowDown → Enter, then@alp→ Tab insertsalpha.txt; Escape + reopen,/and$highlight the top row.Not shown
Automated checks
vp run check:changed 12492590770a030ee5f3c171f5b18eb3f9cbeacb: format, lint, knip, typecheck,ChatView.browser.test.tsx(32/32), React Compiler pass.composerMenuHighlight.test.ts(1/1),queries.pathSearch.browser.test.tsx(2/2), and 2x100 concurrent stress runs: 200/200 pass.Generated with Gemini 4 Neon in T3 Code Nightly