feat: Enhance goal progress tracking and display
Deploy Development / deploy (push) Successful in 55s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s

- Added a function to calculate goal progress percentage based on start, target, and current values.
- Updated GoalsPage to display progress in a user-friendly format, including visual progress bars.
- Implemented error handling for goal progress updates in the backend to ensure robustness.
This commit is contained in:
Lars committed 2026-04-14 10:43:49 +02:00
1 parent df8e732709
commit 1b01f5e6d0
2 files changed
+61 -12

No files matched your search

+6
View File
@@ -699,6 +699,12 @@ def get_goals_grouped(session: dict = Depends(require_auth)):
grouped[cat] = []
goal_dict = r2d(goal)
# Keep in sync with GET /goals/list: derive current_value & progress from live data
try:
_update_goal_progress(conn, pid, goal_dict)
except Exception as e:
print(f"[ERROR] Failed to update progress for goal {goal_dict.get('id')}: {e}")
goal_dict['focus_contributions'] = focus_map.get(goal['id'], [])
grouped[cat].append(goal_dict)