From 4cfea784a94690bbc7ebcbf1f0209f33711b96f8 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 28 Apr 2026 07:40:21 -0400 Subject: [PATCH] fix(projects): tab counter NaN when a status bucket is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit services/projects.py:get_project_summary built task_counts dynamically from a GROUP BY query, so a project with no done tasks would omit the 'done' key entirely. Frontend's TypeScript interface declares all three lifecycle keys as required, and ProjectView.vue summed them to render the Tasks tab counter — undefined + N = NaN. Two fixes: 1. Backend: initialise task_counts with {todo: 0, in_progress: 0, done: 0} so the service returns the contract its consumers expect. Catches the same problem for HomeView's project widget and any other consumer. 2. Frontend: defensive ?? 0 on the tab-counter sum, so the existing deploy renders correctly even before the backend rolls. Co-Authored-By: Claude Opus 4.7 --- frontend/src/views/ProjectView.vue | 2 +- src/fabledassistant/services/projects.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/ProjectView.vue b/frontend/src/views/ProjectView.vue index fcbb5cf..d57905c 100644 --- a/frontend/src/views/ProjectView.vue +++ b/frontend/src/views/ProjectView.vue @@ -430,7 +430,7 @@ async function confirmDelete() {