add habit leveling/XP system, explicit fail marking for missed habits, and scrollable habit tabs
- Habits and the account now accumulate XP and levels from check streaks, with streak/level-up celebration banners and push notifications. - The "yesterday missed" banner on /today now lets a habit be explicitly marked failed (not just checked done), backed by a new HabitLog.status column so completion-rate/streak calculations never count a failed day as done. - The habit management tabs scroll horizontally on narrow screens instead of wrapping to two lines, with a pure-CSS edge shadow indicating more content.
This commit is contained in:
+2
-2
@@ -23,8 +23,8 @@ def toggle_log(habit_id: int, db: Session = Depends(get_db), current_user: User
|
||||
habit = habit_service.get_habit(db, habit_id, current_user.id)
|
||||
if habit is None:
|
||||
raise HTTPException(status_code=404, detail="습관을 찾을 수 없습니다")
|
||||
checked, milestone_streak = log_service.toggle_check_and_celebrate(db, habit, date.today())
|
||||
return {"checked": checked, "milestone_streak": milestone_streak}
|
||||
checked, milestone_streak, level_up = log_service.toggle_check_and_celebrate(db, habit, date.today())
|
||||
return {"checked": checked, "milestone_streak": milestone_streak, "level_up": level_up}
|
||||
|
||||
|
||||
@router.get("/logs", response_model=list[HabitLogOut])
|
||||
|
||||
Reference in New Issue
Block a user