From a9c125c21c289a69b31bb9db74cf608be365bc88 Mon Sep 17 00:00:00 2001 From: Hardik Date: Sun, 31 May 2026 02:19:32 +0530 Subject: [PATCH] fix(searchable-select): compact mode dropdown positioning and group labels - Compact dropdown is now right-anchored at fixed 380px width so it extends leftward from the trigger and doesn't overflow the table edge - Group headers in compact mode show only the sub-category (strip the top-level breadcrumb before the arrow) and are single-line truncated Co-Authored-By: Claude Sonnet 4.6 --- App/components/ui/searchable-select.tsx | 58 +++++++++++++++---------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/App/components/ui/searchable-select.tsx b/App/components/ui/searchable-select.tsx index b4ce4f1..d36e597 100644 --- a/App/components/ui/searchable-select.tsx +++ b/App/components/ui/searchable-select.tsx @@ -141,12 +141,16 @@ export function SearchableSelect({ - {/* Dropdown panel */} + {/* Dropdown panel + default: full-width anchored left + compact: fixed 380px anchored to right edge of trigger (won't overflow table) */} {open && (
{/* Search input */}
@@ -171,27 +175,33 @@ export function SearchableSelect({ {filtered.length === 0 ? (

No codes match "{query}"

) : ( - filtered.map((group) => ( -
- {/* Group header */} -
- {group.group} + filtered.map((group) => { + // In compact mode show only the sub-category (after ›), not the full breadcrumb + const groupLabel = isCompact && group.group.includes("›") + ? group.group.split("›").pop()!.trim() + : group.group; + return ( +
+ {/* Group header */} +
+ {groupLabel} +
+ {/* Items */} + {group.items.map((item) => ( + + ))}
- {/* Items */} - {group.items.map((item) => ( - - ))} -
- )) + ); + }) )}