Skip to content

File-type icons in @ mentions and the File Browser #771

Closed

Description

@ivanfenenko

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}) and chooseIconName(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.ts tries foo.test.ts, test.ts, ts), then the default. Folders try name, .name, _name, __name__, plus an Open variant when expanded.
  • mono masks 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.mjs that copies the reachable SVGs (files and folders, including Open variants) into icons/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.
  • OpenCodeComposerSuggestionItem gains an optional leading icon. File suggestions use OpenCodeFileIcon; agent suggestions use a Lucide icon. Row height and accessibility stay the same.
  • OpenCodeTreeRow gains 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

Activity

  1. added
    enhancement
    ios
    android
    shared
    in-progress
    on Oct 20, 2026
  2. added a commit that references this issue on Oct 20, 2026
  3. changed the title [-]File-type icons in @ mention suggestions[/-] [+]File-type icons in @ mentions and the File Browser[/+] on Oct 20, 2026
  4. added a commit that references this issue on Oct 20, 2026
  5. ivanfenenko commented on Oct 20, 2026

    @ivanfenenko
    CollaboratorAuthor

    Shipped in #772 (merged). Evidence: #772 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidenhancementin-progressiosshared

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions