Repository navigation
refactor(renderer): one FileTypeIcon component for file icons - #30695
Conversation
Pure refactor. Twelve rows, trees and menus called getFileTypeIcon(path) and then rendered or createElement-ed the result themselves; they now render <FileTypeIcon filePath />, so a change to where file icons come from lands in one component. The tab and chat pill keep getFileTypeIcon because they hand an icon component to another component.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
File icons are drawn in 12 places, each doing its own icon lookup. This adds one small component they all use. Nothing a user sees changes.
What Changed
FileTypeIconcomponent (components/FileTypeIcon.tsx) renders the icongetFileTypeIcon(path)returns, with the same class and style props.getFileTypeIconand rendering the result themselves. The editor tab and chat file pill still callgetFileTypeIconbecause they pass the icon component on to another component.Same icons, same classes, same markup.
Why
Upcoming work lets users pick an icon theme. With one component, that change touches one place instead of a dozen call sites, and new call sites get it for free.
Linked Issue
N/A (maintainer refactor).
Visual Proof
N/A — no UI or behavior change.
Testing
pnpm tc:webclean;oxlintandcheck:code-quality:changedclean.Review
Agent skill upstream boundary
Notes
Behavior-preserving: no change for Linux/Windows/macOS, SSH, mobile, or older clients.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)