From b05ff9651ae8d511eaa4a180c13bcd12b6986a41 Mon Sep 17 00:00:00 2001 From: Gabriel Menezes Date: Fri, 9 Oct 2026 09:45:55 -0400 Subject: [PATCH] feat(ui): make task filter bar collapsible --- frontend/src/components/TaskFilterBar.tsx | 49 ++++++++++++++++++----- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/TaskFilterBar.tsx b/frontend/src/components/TaskFilterBar.tsx index db6116f..c030641 100644 --- a/frontend/src/components/TaskFilterBar.tsx +++ b/frontend/src/components/TaskFilterBar.tsx @@ -1,4 +1,5 @@ -import { RefreshCw, Search } from 'lucide-react' +import { useState } from 'react' +import { RefreshCw, Search, Filter, ChevronDown, ChevronUp } from 'lucide-react' import { TASK_STATUS_LABELS, TASK_STATUS_OPTIONS, type TaskStatus } from '../types/task' import type { Project } from '../services/projectService' import type { Category } from '../types/category' @@ -36,9 +37,17 @@ export function TaskFilterBar({ isLoading, onRefresh, }: TaskFilterBarProps) { + const [isExpanded, setIsExpanded] = useState(false) + const update = (partial: Partial) => onFiltersChange({ ...filters, ...partial }) + const activeFiltersCount = + (filters.projectIds?.length || 0) + + (filters.statuses?.length || 0) + + (filters.categoryIds?.length || 0) + + (filters.userIds?.length || 0) + return (
@@ -56,18 +65,39 @@ export function TaskFilterBar({ />
- {onRefresh && ( +
- )} + + {onRefresh && ( + + )} +
-
+ {isExpanded && ( +
{projects.length > 0 && ( )} -
+
+ )} ) }