Skip to content

Add multi-day calendar selection with custom popover UI#393

Merged
iamtoruk merged 2 commits into
mainfrom
feat/day-review-selector
May 24, 2026
Merged

Add multi-day calendar selection with custom popover UI#393
iamtoruk merged 2 commits into
mainfrom
feat/day-review-selector

Conversation

@iamtoruk
Copy link
Copy Markdown
Member

Summary

  • Custom CalendarPopover replaces native DatePicker, themed to match the app
  • Non-contiguous multi-day selection: pick any combination of days across months
  • --days CLI flag with comma-separated dates, post-filters from bounding range scan
  • Pending state committed only on Done; Clear + Done resets to active period
  • Absorbs PR Add single-day review mode #380's day-review foundation (single-day mode, --from/--to, dashboard day nav)

What changed

CLI (src/):

  • parseDaysFlag() in cli-date.ts: parses, validates, deduplicates comma-separated dates
  • filterProjectsByDays() in parser.ts: post-filters turns to only selected days
  • --days option on status command, wired into menubar-json with filtering on all paths (projects, providers, daily cache)
  • --from/--to added to status for contiguous ranges
  • Dashboard day-review mode from PR Add single-day review mode #380 (d key, arrow nav, DayBanner)

Swift menubar (mac/):

  • PeriodSegmentedControl: calendar icon inline in period strip, custom CalendarPopover with month nav, multi-day toggle, Done/Clear buttons
  • AppStore: selectedDays: Set<String>, switchTo(days:), PayloadCacheKey with days field
  • DataClient: passes --days for multi-day, single-day fallback for days.count == 1

Verification

  • 975 tests pass
  • Integration verified: sum of individual --day calls matches --days output across cost, calls, activities (12 categories), models (9), and providers (12)
  • Cross-month selection verified (Apr + May days)
  • Council deep review with actual source: no real bugs found (2 found and fixed during review)

Test plan

  • Open menubar, click calendar icon, select 2+ non-contiguous days, tap Done
  • Verify cost/calls match sum of individual days
  • Clear all days + Done returns to active period
  • Select days across different months
  • Single day selection works
  • Dismiss popover without Done discards changes
  • Period tabs still work normally after day selection

iamtoruk added 2 commits May 24, 2026 09:18
Replace native DatePicker with a custom-themed CalendarPopover supporting
non-contiguous multi-day selection. Add --days CLI flag for comma-separated
date filtering that post-filters from the bounding range scan.

CLI: parseDaysFlag() parses and validates dates, filterProjectsByDays()
filters turns to only selected days. Verified that sum of individual --day
calls matches --days output across cost, calls, activities, models, and
providers.

Swift: DataClient passes --days for multi-day, with single-day fallback.
AppStore tracks selectedDays as Set<String> with PayloadCacheKey support.
CalendarPopover uses pending state committed only on Done tap.
When user clears all selected days and taps Done, switch back to the
active period instead of silently keeping the old day selection.
@iamtoruk iamtoruk merged commit 5800179 into main May 24, 2026
3 checks passed
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