From 82bc5dd04eb978e1fa609ce313050c2882964699 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Mon, 23 Feb 2026 11:35:57 +0700 Subject: [PATCH] refactor(frontend): extract calendar scene into workspace component --- .../components/workspace/CrmWorkspaceApp.vue | 558 +++-------------- .../workspace/calendar/CrmCalendarPanel.vue | 559 ++++++++++++++++++ 2 files changed, 646 insertions(+), 471 deletions(-) create mode 100644 frontend/app/components/workspace/calendar/CrmCalendarPanel.vue diff --git a/frontend/app/components/workspace/CrmWorkspaceApp.vue b/frontend/app/components/workspace/CrmWorkspaceApp.vue index 4d9d2ee..374354b 100644 --- a/frontend/app/components/workspace/CrmWorkspaceApp.vue +++ b/frontend/app/components/workspace/CrmWorkspaceApp.vue @@ -2,6 +2,7 @@ import { nextTick, onBeforeUnmount, onMounted } from "vue"; import CrmAuthLoading from "~~/app/components/workspace/auth/CrmAuthLoading.vue"; import CrmAuthLoginForm from "~~/app/components/workspace/auth/CrmAuthLoginForm.vue"; +import CrmCalendarPanel from "~~/app/components/workspace/calendar/CrmCalendarPanel.vue"; import CrmDocumentsPanel from "~~/app/components/workspace/documents/CrmDocumentsPanel.vue"; import CrmWorkspaceTopbar from "~~/app/components/workspace/header/CrmWorkspaceTopbar.vue"; import CrmPilotSidebar from "~~/app/components/workspace/pilot/CrmPilotSidebar.vue"; @@ -2364,6 +2365,41 @@ const calendarZoomOverlayRef = ref(null); const calendarHoveredMonthIndex = ref(null); const calendarHoveredWeekStartKey = ref(""); const calendarHoveredDayKey = ref(""); + +function setCalendarContentWrapRef(element: HTMLElement | null) { + calendarContentWrapRef.value = element; +} + +function setCalendarContentScrollRef(element: HTMLElement | null) { + calendarContentScrollRef.value = element; +} + +function setCalendarSceneRef(element: HTMLElement | null) { + calendarSceneRef.value = element; +} + +function setCalendarZoomOverlayRef(element: HTMLElement | null) { + calendarZoomOverlayRef.value = element; +} + +function setCalendarHoveredMonthIndex(value: number | null) { + calendarHoveredMonthIndex.value = value; +} + +function setCalendarHoveredWeekStartKey(value: string) { + calendarHoveredWeekStartKey.value = value; +} + +function setCalendarHoveredDayKey(value: string) { + calendarHoveredDayKey.value = value; +} + +function onCalendarSceneMouseLeave() { + calendarHoveredMonthIndex.value = null; + calendarHoveredWeekStartKey.value = ""; + calendarHoveredDayKey.value = ""; + clearCalendarZoomPrime(); +} const calendarZoomOverlay = ref<{ active: boolean } & CalendarRect>({ active: false, left: 0, @@ -4820,250 +4856,57 @@ async function decideFeedCard(card: FeedCard, decision: "accepted" | "rejected") class="min-h-0 flex-1" :class="selectedTab === 'documents' || (selectedTab === 'communications' && peopleLeftMode === 'contacts') ? 'px-0 pt-0 pb-0' : 'px-3 pt-3 pb-0 md:px-4 md:pt-4 md:pb-0'" > -
- {{ contextScopeLabel('calendar') }} -
-
- -
- -
- {{ calendarPeriodLabel }} -
- -
- - -
-
- -
-

Review focus event

-

{{ focusedCalendarEvent.title }}

-

- {{ formatDay(focusedCalendarEvent.start) }} · {{ formatTime(focusedCalendarEvent.start) }} - {{ formatTime(focusedCalendarEvent.end) }} -

-

{{ focusedCalendarEvent.note || "No note" }}

-
- -
- - -
-
-
-
-

{{ item.label }}

-

{{ item.count }} events

- - -
-
- Sun - Mon - Tue - Wed - Thu - Fri - Sat -
- -
-
-
- - -
-
-
-
- -
-
-
-
-

{{ day.label }} {{ day.day }}

-
-
- -

No events

-
-
-
-
- -
- -

No events on this day.

-
-
-
-
-
-
-
-

{{ calendarZoomGhost.title }}

-

{{ calendarZoomGhost.subtitle }}

-
-
-
-
+
@@ -6181,233 +6024,6 @@ async function decideFeedCard(card: FeedCard, decision: "accepted" | "rejected")