Repository navigation
Closed
Labels
androidPrimary Android workenhancementNew feature or requestin-progressImplementation started, work still incompleteiosPrimary iOS worksharedShared or cross-platform implementation
Description
The composer's @ mention suggestions and the File Browser tree show a file-type icon for each file or folder, chosen from its name or extension, and agent suggestions show an agent icon, like the official opencode desktop app.
Why
Today the suggestion rows show only a title and subtitle, and the File Browser shows the same generic folder/document glyph for every entry. In the desktop app (packages/app/src/composer/editor/editor.tsx, ComposerSuggestionIcon, and its file tree) every file gets a FileIcon, which makes a long list of paths much faster to scan.
Upstream behaviour (opencode bc5ebf00a4)
packages/ui/src/components/file-icon.tsx:FileIcon({node:{path,type}, expanded, mono})andchooseIconName(path, type, expanded).- Three lookup tables:
fileNames,fileExtensions,folderNames, with defaults Document / Folder / FolderOpen. - Lookup order: lowercased basename in
fileNames, then every dotted suffix longest first (foo.test.tstriesfoo.test.ts,test.ts,ts), then the default. Folders tryname,.name,_name,__name__, plus an Open variant when expanded. monomasks the icon to the current colour.- Assets: multi-colour 24×24 SVGs from the Material Icon Theme (PKief, MIT), shipped as a sprite.
Scope
- Generator next to
scripts/sync-icons.mjsthat copies the reachable SVGs (files and folders, including Open variants) intoicons/file-types/, extracts the three tables into one JSON, and emits an iOS asset catalog, Android VectorDrawables, and Swift/Kotlin name tables. - Design-system component
OpenCodeFileIcon(path, kind: file|directory, expanded, mono)on both platforms, with the lookup ported exactly and unit tests. OpenCodeComposerSuggestionItemgains an optional leading icon. File suggestions useOpenCodeFileIcon; agent suggestions use a Lucide icon. Row height and accessibility stay the same.OpenCodeTreeRowgains a file-type icon variant on both platforms. The File Browser tree and find results use it; folders use the folder-name table and the Open variant when expanded.- File viewer header: unchanged. It is a title-only top bar with no icon.
- Attribution in
THIRD_PARTY_NOTICES.md.
Acceptance criteria
-
@file suggestions show the matching file-type icon on iOS and Android, light and dark -
@agent suggestions show an agent icon - File Browser tree rows and find results show file-type icons on iOS and Android, light and dark
- Folders use the folder-name table, with the Open variant when expanded
- Lookup matches upstream for basename, multi-dot, default and folder-variant cases (unit tests on both platforms)
- Gradient icons (e.g. Kotlin) render correctly on both platforms
- Component gallery entries on both platforms (File Icon, Composer Suggestion Overlay mentions, Tree Row)
PR: #772
Metadata
Metadata
Assignees
Labels
androidPrimary Android workenhancementNew feature or requestin-progressImplementation started, work still incompleteiosPrimary iOS worksharedShared or cross-platform implementation
Activity
#771 Use file-type icons in the File Browser tree
[-]File-type icons in @ mention suggestions[/-][+]File-type icons in @ mentions and the File Browser[/+]#771 File-type icons in @ mentions and the File Browser (#772)
ivanfenenko commentedon Oct 20, 2026
Shipped in #772 (merged). Evidence: #772 (comment)