Repository navigation
#771 File-type icons in @ mentions and the File Browser - #772
Merged
Merged
Conversation
Port opencode's FileIcon lookup and its Material Icon Theme SVGs as OpenCodeFileIcon on iOS and Android, generated from icons/file-types by scripts/sync-file-type-icons.mjs. Composer @ suggestions now show the file-type icon for files and a Lucide brain glyph for agents. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 tasks done
ivanfenenko
marked this pull request as ready for review
October 20, 2026 20:33
Collaborator
Author
|
@cursor review |
OpenCodeTreeRow gains a file-type icon variant on both platforms (iOS icon: .fileType(path:), Android OpenCodeTreeRowIcon.FileType); the File Browser tree and find results use it, with open-folder art when expanded. The generator now bakes currentColor (default folder, folder-github, ...) to the porcelain icon-base grey and honours a non-zero viewBox origin on Android (json, rollup). Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7ce2693. Configure here.
Collaborator
Author
Evidence: real apps (#771)iOS 26.5 iPhone 17 simulator and Android Pixel 9a emulator, against opencode v1 1.19.1 on the scenario harness's throwaway project. The File Browser shots used a plain File Browser:
|
| iOS | Android | |
|---|---|---|
| Light | ||
| Dark |
@ suggestions: agents (brain glyph) and project files (iOS @sr, Android @s)
| iOS | Android | |
|---|---|---|
| Light | ||
| Dark |
@mobile/: Kotlin (gradient), Swift, Dockerfile (file-name match), Gradle
| iOS | Android | |
|---|---|---|
| Light | ||
| Dark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@suggestions now show a file-type icon for each file (chosen from its name or extension) and a Lucidebrainglyph for agents, like the opencode desktop composer (ComposerSuggestionIcon). Row height and accessibility labels are unchanged.OpenCodeFileIcon(path, kind: file|directory, expanded, mono)on iOS and Android. It is an exact port of opencode'schooseIconName: lowercased basename infileNames, then dotted suffixes longest first, then Document. Folders tryname,.name,_name,__name__, plus the Open variant when expanded.monodraws in the current foreground colour.OpenCodeComposerSuggestionItemgets an optionalleadingIcon(.file(path, kind)/.icon(OpenCodeIcon), AndroidFile/Icon).SessionChatAtSuggestionderives it, and file suggestions now carryisDirectory.scripts/sync-file-type-icons.mjs(npm run file-icons:sync) vendors the 314 reachable SVGs and the three lookup tables from an opencode checkout intoicons/file-types/(--import <checkout>). From there it generates:FileTypeIcons.xcassets, with vector preserved and original renderingaapt:attrandgradientTransformbaked in<svg>or<g>are written onto each shape, and unfilled shapes are dropped. Without this,fill="none"icons (Document, Readme, Log, Changelog, Settings) drew a black square on Android.OpenCodeTreeRowgains a variant-first icon: iOSicon: .generic | .fileType(path:)(default.generic); AndroidOpenCodeTreeRowIcon.Glyph | FileType(path), with the existingImageVectoroverload delegating toGlyph. The file viewer header is a title-only top bar with no icon, so it is unchanged.currentColorparts (the default folder, folder-github, folder-scripts and 16 more) are baked to the porcelainicon-basegrey. Upstream inherits--icon-basethere, and every preset uses a similar mid grey in light and dark. On Android, a non-zero viewBox origin (json,rollup) is now honoured; before, those icons drew off-canvas.agentin Icons (both platforms).THIRD_PARTY_NOTICES.md, with provenance inicons/file-types/README.md.Checks
xcodebuild build-for-testingpassed.OpenCodeFileIconTests+FilesViewModelTestspassed (29 tests).OpenCodeFileIconTestscovers basename, multi-dot, whole-name, default and folder-variant cases, and checks that every reachable icon resolves to a bundled asset (UIImage(named:)).:app:assembleDebugpassed, so all 314 drawables compile under aapt. The full:app:testDebugUnitTestsuite passed (2,391 tests, 0 failures), includingOpenCodeFileIconLookupTest(8/8, the same cases as iOS).Navigation.kt,SessionChatScreen.ktand the overlay file were already there.Evidence
Real apps, light and dark, iOS and Android: http://ivan-m2.local:8787/2026-10-20/2244-771-file-type-icons/
srcandtestexpanded (.ts,.js,.mjs,.json,package.json,README.md), against a plainopencode servev1 on the same throwaway project. Another session held the harness's fixed ports.iOS 26.5 iPhone 17 simulator and Android Pixel 9a emulator, against opencode v1 1.19.1 on the scenario harness's throwaway project. The File Browser shots used a plain
opencode serveon that project. These are static states, so there are no GIFs.File Browser:
srcandtestexpanded (open-folder art), mixed.ts/.js/.mjs/.json/package.json/README.md@suggestions: agents (brain glyph) and project files (iOS@sr, Android@s)@mobile/: Kotlin (gradient), Swift, Dockerfile (file-name match), GradleIssue
Risks / Follow-ups
currentColorgrey does not follow non-porcelain presets exactly; it is close for every preset except signal (#2A2A2A / #E0E0E0)._lighticon variants are not chosen by theme, same as upstreamFileIcon.svg2vectordrawable2.9.1 (MIT) for the generator only.🤖 Generated with Claude Code