From 1e048648ce4d0652457ba5676c47612ba5cf9a21 Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Fri, 30 Jan 2026 15:07:24 +0100 Subject: [PATCH] feat: add tooltip for disabled Cancel button on past bookings (#27431) * feat: Add tooltip for disabled Cancel button on past bookings Show a tooltip explaining "You cannot cancel a past booking" when hovering over the disabled Cancel dropdown item for bookings that have already occurred. Co-Authored-By: Claude Haiku 4.5 * refactor: Extract tooltip condition into named variable Improves readability by extracting the tooltip open condition into a descriptive variable `showPastBookingCancelTooltip`. Co-Authored-By: Claude Haiku 4.5 --------- Co-authored-by: Claude Haiku 4.5 --- .../actions/BookingActionsDropdown.tsx | 45 +++++++++++-------- apps/web/public/static/locales/en/common.json | 1 + 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/apps/web/components/booking/actions/BookingActionsDropdown.tsx b/apps/web/components/booking/actions/BookingActionsDropdown.tsx index be7ccbbcb6..3bea40af9f 100644 --- a/apps/web/components/booking/actions/BookingActionsDropdown.tsx +++ b/apps/web/components/booking/actions/BookingActionsDropdown.tsx @@ -19,6 +19,7 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@calcom/ui/components/dropdown"; +import { Tooltip } from "@calcom/ui/components/tooltip"; import type { ActionType } from "@calcom/ui/components/table"; import { showToast } from "@calcom/ui/components/toast"; @@ -259,6 +260,7 @@ export function BookingActionsDropdown({ } as BookingActionContext; const cancelEventAction = getCancelEventAction(actionContext); + const showPastBookingCancelTooltip = isBookingInPast && cancelEventAction.disabled; // Get pending actions (accept/reject) - only for details context const shouldShowPending = shouldShowPendingActions(actionContext); @@ -745,25 +747,30 @@ export function BookingActionsDropdown({ )} - - { - e.stopPropagation(); - setIsCancelDialogOpen(true); - }} - disabled={cancelEventAction.disabled} - data-booking-uid={cancelEventAction.bookingUid} - data-testid={cancelEventAction.id} - className={cancelEventAction.disabled ? "text-muted" : undefined}> - {cancelEventAction.label} - - + + + { + e.stopPropagation(); + setIsCancelDialogOpen(true); + }} + disabled={cancelEventAction.disabled} + data-booking-uid={cancelEventAction.bookingUid} + data-testid={cancelEventAction.id} + className={cancelEventAction.disabled ? "text-muted" : undefined}> + {cancelEventAction.label} + + + diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index ed945c431f..b8b484ef04 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -509,6 +509,7 @@ "cancellation_successful": "Cancellation successful", "really_cancel_booking": "Really cancel your booking?", "cannot_cancel_booking": "You cannot cancel this booking", + "cannot_cancel_past_booking": "You cannot cancel a past booking", "reschedule_instead": "Instead, you could also reschedule it.", "event_is_in_the_past": "The event is in the past", "cancelling_event_recurring": "The event is one instance of a recurring event.",