Skip to content

feat: calendar sidebar pane with aggregated day views#199

Merged
dep merged 3 commits intomainfrom
feat/calendar-sidebar
Apr 2, 2026
Merged

feat: calendar sidebar pane with aggregated day views#199
dep merged 3 commits intomainfrom
feat/calendar-sidebar

Conversation

@dep
Copy link
Copy Markdown
Owner

@dep dep commented Apr 2, 2026

Summary

Adds a calendar widget to the left sidebar that provides an at-a-glance view of note activity and allows users to quickly navigate to notes created or modified on a specific day.

Closes #196

Features

  • Calendar widget positioned in the left sidebar (top by default)
  • Month navigation with previous/next arrows
  • Activity badges behind date numbers using logarithmic scaling with 95th percentile reference (prevents outliers from skewing visibility)
  • Today's date highlighted with accent color
  • Day selection opens current tab (not new tab) showing notes from that date
  • Tab titled with ISO format: yyyy-MM-dd
  • Two sections in day view: "Created" and "Modified", each sorted newest-first
  • Deduplication - clicking same date focuses existing tab

Technical Details

New Files

  • CalendarDayActivityCalculator.swift - Logarithmic badge size calculation with outlier protection
  • CalendarPaneView.swift - SwiftUI calendar grid with activity badges
  • DatePageView.swift - Tab content showing created/modified note sections
  • CalendarDayActivityCalculatorTests.swift - 16 tests for calculator
  • AppStateDateFilteringTests.swift - 12 tests for date filtering
  • AppStateDateTabTests.swift - 24 tests for tab behavior

Modified

  • AppState.swift - Added TabItem.date(Date), openDate(), notesCreatedOnDate(), notesModifiedOnDate()
  • SettingsManager.swift - Added calendar case to SidebarPane, updated default sidebar config
  • ContentView.swift - Added calendar pane to sidebar content
  • SplitPaneEditorView.swift - Added handling for .date tabs
  • Test files updated for new calendar pane in default sidebar

Testing

  • 52 total new tests added
  • All 1868 tests passing
  • Build verified on macOS

Adds a calendar widget to the left sidebar that provides an at-a-glance view
of note activity and allows quick navigation to notes from specific dates.

Features:
- Calendar widget in left sidebar (top position by default) with month nav
- Activity badges behind date numbers using logarithmic scaling (95th percentile
  reference to avoid outlier skew)
- Today's date highlighted with accent color
- Clicking a day opens current tab showing notes created/modified on that date
- Tab titled with ISO date format (yyyy-MM-dd)
- Two sections: Created and Modified, sorted newest-first
- Deduplication: existing date tabs are focused instead of duplicated

Technical:
- CalendarDayActivityCalculator: logarithmic badge sizing with outlier protection
- TabItem.date(Date): new enum case with displayName formatting
- openDate(): opens in current tab vs openDateInNewTab()
- 52 total tests covering calculator, filtering, and tab behavior

Closes #196
@dep dep marked this pull request as ready for review April 2, 2026 10:24
dep added 2 commits April 2, 2026 06:26
The test used only 3 data points which caused the 95th percentile
to return a value that made multiple days hit the max size. Fixed
by adding more data points so the 95th percentile is a middle value,
allowing proper differentiation between high, medium, and low activity.

Fixes CI failure in test_badgeSize_proportionalToMaxActivity.
@dep dep merged commit 6dff468 into main Apr 2, 2026
2 checks passed
@dep dep deleted the feat/calendar-sidebar branch April 2, 2026 11:05
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.

feat: integrated calendar with aggregated day views

1 participant