From 6035994972a72da7d936139f4dfbe7bbeeb4f312 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Tue, 16 Dec 2025 18:39:59 +0100 Subject: [PATCH] feat(calendar): add stats sidebar section and heatmap support in year view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add StatsSidebarSection component with event statistics, weekly trend chart, and calendar activity - Show stats sidebar when heatmap mode is enabled instead of todo section - Add heatmap level classes (1-5) to YearView with GitHub-style coloring - Only show StatsOverlay when sidebar is collapsed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../components/calendar/StatsOverlay.svelte | 4 +- .../calendar/StatsSidebarSection.svelte | 434 ++++++++++++++++++ .../lib/components/calendar/YearView.svelte | 65 ++- .../apps/web/src/routes/(app)/+page.svelte | 14 +- 4 files changed, 511 insertions(+), 6 deletions(-) create mode 100644 apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte diff --git a/apps/calendar/apps/web/src/lib/components/calendar/StatsOverlay.svelte b/apps/calendar/apps/web/src/lib/components/calendar/StatsOverlay.svelte index 201928b93..47d7c1e28 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/StatsOverlay.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/StatsOverlay.svelte @@ -57,8 +57,8 @@ }); - -{#if heatmapStore.enabled} + +{#if heatmapStore.enabled && settingsStore.sidebarCollapsed}
{#if collapsed} diff --git a/apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte b/apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte new file mode 100644 index 000000000..a739ad0a4 --- /dev/null +++ b/apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte @@ -0,0 +1,434 @@ + + +
+ + + +
+
+
+ +
+
+ {stats.eventsToday} + Heute +
+
+ +
+
+ +
+
+ {stats.eventsThisWeek} + Diese Woche +
+
+ +
+
+ +
+
+ {stats.upcomingEvents} + Anstehend +
+
+ +
+
+ +
+
+ {stats.busyHours}h + Stunden/Woche +
+
+
+ + +
+

+ + Letzte 7 Tage +

+
+ {#each miniTrend as day} +
+
0} + >
+ {day.label.charAt(0)} +
+ {/each} +
+
+ + + {#if stats.calendarActivity.length > 0} +
+

+ + Kalender-Aktivität +

+
+ {#each stats.calendarActivity.slice(0, 5) as cal} +
+
+ {cal.name} + {cal.total} +
+ {/each} +
+
+ {/if} + + +
+
+ + Ø {stats.avgDuration} Min +
+
+ + {stats.recurringEvents} wiederkehrend +
+
+ + {stats.allDayRatio.allDay} ganztägig +
+
+ + +
+ {stats.totalEvents} Events geladen +
+
+ + diff --git a/apps/calendar/apps/web/src/lib/components/calendar/YearView.svelte b/apps/calendar/apps/web/src/lib/components/calendar/YearView.svelte index 265e7a172..ed6b2a6e2 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/YearView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/YearView.svelte @@ -183,12 +183,18 @@
{#each getMonthDays(month) as day} {@const eventCount = getEventCount(day)} + {@const heatmapLevel = getHeatmapLevel(day)} - + {#if heatmapStore.enabled} + + {:else} + + {/if} @@ -144,7 +150,11 @@ class="calendar-sidebar-mobile mobile-only" class:collapsed={settingsStore.sidebarCollapsed} > - + {#if heatmapStore.enabled} + + {:else} + + {/if}