feat(desktop): file icons and Quick Open parity for chat @ file mentions

SU
1mo ago
+132-22

Fixes SUPER-2963.

What changed

Extension icons

  • Each row in the @ mention list shows the file's icon, the same FileIcon Quick Open (Cmd+P) uses.
  • File chips show the icon too, both in the composer and in sent messages in the transcript.
  • A pasted file URL in the composer (for example https://example.com/report.pdf) gets its file icon instead of the globe. Links in the transcript already showed file icons.

Loading like Cmd+P
Both surfaces use the same host filesystem.searchFiles with the same ranking. The differences were in the UI:

  • With no query, Cmd+P lists recently viewed files, but @ showed "Type to search files...". Now @ lists recent files too.
  • When you type a query, recent matches come first and are removed from the search results, as in Cmd+P (fileMentionMatches).
  • The limit was 20 for @ and 50 for Cmd+P. Both are 50 now.
  • The @ query stopped at $ ( ) [ ] + ~, so a path like routes/$workspaceId/... or [id]/page.tsx closed the menu partway through. matchToken in @superset/chat-ui now keeps those characters. A space still ends the query.

Validation

  • New tests: utils/fileMentions/fileMentions.test.ts and PromptInput/utils/matchToken/matchToken.test.ts.
  • bun test passes for the ChatSession tree (450 tests) and for packages/chat-ui (47 tests).
  • tsc --noEmit is clean for apps/desktop and packages/chat-ui. Biome is clean. check:i18n passes with no new strings.
  • I have not checked this in the running app. Please try @ in a chat before merging: icons in the list and chips, recent files on a bare @, and a path that contains $.

Notes

  • I could not watch the issue recording because it needs Linear auth. The parity fixes come from comparing the code paths.
  • I left out a test for the chip icon URL. In happy-dom, location.href is about:blank, and resolveFileIconAssetUrl cannot resolve against that.

Summary by cubic

Now @ file mentions in chat match Quick Open: rows and chips show extension icons, recently viewed files lead the list, and route path characters no longer tear the search token apart.

  • @ mention rows and file chips in the composer and transcript show the file's icon, and pasted file URLs in the composer now get a file icon instead of a globe.
  • With no query, @ lists recently viewed files like Cmd+P; recent matches come first and are removed from search results, and the result limit is now 50 for both.
  • The @ query now keeps $ ( ) [ ] + ~, so paths like routes/$workspaceId or [id]/page.tsx no longer close the menu mid-path—a space still ends the query.
  • Not yet validated in the running app; please exercise @ in a chat before merging.