diff --git a/components/kanban/KanbanFilters.tsx b/components/kanban/KanbanFilters.tsx index df93b50..a1a932b 100644 --- a/components/kanban/KanbanFilters.tsx +++ b/components/kanban/KanbanFilters.tsx @@ -26,7 +26,7 @@ interface KanbanFiltersProps { } export function KanbanFilters({ filters, onFiltersChange }: KanbanFiltersProps) { - const { tags: availableTags, tasks } = useTasksContext(); + const { tags: availableTags, regularTasks } = useTasksContext(); const [isExpanded, setIsExpanded] = useState(false); const [isSortExpanded, setIsSortExpanded] = useState(false); const sortDropdownRef = useRef(null); @@ -117,19 +117,19 @@ export function KanbanFilters({ filters, onFiltersChange }: KanbanFiltersProps) const priorityCounts = useMemo(() => { const counts: Record = {}; getAllPriorities().forEach(priority => { - counts[priority.key] = tasks.filter(task => task.priority === priority.key).length; + counts[priority.key] = regularTasks.filter(task => task.priority === priority.key).length; }); return counts; - }, [tasks]); + }, [regularTasks]); // Calculer les compteurs pour les tags const tagCounts = useMemo(() => { const counts: Record = {}; availableTags.forEach(tag => { - counts[tag.name] = tasks.filter(task => task.tags?.includes(tag.name)).length; + counts[tag.name] = regularTasks.filter(task => task.tags?.includes(tag.name)).length; }); return counts; - }, [tasks, availableTags]); + }, [regularTasks, availableTags]); const priorityOptions = getAllPriorities().map(priorityConfig => ({ value: priorityConfig.key, diff --git a/src/contexts/TasksContext.tsx b/src/contexts/TasksContext.tsx index 064616e..40e7413 100644 --- a/src/contexts/TasksContext.tsx +++ b/src/contexts/TasksContext.tsx @@ -10,7 +10,8 @@ import { KanbanFilters } from '@/components/kanban/KanbanFilters'; import { sortTasks, getSortOption, DEFAULT_SORT, createSortKey } from '@/lib/sort-config'; interface TasksContextType { - tasks: Task[]; + tasks: Task[]; // Toutes les tâches + regularTasks: Task[]; // Tâches sans les épinglées (pour Kanban) stats: { total: number; completed: number; @@ -175,6 +176,7 @@ export function TasksProvider({ children, initialTasks, initialStats, initialTag const contextValue: TasksContextType = { ...tasksState, + regularTasks, tags, tagsLoading, tagsError,