fix: tasks filters not applied on tab re-entry (closes #49)

render() always fetched /tasks without query params, so active filter
chips appeared selected but all tasks were shown after navigating away
and back. Fixed by building the same filter query in render() that
loadTasks() uses, keeping both parallel fetches and correct filtering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ulas Kalayci
2026-04-19 07:23:46 +02:00
parent 3c2a2fe6e9
commit 39fd25eafc
3 changed files with 14 additions and 3 deletions
+5
View File
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.20.12] - 2026-04-19
### Fixed
- Tasks: active filters are now correctly re-applied when navigating away from and back to the Tasks tab. Previously the filter chip appeared active but all tasks were shown, because the initial data fetch in `render()` always called `/tasks` without query parameters, ignoring the persisted `state.filters`. Fixed by building the filter query in `render()` the same way `loadTasks()` does, so the first fetch already respects the current filter state (closes #49)
## [0.20.11] - 2026-04-19
### Fixed
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "oikos",
"version": "0.20.11",
"version": "0.20.12",
"description": "Self-hosted family planner - calendar, tasks, shopping, meal planning, budget and more. Private, open-source, no subscription.",
"main": "server/index.js",
"type": "module",
+8 -2
View File
@@ -1163,10 +1163,16 @@ export async function render(container, { user }) {
if (window.lucide) window.lucide.createIcons();
// Daten laden
// Daten laden (Filter-State aus vorheriger Session berücksichtigen)
try {
const params = new URLSearchParams();
if (state.filters.status) params.set('status', state.filters.status);
if (state.filters.priority) params.set('priority', state.filters.priority);
if (state.filters.assigned_to) params.set('assigned_to', state.filters.assigned_to);
const query = params.toString() ? `?${params}` : '';
const [tasksData, metaData] = await Promise.all([
api.get('/tasks'),
api.get(`/tasks${query}`),
api.get('/tasks/meta/options'),
]);
state.tasks = tasksData.data ?? [];