Context
The Session.changedFiles field (FileArtifact[]) exists on the session interface but is never populated with actual git status data. It's initialized as [] in every session creation path (useSessionCrud.ts, useWizardHandlers.ts, worktreeSession.ts, tabHelpers.ts) and no code ever writes to it.
The file explorer already has plumbing to consume this data:
FileExplorerPanel.tsx:941 — const change = session.changedFiles?.find((f) => f.path.includes(node.name));
FileExplorerPanel.tsx:1021 — passes change?.type to getExplorerFileIcon()
- Default theme has
fileTypeColor() that maps added→green, modified→yellow, deleted→red
But since changedFiles is always empty, none of this has any visible effect.
Additionally, PR #609 (Files Pane Icon Theme) adds a "Rich" icon theme that accepts but ignores the _type parameter entirely in getRichExplorerFileIcon(). Once changedFiles is wired up, the rich theme will need to handle diff status too (e.g., colored dot overlay, border, or CSS filter on the <img> SVG icons).
What needs to happen
-
Populate changedFiles — Run git status (or equivalent) and write results into session.changedFiles with proper FileArtifact.type values (added, modified, deleted). This should refresh on file tree refresh and after agent operations complete.
-
Default theme — Already wired via fileTypeColor(). Should work once data flows. Verify visually.
-
Rich theme — getRichExplorerFileIcon currently discards _type. Add a visual indicator for change status — options include:
- Colored dot/badge overlay on the icon
- CSS filter or opacity shift
- Colored left border on the file row
Whatever approach is chosen, it should be consistent with how the default theme communicates the same information.
-
File name match — The current lookup (f.path.includes(node.name)) is fragile and could false-match (e.g., a file named utils.ts matching src/other/utils.ts). Consider matching against the full relative path instead.
Relevant files
src/renderer/types/index.ts:531 — changedFiles: FileArtifact[] definition
src/renderer/components/FileExplorerPanel.tsx:941 — consumption site
src/renderer/utils/fileExplorerIcons/richTheme.tsx — getRichExplorerFileIcon (ignores _type)
src/renderer/utils/fileExplorerIcons/defaultTheme.tsx — getDefaultExplorerFileIcon (has fileTypeColor)
src/renderer/utils/fileExplorerIcons/shared.ts — shared types including FileChangeType
Context
The
Session.changedFilesfield (FileArtifact[]) exists on the session interface but is never populated with actual git status data. It's initialized as[]in every session creation path (useSessionCrud.ts,useWizardHandlers.ts,worktreeSession.ts,tabHelpers.ts) and no code ever writes to it.The file explorer already has plumbing to consume this data:
FileExplorerPanel.tsx:941—const change = session.changedFiles?.find((f) => f.path.includes(node.name));FileExplorerPanel.tsx:1021— passeschange?.typetogetExplorerFileIcon()fileTypeColor()that mapsadded→green,modified→yellow,deleted→redBut since
changedFilesis always empty, none of this has any visible effect.Additionally, PR #609 (Files Pane Icon Theme) adds a "Rich" icon theme that accepts but ignores the
_typeparameter entirely ingetRichExplorerFileIcon(). OncechangedFilesis wired up, the rich theme will need to handle diff status too (e.g., colored dot overlay, border, or CSS filter on the<img>SVG icons).What needs to happen
Populate
changedFiles— Rungit status(or equivalent) and write results intosession.changedFileswith properFileArtifact.typevalues (added,modified,deleted). This should refresh on file tree refresh and after agent operations complete.Default theme — Already wired via
fileTypeColor(). Should work once data flows. Verify visually.Rich theme —
getRichExplorerFileIconcurrently discards_type. Add a visual indicator for change status — options include:Whatever approach is chosen, it should be consistent with how the default theme communicates the same information.
File name match — The current lookup (
f.path.includes(node.name)) is fragile and could false-match (e.g., a file namedutils.tsmatchingsrc/other/utils.ts). Consider matching against the full relative path instead.Relevant files
src/renderer/types/index.ts:531—changedFiles: FileArtifact[]definitionsrc/renderer/components/FileExplorerPanel.tsx:941— consumption sitesrc/renderer/utils/fileExplorerIcons/richTheme.tsx—getRichExplorerFileIcon(ignores_type)src/renderer/utils/fileExplorerIcons/defaultTheme.tsx—getDefaultExplorerFileIcon(hasfileTypeColor)src/renderer/utils/fileExplorerIcons/shared.ts— shared types includingFileChangeType