Skip to content

Calendar via @nbtca/nbtcal + activity heatmap#23

Merged
m1ngsama merged 7 commits into
mainfrom
feat/calendar-nbtcal-heatmap
Jun 18, 2026
Merged

Calendar via @nbtca/nbtcal + activity heatmap#23
m1ngsama merged 7 commits into
mainfrom
feat/calendar-nbtcal-heatmap

Conversation

@m1ngsama

Copy link
Copy Markdown
Member

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 inline ical.js parsing. This fixes recurring (RRULE) events being silently dropped — e.g. the biweekly NWDC meetings now appear. All-day events render with no time.
  • New events --heatmap flag 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 on nbtcal.heatmap(). ASCII fallback + color, host-timezone-independent layout.
  • ical.js dropped from direct deps (comes via nbtcal); vitest added 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 pass
  • node dist/index.js events --plain — recurring meetings now listed
  • node dist/index.js events --heatmap — aligned grid renders against the live feed
  • node dist/index.js events --heatmap --json — dense buckets

Notes

  • nbtcal feed load timeout raised to 15s (the production feed responds in ~10s).
  • Design spec: docs/superpowers/specs/2026-06-17-calendar-nbtcal-heatmap-design.md.

Bumps to 1.1.0.

m1ngsama added 7 commits June 17, 2026 15:07
- 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
@m1ngsama m1ngsama merged commit 863e37f into main Jun 18, 2026
2 checks passed
@m1ngsama m1ngsama deleted the feat/calendar-nbtcal-heatmap branch June 18, 2026 02:02
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.

1 participant