From bdac31e8e7ac756804e6a11a34c97231b4562ee6 Mon Sep 17 00:00:00 2001 From: Sebastian Krupinski Date: Fri, 3 Jul 2026 20:23:50 -0400 Subject: [PATCH] feat: make event over flow show on hover Signed-off-by: Sebastian Krupinski --- src/components/MonthView.vue | 104 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/src/components/MonthView.vue b/src/components/MonthView.vue index 4ed9aec..90b7c40 100644 --- a/src/components/MonthView.vue +++ b/src/components/MonthView.vue @@ -181,35 +181,19 @@ function getSingleDayEvents(date: Date): CalendarInstance[] { } // "+N more" popover listing all of a day's events -const morePopover = ref<{ open: boolean; target: HTMLElement | null; date: Date | null }>({ - open: false, - target: null, - date: null, -}); - -function showMorePopover(event: MouseEvent, date: Date) { - morePopover.value = { - open: true, - target: event.currentTarget as HTMLElement, - date, - }; -} - -const morePopoverInstances = computed(() => { - return morePopover.value.date ? instancesStore.instancesForDay(morePopover.value.date) : []; -}); - -const morePopoverLabel = computed(() => { - return morePopover.value.date?.toLocaleDateString('en-US', { +function morePopoverLabel(date: Date): string { + return date.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric', - }) ?? ''; -}); + }); +} -function onPopoverEventClick(instance: CalendarInstance) { - morePopover.value.open = false; - emit('event-click', instance.entity); +function formatStartTime(instance: CalendarInstance): string { + return new Date(instance.startMs).toLocaleTimeString('en-US', { + hour: 'numeric', + minute: '2-digit', + }); } function isToday(date: Date): boolean { @@ -280,9 +264,42 @@ function getEventColor(instance: CalendarInstance): string {
+{{ cell.hiddenCount }} more + + +
{{ morePopoverLabel(cell.date) }}
+ + + + + + {{ formatStartTime(instance) }} + + {{ instance.label || 'Untitled' }} + + + +
+
@@ -315,34 +332,6 @@ function getEventColor(instance: CalendarInstance): string { - - - - -
{{ morePopoverLabel }}
- - - - {{ instance.label || 'Untitled' }} - - -
-
@@ -576,6 +565,13 @@ function getEventColor(instance: CalendarInstance): string { font-weight: 600; } +.more-popover-time { + font-size: 11px; + opacity: 0.7; + font-variant-numeric: tabular-nums; + margin-right: 4px; +} + .more-popover-dot { width: 10px; height: 10px;