[Insights] Achievement progress not calculated for partial completion #296
Labels
No labels
good first issue
has-pr
help wanted
idea
priority
critical
priority
high
priority
low
priority
medium
status
blocked
status
in-progress
status
needs-review
status
ready
type
bug
type
docs
type
enhancement
type
feature
type
refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
customable/claude-mem#296
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The "In Progress" tab for achievements shows no items because the progress is never calculated for partially completed achievements.
Root Cause
In
packages/backend/src/services/insights-service.ts, thecheckAchievements()method only updates progress when the threshold is already reached:This means:
observations-10requires 10 observations5 >= 10is falseExpected Behavior
Progress should be calculated for all achievements with thresholds, regardless of completion:
User with 5 observations should see:
observations-10: 50% progress (5/10)observations-100: 5% progress (5/100)Affected Achievements
All threshold-based achievements are affected:
Solution
Refactor
checkAchievements()to always calculate and store progress for all threshold-based achievements, not just when the threshold is met.Related
Additional Problem: Manual Trigger Required
Currently the user must click "Check Achievements" to trigger any progress calculation. This should happen automatically when relevant events occur:
Proposed Solution
session-endhook)getAchievements()instead of storing itOption 3 might be simplest - calculate current progress from live data instead of relying on stored values:
This removes the need for:
Fixed in commit
665c3ca.The
checkAchievements()method now always calculates progress for all threshold-based achievements, regardless of whether the threshold is met.Changes:
trackProgress()helper that always callsupdateProgressIfNeeded(achievementId, current/threshold)bugfix,decision,discovery) instead of just totalbugfixCount/bugFixCountparameterNow users will see proper progress percentages in the "In Progress" tab.