Skip to content

List events as HEY draws them with hey event day and week - #369

Merged
jeremy merged 4 commits into
mainfrom
fix/recurring-event-list
Aug 31, 2026
Merged

List events as HEY draws them with hey event day and week#369
jeremy merged 4 commits into
mainfrom
fix/recurring-event-list

Conversation

@jeremy

@jeremy jeremy commented Aug 31, 2026

Copy link
Copy Markdown
Member

Fixes #158.

The gap

hey event list reads what a calendar holds, and a repeating event is stored once — so it comes back on the day the series began rather than on the days it happens. A standing Monday standup is absent on a Tuesday, and an agent can't answer "what's on my schedule today?". Recurrences aren't expanded, and rows land years outside the requested window because the series anchor is what's listed.

The fix

HEY already has the answer. A calendar period — the read behind the app's Day and Week views — expands recurrences into the occurrences inside its window and filters to it. The SDK serves it as CalendarPeriods().Day and Week, the TUI's day/week views are built on it, and hey habit list already reads its week this way. The CLI had just never offered the period read as a command.

  • hey event day [date] — the events of one day, as HEY's Day View draws it. Occurrences carry the day's own times and an occurrence_id; the id is the series, which is what edit and delete take.
  • hey event week [date] — the same for the week a date falls in.

Both default to today, take --limit/--all, sort by start time, and render the same table and JSON envelope as list (shared via writeEventRows, factored out of list).

Why not --today on list

A period is scoped to the calendars the identity has switched on in HEY (Calendars().Toggle), not to a --calendar id. Sugar on list would silently read a different endpoint than every other flag on that command and ignore --calendar — a flag that changes the data source under you. So the period read is its own pair of subcommands, and list keeps its storage-read semantics with docs that now say so plainly and point to day/week.

No SDK changes needed — issue #158's proposed occurrence-merging plan is unnecessary since the server already does the expansion.

Docs updated: command help, agent notes, skills/hey/SKILL.md, API-COVERAGE.md.

Basecamp: CLI card


Summary by cubic

Adds hey event day [date] and hey event week [date], which list a day or a week as HEY draws it, with recurring events expanded into their occurrences inside the window. Previously hey event list listed a repeating event once on the day its series began, even for years outside the requested window; now "what's on my schedule today?" has a direct answer (fixes #158).

  • Occurrences carry the day's own times and an occurrence_id; the id is the series, which is what edit and delete take.
  • Both default to today (asking HEY for now, resolved in the account's time zone), support --limit/--all, and share list's rendering via writeEventRows.
  • Day listings sort day by day, all-day events first within each day, then timed events by clock; the period covers the calendars switched on in HEY, so these commands take no --calendar.
  • Styled event rows now read timed boundaries on the reader's clock (HEY's JSON is always UTC), and timed events sort on the local day; all-day dates keep the day they name and JSON timestamps stay as HEY served them.

Written for commit acafb18. Summary will update on new commits.

Review in cubic

A repeating event is stored once, so hey event list answers a standing
Monday standup on the day the series began and on no other day — an agent
asking "what's on my schedule today?" never sees it (#158).

HEY already has the answer: a calendar period expands recurrences into
the occurrences inside its window and filters to it. The SDK serves it
as CalendarPeriods().Day and Week, the TUI's views are built on it, and
hey habit list reads its week this way. The CLI had just never offered
the period read as a command.

hey event day [date] and hey event week [date] read the day and the week
as HEY draws them, filtered to events, sorted by start. A period is
scoped to the calendars switched on in HEY rather than to a --calendar
id, so the period read is its own command instead of a --today flag on
list, where it would silently switch data sources and ignore --calendar.
@jeremy
jeremy requested a review from a team as a code owner August 31, 2026 22:10
Copilot AI balanced review requested due to automatic review settings August 31, 2026 22:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T22:48:57.307144Z acafb18 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds day/week calendar views with recurring-event expansion and shared event rendering.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Adds hey event day and hey event week.
  • Reuses event-list rendering and supports limits.
  • Updates command references and API coverage.

Reviewed changes

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

Show a summary per file
File Description
.surface Records the new CLI surface.
API-COVERAGE.md Maps period endpoints to commands.
internal/cmd/events.go Registers commands and shares rendering.
internal/cmd/events_period.go Implements day/week period reads.
internal/cmd/events_period_test.go Tests period behavior.
skills/hey/SKILL.md Documents agent usage.
Suppressed comments (1)

internal/cmd/events_period.go:162

  • A period can return a virtual recurring occurrence with Id == 0; its identity is in OccurrenceId/ParentId (see internal/tui/calendar.go:132-136 and 613-625). This currently prints 0 in the table and for --ids-only, while the edit/delete breadcrumbs point users at an ID those commands reject. Normalize period rows to an actionable series ID, or expose an occurrence-aware identifier and actions before rendering them.
				fmt.Sprintf("%d", event.Id), event.Title,

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/cmd/events_period.go Outdated
Comment thread internal/cmd/events_period_test.go Outdated
Comment thread internal/cmd/events.go

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b174418f21

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cmd/events_period.go
Comment thread internal/cmd/events.go
Comment thread internal/cmd/events_period.go
With no date, day and week read /calendar/{days,weeks}/now.json so HEY
resolves today in the account's own time zone rather than the CLI host's,
which could be a day off around midnight.

HEY serves a day of a repeating series as a virtual occurrence — no id of
its own, the series in parent_id, occurrence_id underscored — so the row
resolves its id to the series, the id event edit and delete take, in the
table, the JSON, and --ids-only alike. Fixtures now model the payload as
served. README gains day/week in the list-output inventory and the Events
section.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 987c0dbc34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cmd/events_period.go
An all-day event is stamped midnight UTC, so a timed 00:30+10:00 the same
day is the earlier absolute instant — sorted by instants alone it would
lead the listing, and a small --limit could drop the band for a later
visual row. Sort day by day, the all-day band first within each, then the
timed events by clock, the order HEY's own views draw.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4278b6997

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cmd/events_period.go
Comment thread internal/cmd/events_period.go Outdated
HEY's JSON is always UTC, so a styled boundary printed the UTC wall clock
— 14:00Z read as 14:00 in Berlin where HEY's views draw 16:00 — and a
timed event late the local evening was grouped onto the UTC day, above
the next day's all-day band. Timed boundaries now convert .Local() the
way the TUI and timetrack listings already do, and a timed event sorts
on the reader's own day; all-day dates stay the day they name, and the
JSON keeps the timestamps as HEY served them. Zone-pinned tests cover
the boundary clock and the band ordering.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 7 out of 7 changed files in this pull request and generated no new comments.

@jeremy
jeremy merged commit 8dfba4c into main Aug 31, 2026
24 checks passed
@jeremy
jeremy deleted the fix/recurring-event-list branch August 31, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add a day-view command for a complete daily schedule

2 participants