From c5a5527a44ec3d5197a6a0e68be30f2b71718967 Mon Sep 17 00:00:00 2001 From: vodyanoysh Date: Thu, 16 Apr 2026 21:19:14 +0700 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=D1=80=D0=B5=D0=B4=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D0=B9=D0=BD=20=D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D1=8F=20=E2=80=94=20liquid=20glass=20UI/UX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CalendarView: новый тулбар (nav-группа, badge счётчика событий), расширенный сайдбар с мини-навигатором месяца и улучшенным списком календарей (checkbox-стиль с цветными dot-индикаторами) - MiniCalendar: новый компонент — компактный месячный навигатор с подсветкой текущей недели и кликом по дню для перехода - WeekView: заголовки дней с увеличенным номером и Today-кружком с glow, пунктирные полу-часовые линии, пульсирующий now-dot, тонкая полоска подсветки колонки сегодня, custom scrollbar - EventBlock: полноценный liquid glass — backdrop-filter, цветной gradient border, specular highlight, цветная метка времени, glow при hover, dashed левая полоска для tentative - EventDetailPopup: цветная accent-полоска сверху, цветной dot в заголовке, icon-wrap для каждой строки метаданных, popup-in анимация (spring scale), slim scrollbar - AppIcon: добавлены иконки warning, location, person, people - calendar.store: метод goToDate для перехода к произвольной дате Co-Authored-By: Claude Sonnet 4.6 --- src/renderer/src/components/AppIcon.vue | 23 + .../src/components/calendar/EventBlock.vue | 163 ++++++- .../components/calendar/EventDetailPopup.vue | 297 +++++++++--- .../src/components/calendar/MiniCalendar.vue | 221 +++++++++ .../src/components/calendar/WeekView.vue | 249 ++++++---- src/renderer/src/stores/calendar.store.ts | 8 +- src/renderer/src/views/CalendarView.vue | 453 ++++++++++++------ 7 files changed, 1084 insertions(+), 330 deletions(-) create mode 100644 src/renderer/src/components/calendar/MiniCalendar.vue diff --git a/src/renderer/src/components/AppIcon.vue b/src/renderer/src/components/AppIcon.vue index 72881f6..131c3f5 100644 --- a/src/renderer/src/components/AppIcon.vue +++ b/src/renderer/src/components/AppIcon.vue @@ -25,6 +25,10 @@ export type IconName = | 'image' | 'bell-off' | 'calendar' + | 'warning' + | 'location' + | 'person' + | 'people' const props = defineProps<{ name: IconName @@ -148,6 +152,25 @@ const paths: Record = { `, + warning: ` + + + + `, + location: ` + + + `, + person: ` + + + `, + people: ` + + + + + `, } diff --git a/src/renderer/src/components/calendar/EventBlock.vue b/src/renderer/src/components/calendar/EventBlock.vue index 47c2d76..7e2ff1b 100644 --- a/src/renderer/src/components/calendar/EventBlock.vue +++ b/src/renderer/src/components/calendar/EventBlock.vue @@ -12,12 +12,20 @@ const props = defineProps<{ const emit = defineEmits<{ click: [event: CalendarEvent] }>() const timeLabel = computed(() => { - if (props.event.isAllDay) return 'All day' + if (props.event.isAllDay) return 'Весь день' const start = new Date(props.event.start) const end = new Date(props.event.end) return `${format(start, 'HH:mm')} – ${format(end, 'HH:mm')}` }) +const durationMinutes = computed(() => { + const start = new Date(props.event.start) + const end = new Date(props.event.end) + return (end.getTime() - start.getTime()) / 60_000 +}) + +const isShort = computed(() => durationMinutes.value < 45) + const statusClass = computed(() => { if (props.event.status === 'cancelled') return 'cancelled' if (props.event.status === 'tentative') return 'tentative' @@ -28,65 +36,168 @@ const statusClass = computed(() => { diff --git a/src/renderer/src/components/calendar/EventDetailPopup.vue b/src/renderer/src/components/calendar/EventDetailPopup.vue index 6476f72..55d8a8b 100644 --- a/src/renderer/src/components/calendar/EventDetailPopup.vue +++ b/src/renderer/src/components/calendar/EventDetailPopup.vue @@ -7,6 +7,7 @@ import AppIcon from '../AppIcon.vue' const props = defineProps<{ event: CalendarEvent + color?: string }>() const emit = defineEmits<{ close: [] }>() @@ -18,62 +19,115 @@ const dateLabel = computed(() => { if (props.event.isAllDay) { const isSameDay = start.toDateString() === end.toDateString() if (isSameDay) return format(start, 'd MMMM yyyy', { locale: ru }) - const endAdjusted = new Date(end.getTime() - 1) // all-day end is exclusive + const endAdjusted = new Date(end.getTime() - 1) return `${format(start, 'd MMMM', { locale: ru })} – ${format(endAdjusted, 'd MMMM yyyy', { locale: ru })}` } const sameDay = start.toDateString() === end.toDateString() if (sameDay) { - return `${format(start, 'd MMMM yyyy, HH:mm', { locale: ru })} – ${format(end, 'HH:mm')}` + return `${format(start, 'd MMMM yyyy', { locale: ru })}, ${format(start, 'HH:mm')} – ${format(end, 'HH:mm')}` } return `${format(start, 'd MMMM HH:mm', { locale: ru })} – ${format(end, 'd MMMM HH:mm yyyy', { locale: ru })}` }) -const statusLabel: Record = { - confirmed: 'Подтверждено', - tentative: 'Предварительно', - cancelled: 'Отменено' +const durationLabel = computed(() => { + if (props.event.isAllDay) return 'Весь день' + const start = new Date(props.event.start) + const end = new Date(props.event.end) + const mins = Math.round((end.getTime() - start.getTime()) / 60_000) + if (mins < 60) return `${mins} мин` + const h = Math.floor(mins / 60) + const m = mins % 60 + return m > 0 ? `${h} ч ${m} мин` : `${h} ч` +}) + +const statusConfig = { + confirmed: { label: 'Подтверждено', color: '#4ade80' }, + tentative: { label: 'Предварительно', color: '#f0a500' }, + cancelled: { label: 'Отменено', color: '#ff5555' } } + +// CAL_COLORS palette (same as WeekView) +const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171'] +function calendarColor(id: string): string { + let hash = 0 + for (let i = 0; i < id.length; i++) hash = (hash * 31 + id.charCodeAt(i)) & 0xffffff + return CAL_COLORS[Math.abs(hash) % CAL_COLORS.length] +} + +const evColor = computed(() => props.color ?? calendarColor(props.event.calendarId))