feat: add /summary, /setbreak, weekly totals, and fix command dispatch for arg-bearing commands

- Add /summary [YYYY-MM] command for monthly work/break/day-off totals

- Add weekly totals row to main menu status

- Add /setbreak <minutes> for configurable daily break threshold

- Fix HandleMessage routing: extract command name instead of exact match (fixes /export YYYY-MM, /edit, /note, /summary, /setbreak)

- Update README with full command table and configurable break docs
This commit is contained in:
2026-06-24 20:39:51 +03:30
parent 323c1bc010
commit 834c318271
6 changed files with 255 additions and 15 deletions

View File

@@ -49,6 +49,16 @@ func (h *Handler) buildStatusText(chatID int64) string {
text += fmt.Sprintf("\nToday: %s worked", formatDuration(totals.TotalSeconds))
}
loc := loadLocation(user.Timezone)
weekTotal := h.computeWeekTotals(user, loc)
if weekTotal > 0 {
text += fmt.Sprintf("\nWeek: %s", formatDuration(weekTotal))
}
if day.MinBreakThreshold > 0 {
text += fmt.Sprintf("\nBreak threshold: %dm", day.MinBreakThreshold/60)
}
text += "\n\nChoose an action:"
return text
}