From 70c095bc67684bbcf7e603800c7e5543bb01791b Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Mon, 23 Feb 2026 07:37:45 +0700 Subject: [PATCH] calendar: delay zoom-in content switch until end of morph --- frontend/app.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index c1b55b0..180919e 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -2287,6 +2287,12 @@ function waitCalendarZoom() { }); } +function waitMs(ms: number) { + return new Promise((resolve) => { + setTimeout(() => resolve(), ms); + }); +} + async function animateCalendarZoomIn(sourceElement: HTMLElement | null, apply: () => void) { const fromRect = getElementRectInCalendar(sourceElement); const viewportRect = getCalendarViewportRect(); @@ -2299,12 +2305,13 @@ async function animateCalendarZoomIn(sourceElement: HTMLElement | null, apply: ( calendarZoomBusy.value = true; try { primeCalendarRect(fromRect); + morphCalendarRect(viewportRect); + const switchLag = 260; + await waitMs(Math.max(0, CALENDAR_ZOOM_DURATION_MS - switchLag)); calendarSceneMasked.value = true; - await nextTick(); apply(); await nextTick(); - morphCalendarRect(viewportRect); - await waitCalendarZoom(); + await waitMs(switchLag); } finally { calendarSceneMasked.value = false; calendarZoomBusy.value = false;