List view 2/4: sort, grouping and "show done" in the task filter #88

Merged
CrowderSoup merged 1 commit from claude/list-view-2-sort-group into main 2026-11-12 18:13:39 +00:00
CrowderSoup commented 2026-11-12 17:35:53 +00:00 (Migrated from github.com)

Stack for the list view (vTodo #369). Based on #87.

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

Summary

This PR has the data and logic but no UI yet.

TaskFilter gains: show_done (default on), sort, sort_dir, group and collapsed_groups. They round-trip through the session and saved views, so a saved view keeps its layout. Old configs get the defaults.

Filters vs. layout:

  • Sort and grouping are layout. They hide nothing, so they don't count on the Filters badge.
  • The filter bar's form (Clear filters included) leaves the layout alone: with_filters_from(post).
  • The list's controls change only the layout: with_layout_from(post). Changing the grouping forgets which groups were collapsed.
  • show_done is a filter. The filter bar's form now carries it in a hidden input.

Per-view ignores: each view lists the fields it doesn't use (BOARD_IGNORES, CALENDAR_IGNORES, and LIST_IGNORES in the next PR). Those don't count toward its badge or toward which saved view is selected, on either side of the comparison. Before this, the calendar never showed a saved view as selected if it had a due window or a search.

apps/boards/listing.py:

  • Done tasks always go below open ones, in every group and in either sort direction.
  • Tasks with nothing to sort by (no due date, nobody assigned) go last in either direction.
  • Ties keep the board's order.
  • Due date sorts all-day before timed on the same date, as the calendar does.
  • Grouping by status (workflow order, then "No status"), assignee (you first, then by name, then "Unassigned"), due date (Overdue / Today / Next 7 days / Later / No due date / Done), tag (a task is in every one of its tags' groups, plus "Untagged"). Empty groups are left out.
  • When grouped by due date, done tasks get their own group so a finished task isn't listed as overdue.

Test plan

  • DATABASE_URL=sqlite:///:memory: uv run pytest: 517 passed (14 new in test_listing.py, 8 new in test_filtering.py, 3 new view tests for saved views keeping the layout)
  • makemigrations --check: no changes

🤖 Generated with Claude Code

**Stack for the list view (vTodo #369).** Based on #87. 1. #87 one shared task filter 2. **This PR**: sort, grouping and "show done" in the filter (#383) 3. The list page at `/list/` 4. Open to each person's chosen view, list by default ## Summary This PR has the data and logic but no UI yet. **`TaskFilter` gains:** `show_done` (default on), `sort`, `sort_dir`, `group` and `collapsed_groups`. They round-trip through the session and saved views, so **a saved view keeps its layout**. Old configs get the defaults. **Filters vs. layout:** - Sort and grouping are layout. They hide nothing, so they don't count on the Filters badge. - The filter bar's form (Clear filters included) leaves the layout alone: `with_filters_from(post)`. - The list's controls change only the layout: `with_layout_from(post)`. Changing the grouping forgets which groups were collapsed. - `show_done` is a filter. The filter bar's form now carries it in a hidden input. **Per-view ignores:** each view lists the fields it doesn't use (`BOARD_IGNORES`, `CALENDAR_IGNORES`, and `LIST_IGNORES` in the next PR). Those don't count toward its badge or toward which saved view is selected, on either side of the comparison. Before this, the calendar never showed a saved view as selected if it had a due window or a search. **`apps/boards/listing.py`:** - **Done tasks always go below open ones**, in every group and in either sort direction. - Tasks with nothing to sort by (no due date, nobody assigned) go last in either direction. - Ties keep the board's order. - Due date sorts all-day before timed on the same date, as the calendar does. - Grouping by **status** (workflow order, then "No status"), **assignee** (you first, then by name, then "Unassigned"), **due date** (Overdue / Today / Next 7 days / Later / No due date / **Done**), **tag** (a task is in every one of its tags' groups, plus "Untagged"). Empty groups are left out. - When grouped by due date, done tasks get their own group so a finished task isn't listed as overdue. ## Test plan - [x] `DATABASE_URL=sqlite:///:memory: uv run pytest`: 517 passed (14 new in `test_listing.py`, 8 new in `test_filtering.py`, 3 new view tests for saved views keeping the layout) - [x] `makemigrations --check`: no changes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.