From b6ee5ed7bf844eeec14aa6f7d25c9669b60e0689 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 24 Jun 2026 05:42:26 -0500 Subject: [PATCH] fix(drug-reference): make the interaction comparison readable at five drugs The comparison view laid its columns out on an equal-fraction CSS grid (repeat(N, minmax(0, 1fr))), so each added drug shrank every column; at the five-drug maximum the FDA interaction text was squeezed into unreadable slivers. Lay the columns out with flex instead: full-width and stacked on phones, then fixed-width columns that scroll sideways from the sm: breakpoint up, so they never shrink below a readable width. Theme the columns with the same palette as the rest of the page (they were on stock gray), and give the headers a fixed min-height so columns line up when drug names wrap. Co-Authored-By: Claude Opus 4.8 --- .../drug-reference/InteractionColumn.tsx | 22 +++++++++---------- .../pages/drug-reference/interactions.tsx | 13 +++++------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/admin/inertia/components/drug-reference/InteractionColumn.tsx b/admin/inertia/components/drug-reference/InteractionColumn.tsx index c13b96e..f167fb3 100644 --- a/admin/inertia/components/drug-reference/InteractionColumn.tsx +++ b/admin/inertia/components/drug-reference/InteractionColumn.tsx @@ -20,35 +20,35 @@ export default function InteractionColumn({ entry, onRemove }: Props) { const displayName = entry.brand_name ?? entry.generic_name ?? 'Unknown Drug' return ( -
- {/* Column header */} -
-
+
+ {/* Column header — fixed min-height so columns line up even when names wrap */} +
+
- + {displayName} {isRx && ( - + Rx )} {isOtc && ( - + OTC )}
{entry.brand_name && entry.generic_name && ( -

{entry.generic_name}

+

{entry.generic_name}

)}
@@ -56,11 +56,11 @@ export default function InteractionColumn({ entry, onRemove }: Props) {
{/* Label text, parsed into readable blocks (FDA wording kept verbatim). */} -
+
{entry.drug_interactions ? ( ) : ( -

+

No labeled interaction text on this label.

)} diff --git a/admin/inertia/pages/drug-reference/interactions.tsx b/admin/inertia/pages/drug-reference/interactions.tsx index ef0b025..691e279 100644 --- a/admin/inertia/pages/drug-reference/interactions.tsx +++ b/admin/inertia/pages/drug-reference/interactions.tsx @@ -268,14 +268,13 @@ export default function DrugReferenceInteractions({ ingestStatus, rowCount }: Pa

Loading…

) : ( -
+ // Stacked single-column on phones; fixed-min-width columns that + // scroll sideways (never crush) from sm: up, even at MAX_COMPARE. +
{entries.map((entry) => ( - +
+ +
))}
)}