From d9c4688ca7a1c700101a91bb98fdce4344d93c1b Mon Sep 17 00:00:00 2001 From: Aero Mail Dev Date: Fri, 17 Apr 2026 02:52:23 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=D1=83=D0=BB=D1=83=D1=87=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20UI=20=D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4?= =?UTF-8?q?=D0=B0=D1=80=D1=8F=20=E2=80=94=20liquid=20glass,=20EventDetailP?= =?UTF-8?q?opup,=20MiniCalendar,=20WeekView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - EventDetailPopup: двухзонный liquid glass дизайн (hero + body), аватары участников со стэком, статус обязательный/необязательный, копирование email через IPC - EventBlock: убраны лишние glow-эффекты - MiniCalendar: полный liquid glass редизайн — glass-контейнер, specular-шапка, акцентные кружки start/end с градиентом, полоса выделения недели - WeekView: полные названия дней недели, убран месяц, уменьшена высота шапки, сводка по часам в разрезе календарей, бейдж встреч перенесён в угловую ячейку - CalendarView: выбор цвета календаря через color picker (Teleport), хранение цветов в localStorage - calendar.store: resolveColor / setCalendarColor / calendarColors - shared/types: AttendeeInfo, AttendeeStatus; IPC-канал app:copyToClipboard - caldav.provider: парсинг участников (GetItem batch), htmlToText, smtpEmail sanitizer Co-Authored-By: Claude Sonnet 4.6 --- src/main/index.ts | 6 +- src/main/providers/caldav.provider.ts | 123 ++- src/renderer/src/components/AppIcon.vue | 9 + .../src/components/calendar/EventBlock.vue | 6 +- .../components/calendar/EventDetailPopup.vue | 763 +++++++++++------- .../src/components/calendar/MiniCalendar.vue | 255 ++++-- .../src/components/calendar/WeekView.vue | 131 ++- src/renderer/src/stores/calendar.store.ts | 29 + src/renderer/src/views/CalendarView.vue | 168 ++-- src/shared/types/calendar.ts | 11 +- src/shared/types/ipc.ts | 1 + 11 files changed, 1076 insertions(+), 426 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 719ff95..779cdf1 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,4 +1,4 @@ -import { app, BrowserWindow, shell, ipcMain, dialog, Menu, globalShortcut } from 'electron' +import { app, BrowserWindow, shell, ipcMain, dialog, Menu, globalShortcut, clipboard } from 'electron' import { join, basename } from 'node:path' import { statSync } from 'node:fs' import { AccountManager } from './services/account-manager' @@ -136,6 +136,10 @@ ipcMain.handle('app:openFile', async (_event, { path }: { path: string }) => { return err ? { success: false, error: err } : { success: true } }) +ipcMain.handle('app:copyToClipboard', (_event, { text }: { text: string }) => { + clipboard.writeText(text) +}) + app.whenReady().then(async () => { await accountManager.initialize() diff --git a/src/main/providers/caldav.provider.ts b/src/main/providers/caldav.provider.ts index 348846f..760f9ea 100644 --- a/src/main/providers/caldav.provider.ts +++ b/src/main/providers/caldav.provider.ts @@ -10,7 +10,7 @@ import https from 'node:https' import http from 'node:http' import type { IncomingMessage } from 'node:http' import type { AccountConfig, ImapCredentials } from '@shared/types/account' -import type { CalendarInfo, CalendarEvent } from '@shared/types/calendar' +import type { CalendarInfo, CalendarEvent, AttendeeInfo, AttendeeStatus } from '@shared/types/calendar' import { buildNegotiateHeader, parseChallenge, @@ -226,7 +226,11 @@ export class CalDavProvider { `) if (result.status !== 200) return [] - return this.parseEwsEvents(result.body, accountId, calendarId) + const events = this.parseEwsEvents(result.body, accountId, calendarId) + if (events.length > 0) { + try { await this.enrichWithAttendees(events) } catch { /* non-fatal */ } + } + return events } // ── EWS helpers ─────────────────────────────────────────────────────────── @@ -260,6 +264,100 @@ export class CalDavProvider { return distinguishedId === 'calendar' ? 'Календарь' : distinguishedId } + private static htmlToText(html: string): string { + return html + .replace(//gi, '\n') + .replace(/<\/p\s*>/gi, '\n\n') + .replace(/<\/div\s*>/gi, '\n') + .replace(/<\/li\s*>/gi, '\n') + .replace(/<\/tr\s*>/gi, '\n') + .replace(/<[^>]+>/g, '') + .replace(/ /g, ' ') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/&#(\d+);/g, (_, n) => String.fromCharCode(parseInt(n, 10))) + .replace(/\n{3,}/g, '\n\n') + .trim() + } + + private async enrichWithAttendees(events: CalendarEvent[]): Promise { + const eventMap = new Map() + for (const e of events) eventMap.set(e.uid, e) + + const idsXml = events.map((e) => ``).join('\n ') + const result = await this.ewsReq('GetItem', ` + + + IdOnly + + + + + + ${idsXml} + `) + + if (result.status !== 200) return + + const responseRe = /([\s\S]*?)<\/m:Items>/g + let rm: RegExpExecArray | null + while ((rm = responseRe.exec(result.body)) !== null) { + const itemBlock = rm[1] + const idM = itemBlock.match(/([\s\S]*?)<\/t:Attendee>/g + let m: RegExpExecArray | null + while ((m = re.exec(xml)) !== null) { + const ab = m[1] + const nameM = ab.match(/([^<]+)<\/t:Name>/) + const emailM = ab.match(/([^<]+)<\/t:EmailAddress>/) + const rtM = ab.match(/([^<]+)<\/t:ResponseType>/) + const email = emailM ? CalDavProvider.smtpEmail(emailM[1]) : undefined + const name = nameM ? nameM[1].trim() : undefined + if (!name && !email) continue + result.push({ + name: name ?? email!, + email: email ?? '', + required, + status: rtM ? CalDavProvider.parseRt(rtM[1]) : 'unknown', + }) + } + return result + } + + private parseAttendeesList(block: string): AttendeeInfo[] { + const req = block.match(/([\s\S]*?)<\/t:RequiredAttendees>/) + const opt = block.match(/([\s\S]*?)<\/t:OptionalAttendees>/) + return [ + ...(req ? this.parseAttendeeSection(req[1], true) : []), + ...(opt ? this.parseAttendeeSection(opt[1], false) : []), + ] + } + private parseEwsEvents(xml: string, accountId: string, calendarId: string): CalendarEvent[] { const events: CalendarEvent[] = [] const re = /([\s\S]*?)<\/t:CalendarItem>/g @@ -270,6 +368,12 @@ export class CalDavProvider { const r = block.match(new RegExp(`]*)?>([\\s\\S]*?)<\\/t:${tag}>`)) return r ? r[1].replace(/<[^>]+>/g, '').trim() : '' } + const getBody = (): string | undefined => { + const r = block.match(/]*)?>([\\s\\S]*?)<\/t:Body>/) + if (!r) return undefined + const text = CalDavProvider.htmlToText(r[1]) + return text || undefined + } const idM = block.match(/[\s\S]*?([^<]+)<\/t:EmailAddress>/) + const orgBlock = block.match(/([\s\S]*?)<\/t:Organizer>/) + const orgName = orgBlock ? (orgBlock[1].match(/([^<]+)<\/t:Name>/) ?? [])[1]?.trim() : undefined + const orgEmailRaw = orgBlock ? (orgBlock[1].match(/([^<]+)<\/t:EmailAddress>/) ?? [])[1]?.trim() : undefined + // Exchange sometimes returns X500/routing addresses — keep only SMTP emails + const orgEmail = orgEmailRaw?.replace(/^smtp:/i, '').includes('@') + ? orgEmailRaw.replace(/^smtp:/i, '').trim() + : undefined + const organizer = orgName && orgEmail + ? `${orgName} <${orgEmail}>` + : orgName ?? orgEmail events.push({ id: `ews::${idM[1]}`, uid: idM[1], @@ -290,8 +403,8 @@ export class CalDavProvider { end: end.toISOString(), isAllDay, location: get('Location') || undefined, - description: get('Body') || undefined, - organizer: organizerM ? organizerM[1] : undefined, + description: getBody(), + organizer, attendees: [], status: fbStatus === 'tentative' ? 'tentative' : 'confirmed' }) diff --git a/src/renderer/src/components/AppIcon.vue b/src/renderer/src/components/AppIcon.vue index 131c3f5..9b7203e 100644 --- a/src/renderer/src/components/AppIcon.vue +++ b/src/renderer/src/components/AppIcon.vue @@ -29,6 +29,8 @@ export type IconName = | 'location' | 'person' | 'people' + | 'copy' + | 'check' const props = defineProps<{ name: IconName @@ -171,6 +173,13 @@ const paths: Record = { `, + copy: ` + + + `, + check: ` + + `, } diff --git a/src/renderer/src/components/calendar/EventBlock.vue b/src/renderer/src/components/calendar/EventBlock.vue index 7e2ff1b..32669da 100644 --- a/src/renderer/src/components/calendar/EventBlock.vue +++ b/src/renderer/src/components/calendar/EventBlock.vue @@ -92,7 +92,6 @@ const statusClass = computed(() => { bottom: 0; width: 3px; background: var(--ev-color); - box-shadow: 1px 0 8px color-mix(in srgb, var(--ev-color) 60%, transparent); border-radius: 8px 0 0 8px; } @@ -101,9 +100,8 @@ const statusClass = computed(() => { z-index: 3; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ev-color) 25%, rgba(255,255,255,0.22)), - 0 4px 16px rgba(0, 0, 0, 0.40), - 0 0 20px color-mix(in srgb, var(--ev-color) 22%, transparent); - filter: brightness(1.12); + 0 4px 16px rgba(0, 0, 0, 0.40); + filter: brightness(1.10); } .event-block.cancelled { diff --git a/src/renderer/src/components/calendar/EventDetailPopup.vue b/src/renderer/src/components/calendar/EventDetailPopup.vue index 55d8a8b..feaee56 100644 --- a/src/renderer/src/components/calendar/EventDetailPopup.vue +++ b/src/renderer/src/components/calendar/EventDetailPopup.vue @@ -1,9 +1,10 @@ diff --git a/src/renderer/src/components/calendar/MiniCalendar.vue b/src/renderer/src/components/calendar/MiniCalendar.vue index ecf60d3..6de7a20 100644 --- a/src/renderer/src/components/calendar/MiniCalendar.vue +++ b/src/renderer/src/components/calendar/MiniCalendar.vue @@ -68,20 +68,23 @@ function nextMonth(): void { diff --git a/src/renderer/src/components/calendar/WeekView.vue b/src/renderer/src/components/calendar/WeekView.vue index 24ab68d..5616ee9 100644 --- a/src/renderer/src/components/calendar/WeekView.vue +++ b/src/renderer/src/components/calendar/WeekView.vue @@ -9,6 +9,7 @@ const props = defineProps<{ weekStart: Date events: CalendarEvent[] loading?: boolean + calendarColors?: Record }>() const emit = defineEmits<{ eventClick: [event: CalendarEvent] }>() @@ -22,11 +23,11 @@ const HOURS = Array.from({ length: 24 }, (_, i) => i) const days = computed(() => Array.from({ length: 7 }, (_, i) => { const date = addDays(props.weekStart, i) + const raw = format(date, 'EEEE', { locale: ru }) return { date, - dayName: format(date, 'EEE', { locale: ru }), + dayName: raw.charAt(0).toUpperCase() + raw.slice(1), dayNum: format(date, 'd'), - monthLabel: format(date, 'MMM', { locale: ru }), isToday: isToday(date) } }) @@ -162,6 +163,29 @@ function formatHour(h: number): string { return h === 0 ? '' : `${String(h).padStart(2, '0')}:00` } +// ── Per-day calendar summary ───────────────────────────────────────────────── + +const daySummary = computed(() => + days.value.map((day) => { + const dayEvs = timedEvents.value.filter((e) => isSameDay(new Date(e.start), day.date)) + const byCalendar: Record = {} + for (const ev of dayEvs) { + const dur = (new Date(ev.end).getTime() - new Date(ev.start).getTime()) / 3_600_000 + byCalendar[ev.calendarId] = (byCalendar[ev.calendarId] ?? 0) + dur + } + return Object.entries(byCalendar) + .filter(([, h]) => h > 0) + .map(([calId, hours]) => ({ calId, hours })) + }) +) + +function formatDuration(h: number): string { + if (h < 1) return `${Math.round(h * 60)}м` + const whole = Math.floor(h) + const mins = Math.round((h - whole) * 60) + return mins === 0 ? `${whole}ч` : `${whole}ч${mins}м` +} + function eventStyle(layout: LayoutEvent): Record { const colWidth = 100 / layout.totalColumns return { @@ -175,6 +199,7 @@ function eventStyle(layout: LayoutEvent): Record { const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171'] function calendarColor(calendarId: string): string { + if (props.calendarColors?.[calendarId]) return props.calendarColors[calendarId] let hash = 0 for (let i = 0; i < calendarId.length; i++) hash = (hash * 31 + calendarId.charCodeAt(i)) & 0xffffff return CAL_COLORS[Math.abs(hash) % CAL_COLORS.length] @@ -185,7 +210,12 @@ function calendarColor(calendarId: string): string {
-
+ +
+ + {{ events.length }} + +
{{ day.dayNum }}
- {{ day.monthLabel }} + +
+ + + {{ formatDuration(item.hours) }} + +
+
@@ -299,9 +336,6 @@ function calendarColor(calendarId: string): string { border-bottom: 1px solid rgba(255, 255, 255, 0.06); background: rgba(10, 10, 18, 0.35); backdrop-filter: blur(8px); - /* Reserve same scrollbar gutter as .grid-scroll. - scrollbar-gutter only works on scrollable elements (overflow != hidden/visible), - so overflow-y: auto is required even though .day-headers never actually scrolls. */ overflow-y: auto; scrollbar-gutter: stable; } @@ -311,16 +345,38 @@ function calendarColor(calendarId: string): string { flex-shrink: 0; } +/* Corner cell: holds the event-count badge */ +.corner-cell { + display: flex; + align-items: flex-end; + justify-content: center; + padding-bottom: 8px; +} + +.corner-badge { + font-size: 10px; + font-weight: 700; + line-height: 1; + padding: 2px 6px 3px; + border-radius: 10px; + background: rgba(168, 230, 0, 0.10); + border: 1px solid rgba(168, 230, 0, 0.22); + color: var(--accent); + letter-spacing: 0.2px; + box-shadow: inset 0 1px 0 rgba(168, 230, 0, 0.15); +} + .day-header { flex: 1; display: flex; flex-direction: column; align-items: center; - padding: 10px 4px 8px; + padding: 7px 4px 6px; border-left: 1px solid rgba(255, 255, 255, 0.05); - gap: 3px; + gap: 2px; user-select: none; transition: background var(--transition-fast); + min-width: 0; } .day-header.today { @@ -328,11 +384,14 @@ function calendarColor(calendarId: string): string { } .day-name { - font-size: 10px; - font-weight: 700; + font-size: 9.5px; + font-weight: 600; color: var(--text-muted); - text-transform: uppercase; - letter-spacing: 0.6px; + letter-spacing: 0.2px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100%; } .day-header.today .day-name { @@ -340,8 +399,8 @@ function calendarColor(calendarId: string): string { } .day-num-wrap { - width: 30px; - height: 30px; + width: 26px; + height: 26px; border-radius: 50%; display: flex; align-items: center; @@ -351,11 +410,11 @@ function calendarColor(calendarId: string): string { .day-num-wrap.today { background: var(--accent); - box-shadow: 0 0 16px rgba(168, 230, 0, 0.45); + box-shadow: 0 0 14px rgba(168, 230, 0, 0.42); } .day-num { - font-size: 17px; + font-size: 15px; font-weight: 300; color: var(--text-primary); line-height: 1; @@ -364,13 +423,45 @@ function calendarColor(calendarId: string): string { .day-num-wrap.today .day-num { color: var(--accent-text); font-weight: 700; - font-size: 16px; + font-size: 14px; } -.month-label { +/* ── Per-day calendar summary ── */ +.day-summary { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + gap: 4px; + margin-top: 2px; + min-height: 14px; +} + +.day-summary-empty { + min-height: 14px; + margin-top: 2px; +} + +.summary-item { + display: flex; + align-items: center; + gap: 2px; +} + +.summary-dot { + width: 5px; + height: 5px; + border-radius: 50%; + flex-shrink: 0; + box-shadow: 0 0 4px currentColor; +} + +.summary-hrs { font-size: 9px; + font-weight: 600; color: var(--text-muted); - text-transform: capitalize; + letter-spacing: 0.1px; + line-height: 1; } /* ── All-day row ── */ diff --git a/src/renderer/src/stores/calendar.store.ts b/src/renderer/src/stores/calendar.store.ts index 79ad946..5b816cd 100644 --- a/src/renderer/src/stores/calendar.store.ts +++ b/src/renderer/src/stores/calendar.store.ts @@ -5,6 +5,16 @@ import { useIpc } from '../composables/useIpc' import { useAccountsStore } from './accounts.store' import type { CalendarInfo, CalendarEvent } from '@shared/types/calendar' +const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171'] + +function hashCalendarColor(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] +} + +export { CAL_COLORS } + export const useCalendarStore = defineStore('calendar', () => { const { invoke } = useIpc() const accountsStore = useAccountsStore() @@ -20,6 +30,22 @@ export const useCalendarStore = defineStore('calendar', () => { const loadingCalendars = ref(false) const error = ref(null) + // ── Calendar colors (persisted to localStorage) ──────────────────────────── + + const COLORS_KEY = 'calendar-custom-colors' + const calendarColors = ref>( + JSON.parse(localStorage.getItem(COLORS_KEY) ?? '{}') + ) + + function resolveColor(calId: string): string { + return calendarColors.value[calId] ?? hashCalendarColor(calId) + } + + function setCalendarColor(calId: string, color: string): void { + calendarColors.value = { ...calendarColors.value, [calId]: color } + localStorage.setItem(COLORS_KEY, JSON.stringify(calendarColors.value)) + } + // ── Computed ─────────────────────────────────────────────────────────────── const currentWeekEnd = computed(() => endOfWeek(currentWeekStart.value, { weekStartsOn: 1 })) @@ -129,6 +155,9 @@ export const useCalendarStore = defineStore('calendar', () => { loadingCalendars, error, visibleEvents, + calendarColors, + resolveColor, + setCalendarColor, loadCalendars, loadEvents, toggleCalendar, diff --git a/src/renderer/src/views/CalendarView.vue b/src/renderer/src/views/CalendarView.vue index 83bd6d9..f37b439 100644 --- a/src/renderer/src/views/CalendarView.vue +++ b/src/renderer/src/views/CalendarView.vue @@ -2,7 +2,7 @@ import { onMounted, watch, ref } from 'vue' import { format } from 'date-fns' import { ru } from 'date-fns/locale' -import { useCalendarStore } from '../stores/calendar.store' +import { useCalendarStore, CAL_COLORS } from '../stores/calendar.store' import { useAccountsStore } from '../stores/accounts.store' import AccountSwitcher from '../components/sidebar/AccountSwitcher.vue' import WeekView from '../components/calendar/WeekView.vue' @@ -17,20 +17,10 @@ const calStore = useCalendarStore() const accountsStore = useAccountsStore() const showAddAccount = ref(false) -// Calendar color palette -const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171'] -function calendarColor(calendarId: string): string { - let hash = 0 - for (let i = 0; i < calendarId.length; i++) hash = (hash * 31 + calendarId.charCodeAt(i)) & 0xffffff - return CAL_COLORS[Math.abs(hash) % CAL_COLORS.length] -} - const weekLabel = () => { const s = calStore.currentWeekStart const e = calStore.currentWeekEnd - const sStr = format(s, 'd MMM', { locale: ru }) - const eStr = format(e, 'd MMM yyyy', { locale: ru }) - return `${sStr} – ${eStr}` + return `${format(s, 'd MMM', { locale: ru })} – ${format(e, 'd MMM yyyy', { locale: ru })}` } async function reload(): Promise { @@ -44,6 +34,24 @@ watch(() => accountsStore.activeAccountId, reload) function handleEventClick(ev: CalendarEvent): void { calStore.selectEvent(ev) } + +// ── Color picker ────────────────────────────────────────────────────────────── + +const pickerCalId = ref(null) +const pickerPos = ref({ x: 0, y: 0 }) + +function openPicker(calId: string, e: MouseEvent): void { + e.stopPropagation() + if (pickerCalId.value === calId) { pickerCalId.value = null; return } + const rect = (e.currentTarget as HTMLElement).getBoundingClientRect() + pickerPos.value = { x: rect.right + 8, y: rect.top - 2 } + pickerCalId.value = calId +} + +function pickColor(color: string): void { + if (pickerCalId.value) calStore.setCalendarColor(pickerCalId.value, color) + pickerCalId.value = null +}
@@ -135,9 +167,6 @@ function handleEventClick(ev: CalendarEvent): void {

{{ weekLabel() }}

- - {{ calStore.visibleEvents.length }} - @@ -150,6 +179,7 @@ function handleEventClick(ev: CalendarEvent): void { :week-start="calStore.currentWeekStart" :events="calStore.visibleEvents" :loading="calStore.loading" + :calendar-colors="calStore.calendarColors" @event-click="handleEventClick" />
@@ -160,6 +190,7 @@ function handleEventClick(ev: CalendarEvent): void { @@ -295,36 +326,35 @@ function handleEventClick(ev: CalendarEvent): void { background: var(--glass-bg-hover); } -.cal-check { - width: 16px; - height: 16px; - border-radius: 5px; - border: 1.5px solid rgba(255, 255, 255, 0.15); +.cal-dot-btn { + flex-shrink: 0; + width: 20px; + height: 20px; + border-radius: 50%; display: flex; align-items: center; justify-content: center; - flex-shrink: 0; - transition: border-color var(--transition-fast), background var(--transition-fast); background: transparent; + border: none; + padding: 0; + cursor: pointer; + transition: transform var(--transition-fast); } -.cal-item.active .cal-check { - border-color: transparent; - background: rgba(255, 255, 255, 0.08); +.cal-dot-btn:hover { + transform: scale(1.25); } -.cal-dot-inner { - width: 8px; - height: 8px; +.cal-dot { + width: 10px; + height: 10px; border-radius: 50%; flex-shrink: 0; - transition: opacity var(--transition-fast), box-shadow var(--transition-fast); - opacity: 0; + transition: opacity var(--transition-fast); } -.cal-item.active .cal-dot-inner { - opacity: 1; - box-shadow: 0 0 5px currentColor; +.cal-dot.dimmed { + opacity: 0.28; } .cal-name { @@ -518,17 +548,6 @@ function handleEventClick(ev: CalendarEvent): void { gap: 8px; } -.event-count-badge { - font-size: 11px; - font-weight: 600; - padding: 1px 7px; - border-radius: var(--radius-full); - background: rgba(168, 230, 0, 0.12); - border: 1px solid rgba(168, 230, 0, 0.25); - color: var(--accent); - line-height: 1.6; -} - .icon-btn { width: 28px; height: 28px; @@ -654,4 +673,57 @@ function handleEventClick(ev: CalendarEvent): void { inset 0 1px 0 rgba(255, 255, 255, 0.40), 0 2px 20px color-mix(in srgb, var(--accent) 45%, transparent); } + +/* ── Color picker popover ─────────────────────────────────────────────────── */ + +.picker-backdrop { + position: fixed; + inset: 0; + z-index: 200; +} + +.color-picker-popover { + position: fixed; + z-index: 201; + display: flex; + gap: 6px; + padding: 8px 10px; + border-radius: 14px; + background: + linear-gradient(145deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 100%), + rgba(18, 17, 30, 0.92); + backdrop-filter: blur(32px) saturate(2); + -webkit-backdrop-filter: blur(32px) saturate(2); + border: 1px solid rgba(255, 255, 255, 0.13); + border-top-color: rgba(255, 255, 255, 0.22); + box-shadow: + inset 0 1px 0 rgba(255,255,255,0.18), + 0 8px 24px rgba(0,0,0,0.40), + 0 2px 8px rgba(0,0,0,0.30); + animation: picker-in 150ms cubic-bezier(0.34, 1.4, 0.64, 1); +} + +@keyframes picker-in { + from { opacity: 0; transform: scale(0.88) translateY(-4px); } + to { opacity: 1; transform: scale(1) translateY(0); } +} + +.color-swatch { + width: 20px; + height: 20px; + border-radius: 50%; + border: 2px solid transparent; + cursor: pointer; + transition: transform 120ms, border-color 120ms; + flex-shrink: 0; +} + +.color-swatch:hover { + transform: scale(1.18); +} + +.color-swatch.selected { + border-color: rgba(255, 255, 255, 0.70); + transform: scale(1.12); +} diff --git a/src/shared/types/calendar.ts b/src/shared/types/calendar.ts index 9aafb35..aa36a63 100644 --- a/src/shared/types/calendar.ts +++ b/src/shared/types/calendar.ts @@ -5,6 +5,15 @@ export interface CalendarInfo { accountId: string } +export type AttendeeStatus = 'accepted' | 'declined' | 'tentative' | 'unknown' + +export interface AttendeeInfo { + name: string + email: string + required: boolean + status: AttendeeStatus +} + export interface CalendarEvent { id: string uid: string @@ -17,6 +26,6 @@ export interface CalendarEvent { location?: string description?: string organizer?: string - attendees: string[] + attendees: AttendeeInfo[] status?: 'tentative' | 'confirmed' | 'cancelled' } diff --git a/src/shared/types/ipc.ts b/src/shared/types/ipc.ts index 09a6ad4..9a462e0 100644 --- a/src/shared/types/ipc.ts +++ b/src/shared/types/ipc.ts @@ -48,6 +48,7 @@ export interface IpcChannelMap { 'app:setZoom': [{ factor: number }, void] 'app:isEncryptionAvailable': [void, boolean] + 'app:copyToClipboard': [{ text: string }, void] 'calendar:list': [{ accountId: string }, CalendarInfo[]] 'calendar:events': [