From 82a47801458810d1fc6aa9ca56648dea7697ddcb Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Mon, 9 Feb 2026 10:39:34 -0500 Subject: [PATCH] feat: show routing trace dialog on assignment reason badge click (#27629) * feat: show routing trace dialog on assignment reason badge click Co-Authored-By: joe@cal.com * fix: remove duplicate RoutingTraceSheet rendering - Remove RoutingTraceSheet from BookingListItem.tsx to avoid duplicate rendering - Move RoutingTraceSheet in BookingActionsDropdown.tsx outside of isBookingFromRoutingForm condition - Use booking.assignmentReason.length > 0 condition for RoutingTraceSheet rendering - Remove unused isOpenRoutingTraceSheet getter and RoutingTraceSheet import from BookingListItem.tsx Co-Authored-By: joe@cal.com --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../components/booking/BookingListItem.tsx | 5 ++- .../actions/BookingActionsDropdown.tsx | 34 +++++++++---------- .../bookings/views/bookings-single-view.tsx | 12 ++++++- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index 49fa0f03c0..695f43f199 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -280,6 +280,9 @@ function BookingListItem(booking: BookingItemProps) { const setIsOpenWrongAssignmentDialog = useBookingActionsStoreContext( (state) => state.setIsOpenWrongAssignmentDialog ); + const setIsOpenRoutingTraceSheet = useBookingActionsStoreContext( + (state) => state.setIsOpenRoutingTraceSheet + ); const reportAction = getReportAction(actionContext); const reportActionWithHandler = { ...reportAction, @@ -549,7 +552,7 @@ function BookingListItem(booking: BookingItemProps) { userTimeZone={userTimeZone} isRescheduled={isRescheduled} onAssignmentReasonClick={ - isBookingFromRoutingForm ? () => setIsOpenWrongAssignmentDialog(true) : undefined + booking.assignmentReason.length > 0 ? () => setIsOpenRoutingTraceSheet(true) : undefined } /> {isBookingFromRoutingForm && ( diff --git a/apps/web/components/booking/actions/BookingActionsDropdown.tsx b/apps/web/components/booking/actions/BookingActionsDropdown.tsx index 3bea40af9f..c0892c0815 100644 --- a/apps/web/components/booking/actions/BookingActionsDropdown.tsx +++ b/apps/web/components/booking/actions/BookingActionsDropdown.tsx @@ -455,23 +455,23 @@ export function BookingActionsDropdown({ status={getBookingStatus()} /> {isBookingFromRoutingForm && ( - <> - - - + + )} + {booking.assignmentReason.length > 0 && ( + )} {booking.paid && booking.payment[0] && ( (defaultRating); const [isFeedbackSubmitted, setIsFeedbackSubmitted] = useState(false); + const [isRoutingTraceSheetOpen, setIsRoutingTraceSheetOpen] = useState(false); const mutation = trpc.viewer.public.submitRating.useMutation({ onSuccess: async () => { @@ -773,7 +775,10 @@ export default function Success(props: PageProps) { <>
{t("assignment_reason")}
- + setIsRoutingTraceSheetOpen(true)}> {t( assignmentReasonBadgeTitleMap( bookingInfo.assignmentReason[0].reasonEnum as AssignmentReasonEnum @@ -785,6 +790,11 @@ export default function Success(props: PageProps) { {bookingInfo.assignmentReason[0].reasonString}

)} +
)}