Skip to content

feat(views): add a Calendar view type for sprint, backlog and timeline views - #834

Merged
pikann merged 2 commits into
Paca-AI:masterfrom
officialasishkumar:feat/calendar-view
Nov 28, 2026
Merged

pikann merged 2 commits into
Paca-AI:masterfrom
officialasishkumar:feat/calendar-view

Conversation

@officialasishkumar

Copy link
Copy Markdown
Contributor

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)

  • New view_type calendar. Migration 000099 widens the sprint_views.view_type CHECK constraint. It carries on from 000094 (which added note), so the roadmap name that 000090 retired stays out.
  • Two per-view config keys: calendar_mode (month, the default, week or day) and calendar_date_field (start_and_due, the default, start_date or due_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}/tasks takes scheduled_from / scheduled_to (inclusive YYYY-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=true keeps the tasks placed nowhere. scheduled_by (start_and_due, start_date, due_date) picks the dates that place a task.
  • With both dates, a task's span runs from LEAST(start_date, due_date) to GREATEST(...). Both functions skip a NULL, so a task with one date sits on that day, the same rule as Gantt. /tasks/count and /tasks/columns share the filter parser, so they accept these params too.
  • Bad dates, a scheduled_from after scheduled_to, an unknown scheduled_by, or unscheduled combined with a window are rejected with 400.

3. Rendering (web)

  • calendar-scale.ts holds 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 in gantt-scale.ts, because task dates are stored as UTC midnight.
  • calendar-view.tsx loads 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.
  • A collapsible No date panel lists the tasks without the dates the view uses, a page at a time, with a count in the toolbar.
  • The toolbar has previous / next, Today, and the Month / Week / Day switch. The chosen mode is saved per view, like the Gantt zoom.

4. Interaction (web)

  • Drag a task to another day to move it. Every date it has moves by the same number of days, so it keeps its length whichever date places it. In start_and_due mode, dragging a bar's edge changes only that date. Dropping a task from the No date panel onto a day dates it; in start_and_due mode it becomes a one-day task.
  • Saves go through the regular 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.
  • Click an empty part of a day, or its +, to create a task dated that day. The dates are now sent with the create request, so the task is never briefly undated.
  • Clicking a task opens the existing task detail panel.
  • Keyboard and a11y: the grid follows the ARIA grid pattern. One day is in the tab order. Arrow keys move between days, and moving off the edge turns the page. Home and End jump to the ends of the week, and Enter opens the add form on the focused day. Task bars are buttons.

5. Shared view behaviour

  • Filters, search, the task-type filter, sprint scope, the sprint's quick assignee filter and shared vs personal config all work as before. The view sends the same filters as the other layouts, narrowed to the window.
  • Grouping, sorting, sums, paging and fields don't apply to a grid of days. For Calendar the settings panel hides them and shows a Dates setting (calendar_date_field) instead.
  • New strings in all 9 locales.

Also included:

  • calendar added to the MCP create_view / update_view tools and types, with a changelog entry.
  • Docs: interaction-views.md (config keys and a Calendar view section), http-design.md (view types and the new task filters) and database-schema.md.
  • On the roadmap, the planned Calendar plugin is replaced by the built-in view, as the issue proposes.

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

  • Other (feature: Calendar view)

Checklist

  • The change is focused and scoped.
  • Related documentation is updated.
  • New structure or direction is explained clearly.
  • I avoided unnecessary detail or premature abstraction.

Testing

  • Go:
    • Unit tests cover creating Calendar views in every context, turning a table view into a calendar, dropping unknown calendar_mode / calendar_date_field values, and their per-user overlay.
    • Also covered: the schedule filter's SQL for each date field and for windows open at either end, and its parameter parsing, including every 400 case.
    • New e2e tests (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 migration 000099 can run again.
    • gofmt, go vet and the unit and integration tests of the touched packages pass locally. The e2e tests need the testcontainers stack, so they run in CI.
  • Web:
    • calendar-scale.test.ts covers 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.tsx covers 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.
    • Also new: 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.
  • MCP: biome and tsc pass.
  • Playwright: a new calendar-views spec covers creating the view from the popover, rescheduling by drag (skipped on mobile) and mode persistence across a reload. It passes biome lint. I didn't run the Playwright stack, since that workflow is triggered manually.

…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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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): calendar added to ViewType/ValidViewTypes, migration 000099 widens the sprint_views.view_type check (same drop/re-add pattern as 000094), and calendar_mode / calendar_date_field are 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_by parse and validate in parseScheduleFilter (400s for bad dates, inverted window, unknown scheduled_by, unscheduled with a window); applyScheduleFilter uses LEAST/GREATEST(start_date, due_date) so a task spanning the window matches and a one-date task sits on that day. /tasks/count and /tasks/columns share the parser, and task dates are DATE columns, so the string comparisons are sound.
  • Grid geometry: calendar-scale.ts builds 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.tsx loads 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: isCalendarView disables the task queries, column queries and API columns a grid of days has no use for; calendarTaskFilters drops 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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: edgesAvailable no longer requires drag === null, so a bar's start/end handles stay mounted while it is dragged. Releasing outside a day cell or pressing Esc now delivers dragend to endDrag, so chips stay clickable, the grabbed bar un-dims and dragRef is cleared before any later drop.
  • Regression test for the stuck state: a startDragging helper plus a test that starts an edge drag, releases it, asserts the chip is interactive again, and asserts a following drop reschedules nothing. dropOnDay already calls endDrag first, so the trailing dragend is idempotent.
  • Lint: the sprint handler test's exhaustive ViewType switch now lists ViewTypeCalendar.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution! 🚀

@pikann
pikann merged commit a640b36 into Paca-AI:master Nov 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Calendar view type for sprint, backlog and timeline views

2 participants