From 2f3473b73ff6cb72380394b4e532a3797914ccbc Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Wed, 28 Jan 2026 13:10:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20refactor(calendar):=20remove=20s?= =?UTF-8?q?tatistics=20and=20heatmap=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove unused statistics/heatmap functionality to reduce complexity: - Delete statistics.svelte.ts and heatmap.svelte.ts stores - Delete StatsSidebarSection.svelte and StatsOverlay.svelte components - Remove heatmap toggle button from toolbar - Remove "Statistiken" nav item and Cmd+3 shortcut - Clean up heatmap CSS from all calendar views --- .../calendar/CalendarToolbarContent.svelte | 11 - .../lib/components/calendar/DayView.svelte | 50 -- .../lib/components/calendar/MonthView.svelte | 52 --- .../components/calendar/MultiDayView.svelte | 49 +- .../components/calendar/StatsOverlay.svelte | 257 ----------- .../calendar/StatsSidebarSection.svelte | 434 ------------------ .../lib/components/calendar/WeekView.svelte | 49 +- .../lib/components/calendar/YearView.svelte | 72 +-- .../apps/web/src/lib/config/helpConfig.ts | 6 - .../apps/web/src/lib/stores/heatmap.svelte.ts | 190 -------- .../web/src/lib/stores/statistics.svelte.ts | 270 ----------- .../apps/web/src/routes/(app)/+layout.svelte | 13 - .../apps/web/src/routes/(app)/+page.svelte | 14 +- 13 files changed, 6 insertions(+), 1461 deletions(-) delete mode 100644 apps/calendar/apps/web/src/lib/components/calendar/StatsOverlay.svelte delete mode 100644 apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte delete mode 100644 apps/calendar/apps/web/src/lib/stores/heatmap.svelte.ts delete mode 100644 apps/calendar/apps/web/src/lib/stores/statistics.svelte.ts diff --git a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte index 2d8a0eb65..7e786232d 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte @@ -1,7 +1,6 @@ - - -{#if heatmapStore.enabled && settingsStore.sidebarCollapsed} -
- {#if collapsed} - - - {:else} - -
-
-
- - {periodLabel} -
- -
- -
-
- - Heute - {stats.eventsToday} -
- -
- - Diese Woche - {stats.eventsThisWeek} -
- -
- - Stunden/Woche - {stats.busyHours}h -
- - {#if stats.avgDuration > 0} -
- Ø Dauer - {stats.avgDuration}min -
- {/if} -
- - -
- {/if} -
-{/if} - - diff --git a/apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte b/apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte deleted file mode 100644 index 86edc1838..000000000 --- a/apps/calendar/apps/web/src/lib/components/calendar/StatsSidebarSection.svelte +++ /dev/null @@ -1,434 +0,0 @@ - - -
- - - -
-
-
- -
-
- {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 -
-
- - - -
- - diff --git a/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte b/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte index 6dbb7078d..b5df3cd64 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/WeekView.svelte @@ -7,7 +7,6 @@ import { todosStore, type Task } from '$lib/stores/todos.svelte'; import { birthdaysStore, type BirthdayEvent } from '$lib/stores/birthdays.svelte'; import { eventContextMenuStore } from '$lib/stores/eventContextMenu.svelte'; - import { heatmapStore } from '$lib/stores/heatmap.svelte'; import BirthdayPopover from '$lib/components/birthday/BirthdayPopover.svelte'; import { useVisibleHours, useCurrentTimeIndicator, useBirthdayPopover } from '$lib/composables'; import { toDate } from '$lib/utils/eventDateHelpers'; @@ -887,21 +886,9 @@
{#each days as day} - {@const heatmapLevel = heatmapStore.enabled ? heatmapStore.getLevel(day) : 0} -
+
{format(day, 'EEE', { locale: currentDateLocale })} {format(day, 'd')} - {#if heatmapStore.enabled && heatmapLevel > 0} - {heatmapStore.getDisplayValue(day)} - {/if}
{/each}
@@ -1256,40 +1243,6 @@ transition: background-color 150ms ease; } - /* Heatmap level colors for day headers */ - .day-header.heatmap-1 { - background-color: hsl(var(--color-primary) / 0.1); - } - .day-header.heatmap-2 { - background-color: hsl(var(--color-primary) / 0.2); - } - .day-header.heatmap-3 { - background-color: hsl(var(--color-primary) / 0.35); - } - .day-header.heatmap-4 { - background-color: hsl(var(--color-primary) / 0.5); - } - .day-header.heatmap-5 { - background-color: hsl(var(--color-primary) / 0.65); - } - - .heatmap-badge { - font-size: 0.625rem; - font-weight: 600; - color: hsl(var(--color-muted-foreground)); - padding: 1px 6px; - background: hsl(var(--color-muted) / 0.5); - border-radius: var(--radius-sm); - margin-top: 0.25rem; - } - - /* Better contrast for higher heatmap levels */ - .day-header.heatmap-4 .heatmap-badge, - .day-header.heatmap-5 .heatmap-badge { - background: hsl(var(--color-background) / 0.8); - color: hsl(var(--color-foreground)); - } - .day-name { font-size: 0.75rem; color: hsl(var(--color-muted-foreground)); 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 ed6b2a6e2..ace2f26fd 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/YearView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/YearView.svelte @@ -2,7 +2,6 @@ import { viewStore } from '$lib/stores/view.svelte'; import { eventsStore } from '$lib/stores/events.svelte'; import { settingsStore } from '$lib/stores/settings.svelte'; - import { heatmapStore, type HeatmapLevel } from '$lib/stores/heatmap.svelte'; import { format, startOfMonth, @@ -95,12 +94,6 @@ return eventCountsByDay.get(key) || 0; } - // Get heatmap level for a day (when heatmap is enabled) - function getHeatmapLevel(day: Date): HeatmapLevel { - if (!heatmapStore.enabled) return 0; - return heatmapStore.getLevel(day); - } - // Event handlers function handleDayClick(day: Date, e: MouseEvent) { if (onQuickCreate) { @@ -183,18 +176,12 @@
{#each getMonthDays(month) as day} {@const eventCount = getEventCount(day)} - {@const heatmapLevel = getHeatmapLevel(day)} - {#if heatmapStore.enabled} - - {:else} - - {/if} + @@ -153,11 +147,7 @@ class="calendar-sidebar-mobile mobile-only" class:collapsed={settingsStore.sidebarCollapsed} > - {#if heatmapStore.enabled} - - {:else} - - {/if} +