Fix global dashboard goals progress and todos count

Goals progress:
- Now includes partial goals at 0.5 weight (completed=1.0, partial=0.5)
- A goal marked [~] contributes 50% to progress bar
- Previously showed 0% when all goals were partial

Todos stat:
- Global dashboard now shows count from docs/todos.md
- Previously showed ecosystem.total_active_todos (sum of all projects)
- This matches what the todos section actually displays

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rob 2026-01-09 02:11:16 -04:00
parent b084e9e30a
commit 93a2c7673e
1 changed files with 20 additions and 3 deletions

View File

@ -817,7 +817,18 @@ class ProjectDashboard(QWidget):
# Update stats
self.stats_row.update_stat("healthy", ecosystem.healthy_count)
self.stats_row.update_stat("warning", ecosystem.warning_count + ecosystem.critical_count)
self.stats_row.update_stat("todos", ecosystem.total_active_todos)
# Load global todos count from docs/todos.md (not ecosystem total)
global_todos_path = self._docs_root / "todos.md"
global_todos_count = 0
if global_todos_path.exists():
try:
global_parser = TodosParser(global_todos_path)
global_todo_list = global_parser.parse()
global_todos_count = len(global_todo_list.active_todos)
except Exception:
pass
self.stats_row.update_stat("todos", global_todos_count)
# Hide alert banner in global mode
self.alert_banner.hide()
@ -987,8 +998,10 @@ class ProjectDashboard(QWidget):
self._goal_list = self._goals_parser.parse()
# Active goals
completed_count = 0
# Progress calculation: completed=1.0, partial=0.5, not achieved=0
progress_score = 0.0
total_count = len(self._goal_list.active)
completed_count = 0 # For display ratio
for goal in self._goal_list.active:
widget = GoalItemWidget(goal)
@ -997,7 +1010,10 @@ class ProjectDashboard(QWidget):
widget.edited.connect(self._on_goal_edited)
self.goals_active_section.add_widget(widget)
if goal.completed:
progress_score += 1.0
completed_count += 1
elif goal.partial:
progress_score += 0.5
if not self._goal_list.active:
no_goals = QLabel("No active goals")
@ -1043,7 +1059,8 @@ class ProjectDashboard(QWidget):
self.goals_nongoals_section.set_count_ratio(nongoals_checked, len(self._goal_list.non_goals))
# Update progress bar (active goals only)
progress = int((completed_count / total_count) * 100) if total_count > 0 else 0
# Uses progress_score where completed=1.0, partial=0.5
progress = int((progress_score / total_count) * 100) if total_count > 0 else 0
self.goals_progress.setValue(progress)
def _load_milestones(self):