Repository navigation
feat(views): add a Calendar view type for sprint, backlog and timeline views - #834
Conversation
…e views Add a fourth built-in task layout, Calendar, next to Table, Board and Gantt. It shows tasks on a month, week or day grid so a team can see what lands on which day, and dragging a task to another day reschedules it. API - New view_type "calendar" (migration 000099 widens the view_type CHECK constraint, carrying on from 000094 and leaving the old "roadmap" out). - Two per-view config keys, normalised, merged and diffed like the Gantt ones so they work with shared and personal configs: calendar_mode (month, week, day) and calendar_date_field (start_and_due, start_date, due_date). Unknown values are dropped. - GET /tasks (and /tasks/count, /tasks/columns, which share the filter parser) takes scheduled_from / scheduled_to, keeping the tasks placed on at least one day of an inclusive window, so a task spanning the whole window matches even when neither of its dates is inside. unscheduled=true keeps the tasks placed nowhere. scheduled_by picks the dates that place a task. With both dates the span runs from LEAST to GREATEST of the two, so a task with one date sits on that day. Web - calendar-scale.ts holds the React-free date math (grids, first day of the week from the locale, placement, lane stacking, +N more), reusing the whole-UTC-day helpers of gantt-scale.ts. - calendar-view.tsx loads only the days on screen (every page of the window), keeps the previous window's tasks while the next one loads, and lists undated tasks in a "No date" panel. - Drag a task to another day: every date it has moves by the same number of days, so it keeps its length whichever date places it. With start and due dates, dragging a bar's edge changes only that date. Dropping an undated task on a day dates it. Saves show the new dates at once, roll back with an error when they fail, and offer an undo. - Click an empty part of a day, or its "+", to create a task dated that day; the dates now go with the create request. - ARIA grid with arrow-key navigation (off the edge turns the page), Home/End, and Enter to add on the focused day. - The view settings show a "Dates" setting for Calendar and hide the grouping, sorting, sums, paging and fields that don't apply. - New strings in all nine locales. Also adds the view type to the MCP view tools, documents the view, its config and the new task filters, and replaces the planned Calendar plugin on the roadmap with the built-in view. Tests: date math, settings helper and component tests (vitest), API client params, view service config handling, the filter's SQL and parameter parsing, API e2e tests for creating and configuring the view in every context and for each schedule filter, and a Playwright spec. Fixes Paca-AI#765
There was a problem hiding this comment.
Important
An edge-resize drag that ends outside a day cell (or is cancelled with Esc) leaves the calendar stuck and unclickable. Details inline.
Approach: sound — Calendar is a real layout over the existing task list rather than a plugin, and the new scheduled_* window filter keeps each view to the days on screen instead of loading the project's tasks.
Reviewed changes
- View type and config (API):
calendaradded toViewType/ValidViewTypes, migration000099widens thesprint_views.view_typecheck (same drop/re-add pattern as000094), andcalendar_mode/calendar_date_fieldare normalized, merged and diffed exactly like the Gantt keys, so shared vs personal config works. - Window filter on the task list:
scheduled_from/scheduled_to/unscheduled/scheduled_byparse and validate inparseScheduleFilter(400s for bad dates, inverted window, unknownscheduled_by,unscheduledwith a window);applyScheduleFilterusesLEAST/GREATEST(start_date, due_date)so a task spanning the window matches and a one-date task sits on that day./tasks/countand/tasks/columnsshare the parser, and task dates areDATEcolumns, so the string comparisons are sound. - Grid geometry:
calendar-scale.tsbuilds mode grids, takes the first weekday from the locale (with a CLDR-region fallback), places tasks per date field, packs week rows into lanes and computes+N more, reusing the Gantt's whole-UTC-day helpers. - Calendar rendering and interaction:
calendar-view.tsxloads every page of the visible window plus the undated tasks, keeps the previous window visible across navigation, shows optimistic dates with an undo toast and rollback, supports move/edge/schedule drags, quick add dated on create, month/week/day with per-view persistence, and an ARIA grid with roving tabindex. - Layout integration:
isCalendarViewdisables the task queries, column queries and API columns a grid of days has no use for;calendarTaskFiltersdrops paging/sort/subtask keys; task creation now sends dates with the create request instead of a follow-up update; the settings panel hides grouping/sort/fields/paging and shows the Dates select; page-size defaults, tab icon, sprint quick-assignee filter and all 9 locales were updated. - Tests and docs: unit tests for the geometry, the view and the picker, API unit/e2e tests for the view type, config overlay and every schedule-filter case, docs/roadmap updates, and a Playwright spec.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
A calendar bar's start and end handles unmounted as soon as a drag began. React never sees the dragend of a detached drag source, so an edge drag released outside a day cell, or cancelled with Escape, left the view mid-drag: bars stayed unclickable and a later drop on a day rescheduled the task. Keep the handles mounted; while dragging, the bar's pointer-events-none already lets drops reach the day under it. Also list the calendar view type in the sprint handler test's exhaustive switch so golangci-lint passes.
There was a problem hiding this comment.
✅ No new issues found.
Approach: unchanged, and the fix is the smaller of the two viable ones — keeping the drag source mounted instead of adding window-level dragend listeners, which closes the reported path without a second source of truth for drag state.
Reviewed changes — since the prior pullfrog review at bdaba8c, this run covered the one fix commit (d060e4d):
- Edge drags now always finish:
edgesAvailableno longer requiresdrag === null, so a bar's start/end handles stay mounted while it is dragged. Releasing outside a day cell or pressing Esc now deliversdragendtoendDrag, so chips stay clickable, the grabbed bar un-dims anddragRefis cleared before any later drop. - Regression test for the stuck state: a
startDragginghelper plus a test that starts an edge drag, releases it, asserts the chip is interactive again, and asserts a following drop reschedules nothing.dropOnDayalready callsendDragfirst, so the trailingdragendis idempotent. - Lint: the sprint handler test's exhaustive
ViewTypeswitch now listsViewTypeCalendar.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
pikann
left a comment
There was a problem hiding this comment.
LGTM! Thank you for the contribution! 🚀

