Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
🚀 Pre-release Build ReadyTest builds are ready! Install directly using the # Install the pre-release
bin install https://github.com/PinePeakDigital/buzz/releases/tag/pr-213-latest buzz-pr-213# Run the pre-release
buzz-pr-213# Uninstall the pre-release
bin remove buzz-pr-213Direct Download LinksOr download binaries directly from the pre-release page:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new buzz schedule command that visualizes goal deadline distribution across a 24-hour day, helping users identify temporal patterns and scheduling bottlenecks regardless of actual due dates.
Changes:
- Adds
handleScheduleCommand,extractTimeSlots,displayHourlyDensity, anddisplayTimelinefunctions to implement the schedule visualization - Includes comprehensive tests for
extractTimeSlotscovering grouping, sorting, and edge cases - Updates documentation in README.md with detailed command description and example output
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| main.go | Implements the schedule command with time extraction, hourly density chart, and timeline display; adds command to help text and routing |
| schedule_test.go | Provides unit tests for extractTimeSlots function covering various scenarios including empty goals and cross-date grouping |
| README.md | Documents the new command with usage examples, output format, and use cases |
Co-authored-by: narthur <4655422+narthur@users.noreply.github.com>
Co-authored-by: narthur <4655422+narthur@users.noreply.github.com>
Co-authored-by: narthur <4655422+narthur@users.noreply.github.com>
Ensure goal.Losedate is converted to local time when extracting the hour and minute. Previously the code used time.Unix(goal.Losedate, 0) which returns a UTC-based Time value; converting to local time with In(time.Local) yields the correct local hour and minute values. This prevents incorrect slot assignment caused by timezone differences between stored timestamps and the server's local timezone.
Add TestTimelineFormatting to exercise displayTimeline formatting behavior for hours/minutes and goal joining. The new tests cover zero-padded times (including midnight, noon, and late-night), and multiple-goal joining cases to ensure output matches expected strings. Also import fmt and strings for test helpers. Also add .tool-versions pin for Go 1.24.12.
Update hour-count rendering to cap large values with a trailing plus sign and to write label runes into the buffer using a bounds-checked loop. - Change cap behavior from "99" to "99+" so the UI indicates overflow rather than truncating the value. - Replace ad-hoc single/double digit placement with a for-loop that writes each rune and stops at the buffer end to prevent index overflow. This simplifies the placement logic and prevents accidental truncation or out-of-bounds writes when labels exceed available space.
Align axis markers to the actual label positions instead of printing a fixed ASCII axis string. Build a rune buffer sized to the output, place '┼' markers at computed positions from labelHours, and fill horizontal segments '─' between the first and last marker. Skip markers that would fall outside the buffer. This makes the axis adapt to label positions and prevents misaligned or truncated markers when labelHours change.
Remove the redundant shouldPass boolean from schedule_test.go. The tests already infer success from assertions and the table-driven cases only provide name and hourCounts, so keeping shouldPass added noise and unused fields. Simplify the test table to improve readability and reduce maintenance overhead.
c29fe34 to
d53a27c
Compare
handleScheduleCommandfunction to main.goOriginal prompt
buzz schedulecommand #212✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Note
Introduces a new CLI command to visualize goal deadline distribution across a 24‑hour day.
buzz schedulewith two ASCII views:displayHourlyDensity(per-hour bar chart with capped counts) anddisplayTimeline(chronological groups by exact HH:MM)extractTimeSlotsand wires command intomain(help text, command switch)sort; add.tool-versions(Go 1.24.12)Written by Cursor Bugbot for commit d53a27c. This will update automatically on new commits. Configure here.