Skip to content

feat: add buzz schedule command#213

Merged
narthur merged 11 commits intomainfrom
copilot/add-buzz-schedule-command
Jan 26, 2026
Merged

feat: add buzz schedule command#213
narthur merged 11 commits intomainfrom
copilot/add-buzz-schedule-command

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

  • Add handleScheduleCommand function to main.go
  • Add schedule command to main() switch statement
  • Add schedule command to help text
  • Create helper functions for schedule visualization
    • Extract time-of-day from goal deadlines
    • Group goals by exact time
    • Count goals per hour for density chart
    • Generate ASCII bar chart for hourly density
    • Generate timeline view with grouped goals
  • Add tests for schedule command
  • Update README with schedule command documentation
  • Add comprehensive tests for displayHourlyDensity and displayTimeline
  • Handle 100+ goal counts (cap display at "99")
  • Remove unused variable in tests
Original prompt

This section details on the original issue you should resolve

<issue_title>Add buzz schedule command</issue_title>
<issue_description>## Overview

Add a new buzz schedule command that displays a visual representation of how all goal deadlines are distributed throughout a 24-hour day, regardless of when they're actually due. This helps users identify scheduling patterns and bottlenecks in their goal deadlines.

Visualization Design

Use a two-part display:

1. Hourly Density Overview (Top)

A compact vertical bar chart showing goals per hour across the 24-hour day:

HOURLY DENSITY
    ▁     █         █     ▃       ▅
00  06    10        12    15      18      22
├───┼─────┼─────────┼─────┼───────┼───────┼────┤
    1     5         1     2       1       3

2. Detailed Timeline (Bottom)

A vertical timeline listing all goals grouped by their deadline time:

TIMELINE
────────────────────────────────────────────────
06:00 ├─ wake_up
10:30 ├─ exercise, vitamins, breakfast, meditation, journal
12:00 ├─ lunch
15:00 ├─ afternoon_walk, water_check
18:00 ├─ dinner_prep
22:00 ├─ bedtime_routine, reading, evening_review

Implementation Details

  1. Extract time-of-day from all goal deadlines (ignoring the date)
  2. Group goals by exact time
  3. Count goals per hour for density chart
  4. Sort chronologically through the day
  5. Display using ASCII characters that work well without colors

Benefits

  • Quick visual scan of busiest hours
  • Identify scheduling imbalances and bottlenecks
  • Understand goal distribution patterns
  • Works well in terminals with colors disabled</issue_description>

Comments on the Issue (you are @copilot in this section)

@narthur @coderabbitai How might this work? What might it look like? Is this feasible with just ASCII output? @narthur @coderabbitai The goal for this command would be to see how all goal deadlines are distributed throughout a day as if they were all due today, regardless of whether they are actually due today or not. So I'm less concerned about color-coding for urgency and more about making clear which goals are due at which times. Also it may be relatively common for many goals to have due times at the exact same time, for example 5 different goals all due at 10:30am. @narthur @coderabbitai Option A is interesting. Could Option A be combined with a second compact visualization above it that gives a visual overview of the density of deadlines for each hour of the day? Maybe horizontally? Perhaps using a color gradient? So the option A timeline wouldn't be forced to expand to keep everything in scale when multiple goals are due at the same time, since the horizontal density graph above it would serve that function. @narthur @coderabbitai Let's go with version 2 so that it'll work well even when the user disables colors. Let's update this issue's description and title with our new plan. @narthur @coderabbitai Using `buzz clock` as the command for this feels potentially misleading. What are some better options for this command's name?

✨ 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.

  • Adds buzz schedule with two ASCII views: displayHourlyDensity (per-hour bar chart with capped counts) and displayTimeline (chronological groups by exact HH:MM)
  • Implements time extraction/grouping via extractTimeSlots and wires command into main (help text, command switch)
  • Adds comprehensive tests for slot extraction and both visualizations; updates README with usage and examples
  • Minor: import sort; add .tool-versions (Go 1.24.12)

Written by Cursor Bugbot for commit d53a27c. This will update automatically on new commits. Configure here.

Copilot AI changed the title [WIP] Add buzz schedule command for goal deadlines visualization feat: add buzz schedule command Jan 20, 2026
Copilot AI requested a review from narthur January 20, 2026 14:57
@narthur narthur marked this pull request as ready for review January 20, 2026 15:02
Copilot AI review requested due to automatic review settings January 20, 2026 15:02
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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 @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 20, 2026

🚀 Pre-release Build Ready

Test builds are ready! Install directly using the bin command:

# 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-213

Direct Download Links

Or download binaries directly from the pre-release page:

💡 No GitHub login required for downloads!

🗑️ This pre-release will be automatically deleted when the PR is closed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and displayTimeline functions to implement the schedule visualization
  • Includes comprehensive tests for extractTimeSlots covering 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

Copilot AI and others added 8 commits January 26, 2026 09:04
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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

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.
@narthur narthur force-pushed the copilot/add-buzz-schedule-command branch from c29fe34 to d53a27c Compare January 26, 2026 14:44
@narthur narthur merged commit 915fd8e into main Jan 26, 2026
2 checks passed
@narthur narthur deleted the copilot/add-buzz-schedule-command branch January 26, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add buzz schedule command

3 participants