Add calendar view for tasks by due date #22

Closed
opened 2026-09-16 13:14:23 +00:00 by CrowderSoup · 0 comments
CrowderSoup commented 2026-09-16 13:14:23 +00:00 (Migrated from github.com)

Overview

Add a calendar view, parallel to the existing board view, that lays tasks out by due_date instead of status. Same underlying task data and filters as the board view — a different axis of organization, not a separate data model.

Scope & Routing

Mirrors board view exactly:

  • /calendar/ — personal calendar
  • /calendar/team/<id>/ — team calendar

New CalendarView, reusing board_tasks_qs(board) / visible_tasks_qs(user) from apps/tasks/selectors.py rather than duplicating query logic.

Layout

  • Month grid (5–6 rows × 7 columns), standard calendar layout.
  • "No due date" pane docked to the right of the grid: full task list (respecting active filters), draggable.
  • Filter bar (tags, exclude-tags, assignee, saved filters) reused from board view — same component, same session/SavedFilter persistence. Board's due-date filter is hidden/ignored in calendar mode since month navigation replaces it.

Day Cell Content

  • Each task renders as a compact row: small color dot (TaskStatus.color) + truncated title.
  • Tasks with due_time sort chronologically and show a HH:MM prefix; date-only tasks group together (e.g. top of cell, "all-day").
  • Overflow: show first N tasks, then +X more — click expands into a day popover/modal listing the rest.
  • Overdue (past due_date, not done): red/warning accent.
  • Done (is_done status): shown, visually muted (strikethrough/greyed) rather than hidden.

Interactions

  1. Drag to reschedule: dragging a task card to a different day updates due_date. New endpoint (e.g. POST /calendar/tasks/<pk>/reschedule/) analogous to the existing TaskMoveView; extend the hand-rolled DnD code in static/app.js (same dragstart/dragover/drop pattern used for board cards) rather than pulling in a library.
  2. Drag to/from the no-date pane: two-way. Drag a pane task onto a day → sets due_date. Drag a dated card into the pane → clears due_date (symmetric drop zones, same mental model as board columns).
  3. Quick-create: clicking empty space in a day cell opens the existing create-task panel/form with due_date pre-filled to that day.
  4. Click a task card: opens the existing task edit panel (same as board view), not a separate calendar-specific editor.

Navigation

  • Prev / Next / Today controls.
  • Current month reflected in URL query params (?year=2026&month=9) — bookmarkable, shareable, works with browser back/forward.

Explicitly out of scope for v1

  • Recurrence: recurrence_days/recurrence_from is ignored for calendar purposes — a recurring task shows only on its single due_date, no virtual/ghost occurrences.
  • Week view: month-only for v1; can be added as a second mode later without changing the underlying data/interaction model.

Implementation notes

  • Reuse the board's _task_matches_column-style filtering logic, but group by due_date instead of lane/status.
  • New templates: templates/calendar/calendar.html (page shell), templates/calendar/_grid.html (day cells), templates/calendar/_no_date_pane.html — reusing templates/partials/task_card.html where feasible (may need a slimmer calendar-specific card variant given cramped cell width).
  • due_time already exists on Task — no schema change needed for time-of-day sorting.

🤖 Generated with Claude Code

## Overview Add a calendar view, parallel to the existing board view, that lays tasks out by `due_date` instead of `status`. Same underlying task data and filters as the board view — a different axis of organization, not a separate data model. ## Scope & Routing Mirrors board view exactly: - `/calendar/` — personal calendar - `/calendar/team/<id>/` — team calendar New `CalendarView`, reusing `board_tasks_qs(board)` / `visible_tasks_qs(user)` from `apps/tasks/selectors.py` rather than duplicating query logic. ## Layout - **Month grid** (5–6 rows × 7 columns), standard calendar layout. - **"No due date" pane** docked to the right of the grid: full task list (respecting active filters), draggable. - Filter bar (tags, exclude-tags, assignee, saved filters) reused from board view — same component, same session/`SavedFilter` persistence. Board's due-date filter is hidden/ignored in calendar mode since month navigation replaces it. ## Day Cell Content - Each task renders as a compact row: small color dot (`TaskStatus.color`) + truncated title. - Tasks with `due_time` sort chronologically and show a `HH:MM` prefix; date-only tasks group together (e.g. top of cell, "all-day"). - **Overflow**: show first N tasks, then `+X more` — click expands into a day popover/modal listing the rest. - **Overdue** (past `due_date`, not done): red/warning accent. - **Done** (`is_done` status): shown, visually muted (strikethrough/greyed) rather than hidden. ## Interactions 1. **Drag to reschedule**: dragging a task card to a different day updates `due_date`. New endpoint (e.g. `POST /calendar/tasks/<pk>/reschedule/`) analogous to the existing `TaskMoveView`; extend the hand-rolled DnD code in `static/app.js` (same `dragstart`/`dragover`/`drop` pattern used for board cards) rather than pulling in a library. 2. **Drag to/from the no-date pane**: two-way. Drag a pane task onto a day → sets `due_date`. Drag a dated card into the pane → clears `due_date` (symmetric drop zones, same mental model as board columns). 3. **Quick-create**: clicking empty space in a day cell opens the existing create-task panel/form with `due_date` pre-filled to that day. 4. **Click a task card**: opens the existing task edit panel (same as board view), not a separate calendar-specific editor. ## Navigation - Prev / Next / Today controls. - Current month reflected in URL query params (`?year=2026&month=9`) — bookmarkable, shareable, works with browser back/forward. ## Explicitly out of scope for v1 - **Recurrence**: `recurrence_days`/`recurrence_from` is ignored for calendar purposes — a recurring task shows only on its single `due_date`, no virtual/ghost occurrences. - **Week view**: month-only for v1; can be added as a second mode later without changing the underlying data/interaction model. ## Implementation notes - Reuse the board's `_task_matches_column`-style filtering logic, but group by `due_date` instead of lane/status. - New templates: `templates/calendar/calendar.html` (page shell), `templates/calendar/_grid.html` (day cells), `templates/calendar/_no_date_pane.html` — reusing `templates/partials/task_card.html` where feasible (may need a slimmer calendar-specific card variant given cramped cell width). - `due_time` already exists on `Task` — no schema change needed for time-of-day sorting. --- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
CrowderSoup/vTodo#22
No description provided.