OpenProgram Docs

Shared file type icons

FileTypeIcon (apps/web/components/files/file-type-icon.tsx) draws the complete coloured set of Pierre Trees (@pierre/trees, Apache 2.0 with NOTICE), upstream SVG paths and filename mapping unchanged. The icon is decorative next to a visible filename and hidden from accessibility APIs.

AspectRule
SurfacesSidebar and central Files page (shared FileTree, Pierre's React renderer), file tabs, split picker, review list, composer file suggestions
Size16px in file rows, 14px in tabs; row height, indentation and folder controls unchanged
MatchingBasename after normalising separators and case. Exact filename before extension; dotted parent directories do not count.
Special namesAGENTS.md Markdown, CLAUDE.md Claude, Git metadata Git
Unknown fileNeutral document icon
Names like constructorNames and extensions matching inherited object properties take the default icon before the resolver sees them
ColourRecognisable in light and dark themes
Folders, controlsLucide, unchanged

Filename or path, then basename, then FileTypeIcon, then SVG. No file reads, network, state, persistence, permissions or mutation. Attachment upload states, file cache, drafts, review state, and folder expansion, guides, search and opening are unaffected; existing labels and focus stay authoritative.

Sources compared
SourceFinding
Installed CodexIts file-tree assets for default files, Markdown and Python match Pierre's SVGs. OpenProgram takes the public upstream set and extracts nothing from the Codex distribution.
React SymbolsMIT React SVG library with file and extension resolution; not used
Material Icon ThemeFile and folder SVGs with a manifest; needs asset integration rather than React rendering
Lucide aloneGeneric outlines do not tell languages apart

Acceptance

  • Python, TypeScript, shell, JSON, Markdown and Git examples resolve to distinct SVGs.
  • CLAUDE.md, AGENTS.md, uppercase extensions, Windows paths and unknown types render correctly.
  • Every listed surface uses the shared renderer; expanding a folder and opening a file behave as before.

Implementation status

StatusItems
ImplementedEvery surface above. In the default dark App: filled generic files, green Markdown, orange JSON, purple database, unchanged Lucide folders.
Not yetManual light-theme and other-theme acceptance in the App; light colours are checked against the upstream palette only
Last updated · 2026-11-25