List view 1/4: put the task filter in one place #87

Merged
CrowderSoup merged 1 commit from claude/list-view-1-filtering into main 2026-11-12 18:12:02 +00:00
CrowderSoup commented 2026-11-12 17:35:41 +00:00 (Migrated from github.com)

Stack for the list view (vTodo #369), 4 PRs. Review in order; each builds on the one before.

  1. This PR: one shared task filter (#382)
  2. Sort, grouping and "show done" in the filter (#383)
  3. The list page at /list/ (#384)
  4. Open to each person's chosen view, list by default (#385)

Summary

The person's task filter (tags, excluded tags, due window, search, collapsed lanes) was read from the session as a raw dict in seven views, and the matching logic was copied between the board and the calendar. It now lives in apps/boards/filtering.py as a frozen TaskFilter:

  • board_filter_for(board, session) / save_board_filter(request, board, f): the only way in and out of the session.
  • TaskFilter.from_config() cleans whatever is stored: blanks, repeats, an unknown due window and malformed lane keys are dropped.
  • apply() / matches(): the one implementation of the tag / due / search rules.
  • including_tag(), excluding_tag(), toggling_lane(): what the tag shortcuts and the lane collapse button did inline.
  • matching_saved_filter(): which saved view is selected, ignoring order.
  • lane_key / parse_lane_key and task_matches_column moved here too (Settings imported parse_lane_key from the views).

Behavior

No visible change. Two small differences:

  • Saved views are stored cleaned.
  • Junk in an old saved view (e.g. "due": "next_year") is ignored instead of counting as an active filter.

Test plan

  • DATABASE_URL=sqlite:///:memory: uv run pytest: 494 passed (14 new in test_filtering.py, browser tests included)
  • Existing board and calendar view tests pass unchanged, apart from one import path

🤖 Generated with Claude Code

**Stack for the list view (vTodo #369), 4 PRs.** Review in order; each builds on the one before. 1. **This PR**: one shared task filter (#382) 2. Sort, grouping and "show done" in the filter (#383) 3. The list page at `/list/` (#384) 4. Open to each person's chosen view, list by default (#385) ## Summary The person's task filter (tags, excluded tags, due window, search, collapsed lanes) was read from the session as a raw dict in seven views, and the matching logic was copied between the board and the calendar. It now lives in `apps/boards/filtering.py` as a frozen `TaskFilter`: - `board_filter_for(board, session)` / `save_board_filter(request, board, f)`: the only way in and out of the session. - `TaskFilter.from_config()` cleans whatever is stored: blanks, repeats, an unknown due window and malformed lane keys are dropped. - `apply()` / `matches()`: the one implementation of the tag / due / search rules. - `including_tag()`, `excluding_tag()`, `toggling_lane()`: what the tag shortcuts and the lane collapse button did inline. - `matching_saved_filter()`: which saved view is selected, ignoring order. - `lane_key` / `parse_lane_key` and `task_matches_column` moved here too (Settings imported `parse_lane_key` from the views). ## Behavior No visible change. Two small differences: - Saved views are stored cleaned. - Junk in an old saved view (e.g. `"due": "next_year"`) is ignored instead of counting as an active filter. ## Test plan - [x] `DATABASE_URL=sqlite:///:memory: uv run pytest`: 494 passed (14 new in `test_filtering.py`, browser tests included) - [x] Existing board and calendar view tests pass unchanged, apart from one import path 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.