diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-07-16 06:41:40 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-07-16 06:41:40 +0000 |
| commit | cef79fc49fd8d6e607c71432755812adca847ce2 (patch) | |
| tree | 71513bba33b941f919c502481e1b321ae38abf28 /internal/handlers/renderer.go | |
| parent | e2a20706caa5cfb10897db84e246e6bdb4992470 (diff) | |
Fix overlapping-event double-subtraction in ComputeBudgetPeriod; clarify task-filter doc comment; add multi-day test
Overlapping calendar events within the same availability block were each
subtracted independently, double-counting their intersection and making
availability under-counted (a 120-min block with two 60-min-overlap events
that overlap each other 18:30-19:00 came out to 0 min instead of the
correct 30 min). Replace the per-event overlapMinutes subtraction with
busyMinutesInBlock, which clips each event to the block, merges the
clipped intervals, and subtracts the union's total length.
Also clarify ComputeBudgetPeriod's doc comment: task filtering only
enforces an upper bound (due < end); start is intentionally not used to
filter tasks, since callers are expected to pre-fetch and pass in
already-overdue tasks. Add a multi-day-window test verifying availability
sums correctly across days, a block only contributes on its matching
weekday, and the day-iteration loop excludes the day at `end`.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PQaPGQVSfmKUiHXB87qRTC
Diffstat (limited to 'internal/handlers/renderer.go')
0 files changed, 0 insertions, 0 deletions
