feat: add file state indicators to sidebar#128
Conversation
Greptile SummaryThis PR adds visual state indicators (◌ ✦ ✕ ➜) to the sidebar file list, letting users instantly distinguish untracked, new, deleted, and renamed files by icon and color. The change threads a new Key changes:
Confidence Score: 5/5Safe to merge — no correctness, data-integrity, or layout issues found. All five changed files are clean with no P0 or P1 issues. The data flow is end-to-end consistent, the layout math is verified, all themes are updated, and the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Git loader\nsrc/core/loaders.ts] -->|buildUntrackedDiffFile\nisUntracked=true| B[DiffFile\nsrc/core/types.ts]
A -->|buildDiffFile\nisUntracked=undefined| B
B -->|buildSidebarEntries\nchangeType + isUntracked ?? false| C[FileListEntry\nsrc/ui/lib/files.ts]
C -->|entry prop| D[FileListItem\nsrc/ui/components/panes/FileListItem.tsx]
D -->|getFileStateIcon| E{isUntracked?}
E -->|yes| F["◌ blue — untracked"]
E -->|no, check changeType| G{changeType}
G -->|new| H["✦ green — new"]
G -->|deleted| I["✕ red — deleted"]
G -->|rename-pure / rename-changed| J["➜ amber — renamed"]
G -->|change / default| K["no icon"]
L[AppTheme\nsrc/ui/themes.ts] -->|fileNew / fileDeleted\nfileRenamed / fileUntracked| D
Reviews (1): Last reviewed commit: "feat: add file state indicators to sideb..." | Re-trigger Greptile |
2124bef to
7ce1562
Compare
Show standard git status letters for file states: - ? untracked files (blue) - A added/new files (green) - D deleted files (red) - R renamed files (amber/gold) - M modified files (purple) Changes: - Add isUntracked field to DiffFile type - Add changeType and isUntracked to FileListEntry - Add file state color tokens (fileNew, fileDeleted, fileRenamed, fileModified, fileUntracked) to all themes - Render colored git status letter prefix in FileListItem - Update buildDiffFile to track untracked status - Add fileLabelParts for styled header rendering - Show state labels in muted color in file headers Using standard git status codes (A/D/M/R/?) makes the UI immediately recognizable to git users while color coding helps distinguish states.
7ce1562 to
34bbee5
Compare
Show standard git status letters for file states in the sidebar and headers:
Using standard git status codes (A/D/M/R/?) makes the UI immediately recognizable to git users while color coding helps distinguish states at a glance.
Changes:
Fixes:
Files changed: