mirror of
https://github.com/coder/coder.git
synced 2026-09-01 14:53:15 +08:00
51f298f2de
When a git change has zero additions and zero deletions (like adding a binary file/image), the diff stats were hidden entirely because of `additions === 0 && deletions === 0` early-return guards. This changes the behavior so that `+0 -0` is always rendered when there are changed files, ensuring visibility in both the sidebar and the Git tab. ### Changes **`DiffStats.tsx`** - `DiffStatNumbers`: Removed the `null` early return — always renders both `+N` and `−N` counters. - `DiffStatBadge`: Now only returns `null` when there are no changed files AND both counts are zero. Always renders both pills. - `DiffStatsInline`: Same guard — shows `+0 −0` clickable stats when files changed but lines are zero. **`AgentsSidebar.tsx`** - `hasLineStats` now also checks `changedFiles > 0`, so the sidebar entry shows `+0 -0` for binary-only diffs. - Removed the `additions > 0` / `deletions > 0` conditional wrappers — both values are always rendered.