From 783f0fe0e429f379eab1382fa196c6bc2e6d6313 Mon Sep 17 00:00:00 2001 From: Andy <119136210+AndyMik90@users.noreply.github.com> Date: Sun, 25 Jan 2026 11:28:21 +0100 Subject: [PATCH] auto-claude: subtask-1-1 - Add filter after map operation to remove empty str (#1466) Fix incorrect uncommitted file count display after refreshing a task. The issue was that empty strings from .substring(3).trim() operations on short/malformed git status lines were not filtered out, inflating the count. This adds a second filter after the map to remove empty strings: .filter(file => file) --- apps/frontend/src/main/ipc-handlers/task/worktree-handlers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/main/ipc-handlers/task/worktree-handlers.ts b/apps/frontend/src/main/ipc-handlers/task/worktree-handlers.ts index a9eed426..ff629eeb 100644 --- a/apps/frontend/src/main/ipc-handlers/task/worktree-handlers.ts +++ b/apps/frontend/src/main/ipc-handlers/task/worktree-handlers.ts @@ -2413,7 +2413,8 @@ export function registerWorktreeHandlers( uncommittedFiles = gitStatus .split('\n') .filter(line => line.trim()) - .map(line => line.substring(3).trim()); // Skip 2 status chars + 1 space, trim any trailing whitespace + .map(line => line.substring(3).trim()) // Skip 2 status chars + 1 space, trim any trailing whitespace + .filter(file => file); // Remove empty strings from short/malformed status lines hasUncommittedChanges = uncommittedFiles.length > 0; }