From 31adbab87ba3cecfa4019175a732b93c7582acbf Mon Sep 17 00:00:00 2001 From: Khalid Abdi Date: Sat, 27 Jun 2026 22:16:12 +0300 Subject: [PATCH] frontend: fix pagination styling, patient-sheet header, message avatars - Patients pagination: render the prev/next + page-number controls as COSS Buttons inside the Pagination structure. PaginationLink drops its buttonVariants styling when given a `render` prop, so the controls were unstyled and wrapping; using Button restores proper pill/number buttons. - Patient detail sheet: move the action buttons (Download summary / Transfer / Edit / Delete) to their own wrapping row beneath the identity block so the patient name is no longer truncated on the narrow sheet. - Messages thread: add sender/recipient avatars (MessageAvatar) at the bottom of each message group, with a spacer to keep stacked bubbles aligned. Co-Authored-By: Claude Opus 4.8 --- .../components/messages/messages-view.tsx | 15 ++++++ .../components/patients/patient-detail.tsx | 51 ++++++++++--------- .../components/patients/patients-view.tsx | 44 ++++++++-------- 3 files changed, 63 insertions(+), 47 deletions(-) diff --git a/frontend/components/messages/messages-view.tsx b/frontend/components/messages/messages-view.tsx index ea07eff..6f7e04c 100644 --- a/frontend/components/messages/messages-view.tsx +++ b/frontend/components/messages/messages-view.tsx @@ -42,6 +42,7 @@ import { Bubble, BubbleContent } from "@/components/ui/bubble"; import { Button } from "@/components/ui/button"; import { Message, + MessageAvatar, MessageContent, MessageFooter, MessageHeader, @@ -200,6 +201,7 @@ export function MessagesView() { const { t } = useTranslation(); const { data: session } = authClient.useSession(); const myId = session?.user?.id ?? ""; + const myInitials = initials(session?.user?.name ?? ""); const router = useRouter(); @@ -694,6 +696,19 @@ export function MessagesView() { !newDay && (startsGroup ? "mt-4" : "mt-1"), )} > + {/* Avatar at the bottom of each run (messenger-style); a + spacer keeps stacked bubbles aligned otherwise. */} + {endsGroup ? ( + + + + {out ? myInitials : initials(m.senderName)} + + + + ) : ( +
+ )} {selected.isGroup && !out && startsGroup && ( {m.senderName} diff --git a/frontend/components/patients/patient-detail.tsx b/frontend/components/patients/patient-detail.tsx index c46d84b..3092611 100644 --- a/frontend/components/patients/patient-detail.tsx +++ b/frontend/components/patients/patient-detail.tsx @@ -238,31 +238,35 @@ export function PatientDetail({ return (
-
- - {patient.initials} - -
-
- - {patient.name} - - - {t(`patients.status.${patient.status}`)} - -
- {idLine} - {patient.alerts.length > 0 && ( -
- {patient.alerts.map((alert) => ( - - {alert} - - ))} +
+ {/* Identity — full width so the name never gets squeezed by the actions. */} +
+ + {patient.initials} + +
+
+ + {patient.name} + + + {t(`patients.status.${patient.status}`)} +
- )} + {idLine} + {patient.alerts.length > 0 && ( +
+ {patient.alerts.map((alert) => ( + + {alert} + + ))} +
+ )} +
-
+ {/* Actions — their own wrapping row beneath the identity. */} +
{pageWindow(safePage, totalPages).map((p, i) => p === null ? ( @@ -314,34 +310,34 @@ export function PatientsView() { ) : ( - setPage(p)} - render={ ) )} - setPage(Math.min(totalPages, safePage + 1))} - render={