Consolidate category/project filters into a shared TaskFiltersContext + add List filter

Was duplicating categoryFilter/projectFilter useState + filter logic in every
view (Board/List/Today/Shared/Assigned/Dispatch). Moved to one global context
(same pattern as SearchContext) with a single <TaskFilterBar/> drop-in, and
added the missing List filter dimension on top.

List filter is deliberately omitted (showList=false) on ListView, Shared,
Assigned, and Dispatch -- ListView is already scoped to one list by its
route, and the other three show tasks whose list_id doesn't belong to the
viewer's own lists (shared tasks live in their owner's lists; assigned tasks
are always unfiled after transfer; dispatch is cross-user) -- filtering any
of them by "my lists" could only ever return zero results.
This commit is contained in:
jtricerolph 2026-09-17 18:39:26 +00:00
parent 4eab3c29ed
commit 3145c1fc07
9 changed files with 137 additions and 52 deletions

View file

@ -9,6 +9,7 @@ import { StatusesProvider } from './context/StatusesContext'
import { CategoriesProvider } from './context/CategoriesContext'
import { ProjectsProvider } from './context/ProjectsContext'
import { SearchProvider } from './context/SearchContext'
import { TaskFiltersProvider } from './context/TaskFiltersContext'
import { TaskDrawerProvider } from './components/TaskDrawer'
import TodayView from './pages/TodayView'
import ListView from './pages/ListView'
@ -30,23 +31,25 @@ export default function App() {
<CategoriesProvider>
<ProjectsProvider>
<SearchProvider>
<TaskDrawerProvider>
<Layout>
<Routes>
<Route path="/" element={<Navigate to="/today" replace />} />
<Route path="/today" element={<TodayView />} />
<Route path="/board" element={<BoardView />} />
<Route path="/list/:id" element={<ListView />} />
<Route path="/projects" element={<ProjectsView />} />
<Route path="/project/:id" element={<ProjectDetailView />} />
<Route path="/shared" element={<FilteredListView view="shared" title="Shared with me" />} />
<Route path="/assigned" element={<FilteredListView view="assigned" title="Assigned to me" />} />
<Route path="/dispatch" element={<DispatchView />} />
<Route path="/settings" element={<Settings />} />
<Route path="*" element={<Navigate to="/today" replace />} />
</Routes>
</Layout>
</TaskDrawerProvider>
<TaskFiltersProvider>
<TaskDrawerProvider>
<Layout>
<Routes>
<Route path="/" element={<Navigate to="/today" replace />} />
<Route path="/today" element={<TodayView />} />
<Route path="/board" element={<BoardView />} />
<Route path="/list/:id" element={<ListView />} />
<Route path="/projects" element={<ProjectsView />} />
<Route path="/project/:id" element={<ProjectDetailView />} />
<Route path="/shared" element={<FilteredListView view="shared" title="Shared with me" />} />
<Route path="/assigned" element={<FilteredListView view="assigned" title="Assigned to me" />} />
<Route path="/dispatch" element={<DispatchView />} />
<Route path="/settings" element={<Settings />} />
<Route path="*" element={<Navigate to="/today" replace />} />
</Routes>
</Layout>
</TaskDrawerProvider>
</TaskFiltersProvider>
</SearchProvider>
</ProjectsProvider>
</CategoriesProvider>