Problem
The threshold 85 appears in 3+ locations across the codebase: readiness calculator weak-topic filter, mastery utils display functions, and readiness level determination. The 65 ("approaching") threshold is similarly scattered. Magic numbers in multiple files will drift out of sync.
Solution
Extract into a shared constants file (e.g. src/lib/assess/constants.ts or src/lib/utils/constants.ts):
export const MASTERY_THRESHOLD = 85; // "exam ready"
export const APPROACHING_THRESHOLD = 65; // "approaching" readiness
Update all callsites to import from that file.
Files Affected
src/lib/progress/calculator.ts
src/lib/utils/mastery.ts
src/components/ui/progress-indicator.tsx
References
Problem
The threshold
85appears in 3+ locations across the codebase: readiness calculator weak-topic filter, mastery utils display functions, and readiness level determination. The65("approaching") threshold is similarly scattered. Magic numbers in multiple files will drift out of sync.Solution
Extract into a shared constants file (e.g.
src/lib/assess/constants.tsorsrc/lib/utils/constants.ts):Update all callsites to import from that file.
Files Affected
src/lib/progress/calculator.tssrc/lib/utils/mastery.tssrc/components/ui/progress-indicator.tsxReferences