feat(desktop): file icons and Quick Open parity for chat @ file mentions
SU
1mo ago+132+132+012345678901234567890123456789-22-22-01234567890123456789
Fixes SUPER-2963.
What changed
Extension icons
- Each row in the @ mention list shows the file's icon, the same
FileIconQuick 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 likeroutes/$workspaceId/...or[id]/page.tsxclosed the menu partway through.matchTokenin@superset/chat-uinow keeps those characters. A space still ends the query.
Validation
- New tests:
utils/fileMentions/fileMentions.test.tsandPromptInput/utils/matchToken/matchToken.test.ts. bun testpasses for the ChatSession tree (450 tests) and forpackages/chat-ui(47 tests).tsc --noEmitis clean forapps/desktopandpackages/chat-ui. Biome is clean.check:i18npasses 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.hrefisabout:blank, andresolveFileIconAssetUrlcannot 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 likeroutes/$workspaceIdor[id]/page.tsxno 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.