Repository navigation
fix(app): keep the @ menu open while it searches - #59425
Conversation
There was a problem hiding this comment.
The fix works. With the PR's slow-file-search story applied to the base, the new component test fails: the previous file rows vanish while the next search is pending. With this change the rows stay until the new results replace them. The test passed 5 of 5 repeats, and the full composer.spec.ts component suite passes. tsc -b in packages/app is clean. Screenshots below show the same pending moment on the base and with the PR.
The public API is unchanged: this only touches the app's internal composer state and a story.
One small inline note: a failed search now leaves the previous query's results on screen.
| void Promise.resolve(input.searchContextFiles(query, controller.signal)).then( | ||
| (files) => !controller.signal.aborted && setFound({ query, files }), | ||
| (files) => !controller.signal.aborted && setFound("files", files), | ||
| () => undefined, |
There was a problem hiding this comment.
Now that results are kept from one query to the next, a failed search leaves the previous query's file rows listed for the new query until another search succeeds. Before this change they disappeared. Clearing them on failure, for example () => !controller.signal.aborted && setFound("files", []), would stop out-of-date rows from staying around when the server errors.


The @ menu in the composer no longer jumps or empties out on every keystroke.
Typing after
@shows files, agents and skills that match. While the next file search was in flight, the menu dropped its file rows, so it shrank to just the agents and skills, then grew back when results arrived. Agents, skills and the slash menu are not affected.🔍 Origin: seen in real use, typing
@re…in the desktop app. Same fix as #59424 on beta; dev has the identical code.❌ Before
@re. File results forreshow.s. ❌ The file rows vanish at once, so the menu shrinks (or shows "No matching items").resarrive and the menu grows back.✅ After
@re. File results forreshow.s. Thereresults stay in place whileresis searched.resresults replace them in one step. The highlighted row stays highlighted if it is still in the list.📊 Proof
Before, typing
@researchwith a 250 ms search:at-menu-before.mp4
After:
at-menu-after.mp4
The new component test fails on the current branch (old rows gone while the next search is pending) and passes with the change, 10 of 10 repeats.
Visual
👀 Read:
interaction.ts, the file search. It no longer tags results with the query they came from, so the list can briefly show files for the previous query; that is the point. The rest is routine.The clips use the composer story with a simulated 250 ms file search.
Checks run
bun typecheckinpackages/app: no type errors