From 05d04c131ed9756cabca05ed89e8a85396668542 Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Wed, 25 Feb 2026 23:30:02 +0800 Subject: [PATCH] Always show search input in CategoryFilterBar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the collapsible search behavior that hid the input behind an icon when ≥4 categories existed. Search should always be visible and match the standard header pattern (w-52 input with icon). Co-Authored-By: Claude Opus 4.6 --- .../components/shared/CategoryFilterBar.tsx | 49 +++++-------------- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/frontend/src/components/shared/CategoryFilterBar.tsx b/frontend/src/components/shared/CategoryFilterBar.tsx index bc00140..bee958d 100644 --- a/frontend/src/components/shared/CategoryFilterBar.tsx +++ b/frontend/src/components/shared/CategoryFilterBar.tsx @@ -118,7 +118,6 @@ export default function CategoryFilterBar({ onSearchChange, }: CategoryFilterBarProps) { const [otherOpen, setOtherOpen] = useState(false); - const [searchCollapsed, setSearchCollapsed] = useState(false); const searchInputRef = useRef(null); const isAllActive = activeFilters.length === 0; @@ -129,16 +128,6 @@ export default function CategoryFilterBar({ useSensor(PointerSensor, { activationConstraint: { distance: 5 } }), ); - // Collapse search if there are many categories - useEffect(() => { - setSearchCollapsed(categories.length >= 4); - }, [categories.length]); - - const handleExpandSearch = () => { - setSearchCollapsed(false); - setTimeout(() => searchInputRef.current?.focus(), 50); - }; - const handleDragEnd = (event: DragEndEvent) => { const { active, over } = event; if (!over || active.id === over.id || !onReorderCategories) return; @@ -254,32 +243,18 @@ export default function CategoryFilterBar({
{/* Search */} - {searchCollapsed ? ( - - ) : ( -
- - onSearchChange(e.target.value)} - onBlur={() => { - if (!searchValue && categories.length >= 4) setSearchCollapsed(true); - }} - className="w-44 h-8 pl-8 text-sm ring-inset" - aria-label="Search" - /> -
- )} +
+ + onSearchChange(e.target.value)} + className="w-52 h-8 pl-8 text-sm" + aria-label="Search" + /> +
); }