Summary
Adds a fourth built-in task layout, Calendar, next to Table, Board and Gantt (fixes #765). It shows tasks on a month, week or day grid so a team can see what is due when. Dragging a task to another day reschedules it. It can be added in the Sprint, Backlog and Timeline contexts from the existing "Add view" popover.
1. View type and settings (API)
view_typecalendar. Migration000099widens thesprint_views.view_typeCHECK constraint. It carries on from000094(which addednote), so theroadmapname that000090retired stays out.calendar_mode(month, the default,weekorday) andcalendar_date_field(start_and_due, the default,start_dateordue_date). They are normalised, merged and diffed like the Gantt keys, so they work with shared and personal configs. Unknown values are dropped.2. Loading only the days on screen (API)
GET /projects/{projectId}/taskstakesscheduled_from/scheduled_to(inclusiveYYYY-MM-DD). These keep the tasks placed on at least one day of the window, so a task spanning the whole window matches even when neither of its dates falls inside it.unscheduled=truekeeps the tasks placed nowhere.scheduled_by(start_and_due,start_date,due_date) picks the dates that place a task.LEAST(start_date, due_date)toGREATEST(...). Both functions skip a NULL, so a task with one date sits on that day, the same rule as Gantt./tasks/countand/tasks/columnsshare the filter parser, so they accept these params too.scheduled_fromafterscheduled_to, an unknownscheduled_by, orunscheduledcombined with a window are rejected with400.3. Rendering (web)
calendar-scale.tsholds the React-free date math: grids per mode, the first day of the week from the user's locale, placement per date field, lane stacking, and the "+N more" overflow. It reuses the whole-UTC-day helpers ingantt-scale.ts, because task dates are stored as UTC midnight.calendar-view.tsxloads every page of the visible window. It keeps showing the previous window's tasks while the next one loads; they sit on their own dates. Multi-day tasks are bars that span their days in each week row. A crowded month day shows "+N more", which opens a popover listing all of that day's tasks. Month and weekday names come from the user's locale.4. Interaction (web)
start_and_duemode, dragging a bar's edge changes only that date. Dropping a task from the No date panel onto a day dates it; instart_and_duemode it becomes a one-day task.PATCH /tasks/{id}(tasks:write), using the same handler as the Gantt view. The new dates show right away. A failed save rolls back with an error, and the success toast offers Undo. Without edit permission the calendar is read-only.5. Shared view behaviour
calendar_date_field) instead.Also included:
calendaradded to the MCPcreate_view/update_viewtools and types, with a changelog entry.interaction-views.md(config keys and a Calendar view section),http-design.md(view types and the new task filters) anddatabase-schema.md.Out of scope, as in the issue: recurring tasks, iCal / Google Calendar export, time-of-day scheduling, and showing sprint start and end dates as events.
Type of Change
Checklist
Testing
calendar_mode/calendar_date_fieldvalues, and their per-user overlay.400case.calendar_view_test.go) create and configure the view in the sprint, backlog and timeline contexts. They run the schedule filter over tasks inside, spanning, overlapping and outside a window for each date field, and check that migration000099can run again.gofmt,go vetand the unit and integration tests of the touched packages pass locally. The e2e tests need the testcontainers stack, so they run in CI.calendar-scale.test.tscovers weekdays, the locale's first day of the week, month, week and day grids, paging between months, placement per date field, lane stacking, overflow and labels.calendar-view.test.tsxcovers loading the window with the view's filters, the undated query, navigation, mode persistence, multi-day placement, "+N more", moving and edge drags, keeping a task's length in single-date mode, optimistic display and undo, rollback on failure, scheduling undated tasks, read-only mode, quick add and keyboard navigation.pick-calendar-date-field.test.ts, and API client tests for the new params.tsc,biome check, and the vitest suites for the interaction components, the API client and the locales pass.biomeandtscpass.calendar-viewsspec covers creating the view from the popover, rescheduling by drag (skipped on mobile) and mode persistence across a reload. It passesbiome lint. I didn't run the Playwright stack, since that workflow is triggered manually.