List events as HEY draws them with hey event day and week - #369
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
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 dayandhey 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 inOccurrenceId/ParentId(seeinternal/tui/calendar.go:132-136and613-625). This currently prints0in 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.
There was a problem hiding this comment.
💡 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".
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.
There was a problem hiding this comment.
💡 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".
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.
There was a problem hiding this comment.
💡 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".
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.
Fixes #158.
The gap
hey event listreads 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().DayandWeek, the TUI's day/week views are built on it, andhey habit listalready 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 anoccurrence_id; theidis the series, which is whateditanddeletetake.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 aslist(shared viawriteEventRows, factored out oflist).Why not
--todayonlistA period is scoped to the calendars the identity has switched on in HEY (
Calendars().Toggle), not to a--calendarid. Sugar onlistwould 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, andlistkeeps its storage-read semantics with docs that now say so plainly and point today/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]andhey event week [date], which list a day or a week as HEY draws it, with recurring events expanded into their occurrences inside the window. Previouslyhey event listlisted 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).occurrence_id; theidis the series, which is whateditanddeletetake.now, resolved in the account's time zone), support--limit/--all, and sharelist's rendering viawriteEventRows.--calendar.Written for commit acafb18. Summary will update on new commits.