From bd62b79d0cec434c5169bacd09cccef56271950f Mon Sep 17 00:00:00 2001 From: Riyadh Date: Tue, 7 Jul 2026 14:08:51 +0000 Subject: [PATCH] =?UTF-8?q?Collapsible=20booking=20cards=20in=20Protocol?= =?UTF-8?q?=20=E2=86=92=20Bookings=20list=20(Task=20#676)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original task: make the protocol booking-requests LIST cards collapsed by default, showing a compact summary and expanding full details only when opened; add numbering, show the booking reference, and highlight today's bookings green. Changes (artifacts/tx-os/src/pages/protocol.tsx): - renderBookingCard(b, index) now renders a collapsible card. Collapsed shows only: sequence number (1-based over the current/filtered list), title, room · date-time range, booking reference, status/public pills, and a chevron. - Summary header is a real - - - )} - {c?.canMutate && - (b.status === "pending" || b.status === "approved") && ( - - )} - {c?.canMutate && ( - <> - - - + {t(`protocol.status.${b.status}`)} + + + + + + {expanded && ( +
+
+ {b.requesterName && ( +
+ {t("protocol.bookings.requester")}: {b.requesterName} +
+ )} + {b.department && ( +
+ {t("protocol.bookings.department")}: {b.department} +
+ )} +
+ {t("protocol.bookings.meetingType")}:{" "} + {t(`protocol.bookings.meetingTypes.${b.meetingType}`)} +
+ {b.meetingType === "external" && b.requesterOrg && ( +
+ {t("protocol.bookings.entity")}: {b.requesterOrg} +
+ )} + {b.requesterPhone && ( +
+ {t("protocol.bookings.phone")}:{" "} + {b.requesterPhone} +
+ )} + {b.attendeeCount != null && ( +
+ {t("protocol.bookings.attendeeCount")}: {b.attendeeCount} +
+ )} + {b.purpose && ( +
+ {t("protocol.bookings.purpose")}: {b.purpose} +
+ )} + {b.keyAttendees && b.keyAttendees.length > 0 && ( +
+ + {t("protocol.bookings.keyAttendees")}: + +
    + {b.keyAttendees.map((a, i) => ( +
  • + {a.name} + {a.position ? ` — ${a.position}` : ""} ( + {t(`protocol.bookings.attendeeSides.${a.side}`)}) +
  • + ))} +
+
+ )} +
+
+ {c?.canApprove && b.status === "pending" && ( + <> + + + + )} + {c?.canMutate && + (b.status === "pending" || b.status === "approved") && ( + + )} + {c?.canMutate && ( + <> + + + + )} +
+
)} - - ); + ); + }; return (
@@ -1101,7 +1155,7 @@ export default function ProtocolPage() { } return (
- {list.map((b) => renderBookingCard(b))} + {list.map((b, i) => renderBookingCard(b, i + 1))}
); })()