From e3c9dfcfee05744d4651068eb1ef713ecaf00a06 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Fri, 10 Jul 2026 17:16:53 +1000 Subject: [PATCH] fix(desktop): keep New file/Deleted badge visible in single-file diffs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /dev/null label fix made getDiffFileLabel return the bare file path for new/deleted files, which now matches fallbackFilePath in single-file diffs — so showFileHeader skipped the per-file header entirely, hiding the New file/Deleted type badge and the +/- change counts. Show the header whenever the diff type is notable (add/delete/rename/ copy), while still collapsing it for plain modifications where it would only repeat the path shown in the card header. Co-Authored-By: Claude Fable 5 Signed-off-by: Matt Toohey --- desktop/src/features/messages/ui/DiffViewer.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/desktop/src/features/messages/ui/DiffViewer.tsx b/desktop/src/features/messages/ui/DiffViewer.tsx index 239fd0211..3c1723ce7 100644 --- a/desktop/src/features/messages/ui/DiffViewer.tsx +++ b/desktop/src/features/messages/ui/DiffViewer.tsx @@ -79,10 +79,13 @@ export function DiffViewer({
{files.map((file) => { const label = getDiffFileLabel(file, fallbackFilePath); - const showFileHeader = - files.length > 1 || !fallbackFilePath || label !== fallbackFilePath; const { additions, deletions } = countDiffFileChanges(file); const diffType = normalizeDiffType(file.type); + const showFileHeader = + files.length > 1 || + !fallbackFilePath || + label !== fallbackFilePath || + diffType !== "modify"; const fileKey = [ file.oldPath || "", file.newPath || "",