From b6d569a19e5b1be402ab5b86db446a93ac2fe3e6 Mon Sep 17 00:00:00 2001 From: nathantew14 Date: Thu, 11 Dec 2025 19:29:08 +0700 Subject: [PATCH 01/14] Allow navigating to specific visit without automatically switching to the latest one --- src/components/NavigationButtons.tsx | 6 ++---- src/components/VisitDropdown.tsx | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/NavigationButtons.tsx b/src/components/NavigationButtons.tsx index 81fb9c2..db0eb5d 100644 --- a/src/components/NavigationButtons.tsx +++ b/src/components/NavigationButtons.tsx @@ -14,10 +14,9 @@ export function VitalsButton({ labelOverwrite?: string; visitId?: string; }) { - console.log(visitId) return ( e.stopPropagation()} onMouseEnter={e => { e.stopPropagation(); @@ -41,10 +40,9 @@ export function ConsultationButton({ labelOverwrite?: string; visitId?: string; }) { - console.log(visitId) return ( e.stopPropagation()} onMouseEnter={e => { e.stopPropagation(); diff --git a/src/components/VisitDropdown.tsx b/src/components/VisitDropdown.tsx index 3a1cf1f..96cecce 100644 --- a/src/components/VisitDropdown.tsx +++ b/src/components/VisitDropdown.tsx @@ -46,8 +46,10 @@ export function VisitDropdown({ searchParams.get('visit') ?? '' ); + // automatically select the latest visit unless viewing a specific visit useEffect(() => { - setVisitId(items[0].value) + const viewingSpecificVisit = searchParams.get("specificVisit") === "true" + if (!viewingSpecificVisit) setVisitId(items[0].value) // eslint-disable-next-line react-hooks/exhaustive-deps }, []) From 2da509fe61ce50b4eab54fc5e992bbddeb224f01 Mon Sep 17 00:00:00 2001 From: nathantew14 Date: Thu, 11 Dec 2025 19:53:44 +0700 Subject: [PATCH 02/14] Improve visual consistency for PatientInfoHeaderSection buttons --- src/components/NavigationButtons.tsx | 16 ++++++++++++++-- .../records/document/UploadDocument.tsx | 6 +++--- src/components/records/document/ViewDocument.tsx | 6 +++--- src/components/records/patient/EditPatient.tsx | 6 +++--- .../records/patient/PatientInfoHeaderSection.tsx | 4 +++- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/components/NavigationButtons.tsx b/src/components/NavigationButtons.tsx index db0eb5d..e1eaff1 100644 --- a/src/components/NavigationButtons.tsx +++ b/src/components/NavigationButtons.tsx @@ -8,11 +8,13 @@ export function VitalsButton({ setIsHovered = () => {}, labelOverwrite, visitId, + className, }: { patient: Patient; setIsHovered?: Dispatch>; labelOverwrite?: string; visitId?: string; + className?: string; }) { return ( setIsHovered(true)} > -