From fb786c4c3add032202132dfb36eb2458e332b6c1 Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov Date: Wed, 4 Mar 2026 22:11:07 +0300 Subject: [PATCH] refactor: remove haptic feedback triggers from calendar and duty components - Eliminated triggerHapticLight calls from CalendarPage, CalendarDay, DayDetail, and DutyTimelineCard components to streamline user interaction. - This change focuses on improving performance and reducing unnecessary feedback in the user interface. --- webapp-next/src/components/CalendarPage.tsx | 3 --- webapp-next/src/components/calendar/CalendarDay.tsx | 2 -- webapp-next/src/components/day-detail/DayDetail.tsx | 2 -- webapp-next/src/components/duty/DutyTimelineCard.tsx | 3 --- 4 files changed, 10 deletions(-) diff --git a/webapp-next/src/components/CalendarPage.tsx b/webapp-next/src/components/CalendarPage.tsx index 3cee0d6..014178c 100644 --- a/webapp-next/src/components/CalendarPage.tsx +++ b/webapp-next/src/components/CalendarPage.tsx @@ -17,7 +17,6 @@ import { CalendarGrid } from "@/components/calendar/CalendarGrid"; import { DutyList } from "@/components/duty/DutyList"; import { DayDetail, type DayDetailHandle } from "@/components/day-detail"; import { ErrorState } from "@/components/states/ErrorState"; -import { triggerHapticLight } from "@/lib/telegram-haptic"; /** Fallback height (px) until ResizeObserver reports the sticky block size. Matches --calendar-block-min-height + pb-2 (260 + 8). */ const STICKY_HEIGHT_FALLBACK_PX = 268; @@ -91,12 +90,10 @@ export function CalendarPage({ isAllowed, initDataRaw }: CalendarPageProps) { const navDisabled = loading || accessDenied || selectedDay !== null; const handlePrevMonth = useCallback(() => { if (navDisabled) return; - triggerHapticLight(); prevMonth(); }, [navDisabled, prevMonth]); const handleNextMonth = useCallback(() => { if (navDisabled) return; - triggerHapticLight(); nextMonth(); }, [navDisabled, nextMonth]); diff --git a/webapp-next/src/components/calendar/CalendarDay.tsx b/webapp-next/src/components/calendar/CalendarDay.tsx index cd96d08..877d794 100644 --- a/webapp-next/src/components/calendar/CalendarDay.tsx +++ b/webapp-next/src/components/calendar/CalendarDay.tsx @@ -9,7 +9,6 @@ import React, { useMemo } from "react"; import { useTranslation } from "@/i18n/use-translation"; import { dateKeyToDDMM } from "@/lib/date-utils"; import { cn } from "@/lib/utils"; -import { triggerHapticLight } from "@/lib/telegram-haptic"; import type { DutyWithUser } from "@/types"; import { DayIndicators } from "./DayIndicators"; @@ -90,7 +89,6 @@ function CalendarDayInner({ )} onClick={(e) => { if (isOtherMonth) return; - triggerHapticLight(); onDayClick(dateKey, e.currentTarget.getBoundingClientRect()); }} > diff --git a/webapp-next/src/components/day-detail/DayDetail.tsx b/webapp-next/src/components/day-detail/DayDetail.tsx index 037c5f9..f9ab239 100644 --- a/webapp-next/src/components/day-detail/DayDetail.tsx +++ b/webapp-next/src/components/day-detail/DayDetail.tsx @@ -27,7 +27,6 @@ import { DayDetailContent } from "./DayDetailContent"; import type { CalendarEvent, DutyWithUser } from "@/types"; import { cn } from "@/lib/utils"; import { useAppStore } from "@/store/app-store"; -import { triggerHapticLight } from "@/lib/telegram-haptic"; /** Empty state for day detail: date and "no duties or events" message. */ function DayDetailEmpty({ dateKey }: { dateKey: string }) { @@ -121,7 +120,6 @@ export const DayDetail = React.forwardRef( /** Start close animation; actual unmount happens in onCloseAnimationEnd (or fallback timeout). */ const requestClose = React.useCallback(() => { - triggerHapticLight(); setExiting(true); }, []); diff --git a/webapp-next/src/components/duty/DutyTimelineCard.tsx b/webapp-next/src/components/duty/DutyTimelineCard.tsx index daefe76..e027172 100644 --- a/webapp-next/src/components/duty/DutyTimelineCard.tsx +++ b/webapp-next/src/components/duty/DutyTimelineCard.tsx @@ -13,7 +13,6 @@ import { formatHHMM, } from "@/lib/date-utils"; import { cn } from "@/lib/utils"; -import { triggerHapticLight } from "@/lib/telegram-haptic"; import { ContactLinks } from "@/components/contact/ContactLinks"; import { Button } from "@/components/ui/button"; import type { DutyWithUser } from "@/types"; @@ -78,7 +77,6 @@ export function DutyTimelineCard({ const flipped = isControlled ? (isFlipped ?? false) : localFlipped; const handleFlipToBack = () => { - triggerHapticLight(); if (isControlled) { onFlipChange?.(true); } else { @@ -88,7 +86,6 @@ export function DutyTimelineCard({ }; const handleFlipToFront = () => { - triggerHapticLight(); if (isControlled) { onFlipChange?.(false); } else {