Calendar via @nbtca/nbtcal + activity heatmap#23
Merged
Conversation
- Replace inline ICS fetch+parse in calendar.ts with loadCalendar() from @nbtca/nbtcal; recurring events are now included via nbtcal's recurrence expansion - Add toDisplayEvent() mapping CalendarEvent -> prompt's Event type - Add fetchHeatmapBuckets() helper for trailing-year heatmap data - Add calendar-heatmap.ts: pure GitHub-contributions-style grid renderer (7 weekday rows × ~53 week columns, unicode glyphs with ASCII fallback, month labels via Intl.DateTimeFormat, localized legend) - showCalendar() renders heatmap header above the events table - Wire --heatmap flag to events command (--json prints JSON buckets, plain prints the grid; takes precedence over --today/--next) - Add vitest unit tests for renderHeatmap and toDisplayEvent - Extend test-cli.sh smoke test to cover events --heatmap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Swaps the calendar feature's data layer to @nbtca/nbtcal and adds a terminal activity heatmap.
fetchEvents()now uses@nbtca/nbtcal(loadCalendar().upcoming()) instead of inlineical.jsparsing. This fixes recurring (RRULE) events being silently dropped — e.g. the biweekly NWDC meetings now appear. All-day events render with no time.events --heatmapflag and an auto heatmap header in the interactive calendar view: a GitHub-contributions-style grid (7 weekday rows × ~53 week columns, trailing 12 months) built onnbtcal.heatmap(). ASCII fallback + color, host-timezone-independent layout.ical.jsdropped from direct deps (comes via nbtcal);vitestadded with 17 unit tests for the event mapper and heatmap renderer.Test plan
npm test— build + 17 vitest + bash CLI smoke (incl.events --heatmap) all passnode dist/index.js events --plain— recurring meetings now listednode dist/index.js events --heatmap— aligned grid renders against the live feednode dist/index.js events --heatmap --json— dense bucketsNotes
docs/superpowers/specs/2026-06-17-calendar-nbtcal-heatmap-design.md.Bumps to 1.1.0.