From 448cfb90100c0bb3cc9c5657ada9075c33c5a3f3 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Fri, 12 Dec 2025 13:03:31 +0100 Subject: [PATCH] fix(calendar): improve toolbar UX and fix build warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Merge hours filter toggle and time range selector into single button - Click toggles filter on/off - Right-click (desktop) / long-press (mobile) opens time range dropdown - Add overflow indicators for events outside visible time range - Show colored lines at top/bottom edge for hidden events - Works in DayView, WeekView, and MultiDayView - Fix portal pattern for dropdown z-index in PillCalendarSelector - Fix all build warnings: - Remove unused .task-drag-ghost CSS in WeekView/MultiDayView - Remove unused imports in MonthView - Add ARIA role to TodoDetailModal backdrop - Change labels to spans in PillTimeRangeSelector - Convert button to div with role=button in ThemeCard - Replace deprecated svelte:component with dynamic component 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../calendar/CalendarToolbar.svelte | 276 +++++++++++------- .../lib/components/calendar/DateStrip.svelte | 16 +- .../lib/components/calendar/DayView.svelte | 128 +++++++- .../lib/components/calendar/MonthView.svelte | 3 - .../calendar/PillCalendarSelector.svelte | 19 +- .../components/todo/TodoDetailModal.svelte | 4 +- .../src/components/ThemeCard.svelte | 20 +- .../navigation/PillTimeRangeSelector.svelte | 132 ++++++++- 8 files changed, 449 insertions(+), 149 deletions(-) diff --git a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte index 9c255b5b4..607f9d473 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte @@ -1,131 +1,189 @@ - - - +{#if !isCollapsed} + + - + - - viewStore.goToToday()} title="Zum heutigen Tag springen"> - Heute - + +
+ +
+ +
+
+{/if} - - - - viewStore.goToPrevious()} title="Zurück" iconOnly> - - - - - viewStore.goToNext()} title="Weiter" iconOnly> - - - - - - - - - settingsStore.set('showOnlyWeekdays', !settingsStore.showOnlyWeekdays)} - active={settingsStore.showOnlyWeekdays} - title="Nur Wochentage anzeigen (Mo-Fr)" + +{#if isCollapsed} + +{/if} - - + diff --git a/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte b/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte index a4abe650a..86e875875 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte @@ -14,6 +14,12 @@ import { onMount, tick } from 'svelte'; import SunCalc from 'suncalc'; + interface Props { + isSidebarMode?: boolean; + } + + let { isSidebarMode = false }: Props = $props(); + // Get event count for a day (max 5 dots displayed) function getEventCount(date: Date): number { const events = eventsStore.getEventsForDay(date, false); @@ -208,7 +214,7 @@ }); -
+
{#if !isTodayVisible} {/if} @@ -273,7 +279,7 @@ diff --git a/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte b/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte index d32183cae..936c5b755 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/MonthView.svelte @@ -18,9 +18,6 @@ isToday, isSameDay, isWeekend, - setYear, - setMonth, - setDate, getHours, getMinutes, differenceInMinutes, diff --git a/apps/calendar/apps/web/src/lib/components/calendar/PillCalendarSelector.svelte b/apps/calendar/apps/web/src/lib/components/calendar/PillCalendarSelector.svelte index 8e52c37ec..aff0d8d57 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/PillCalendarSelector.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/PillCalendarSelector.svelte @@ -2,6 +2,16 @@ import { calendarsStore } from '$lib/stores/calendars.svelte'; import { goto } from '$app/navigation'; + // Portal action - moves element to body to escape stacking contexts + function portal(node: HTMLElement) { + document.body.appendChild(node); + return { + destroy() { + node.remove(); + }, + }; + } + interface Props { direction?: 'up' | 'down'; embedded?: boolean; @@ -80,20 +90,23 @@ {#if isOpen} - + - +