Repository navigation
feat(gantt): turn the Roadmap view into a full Gantt view - #757
Conversation
Add GET /projects/{projectId}/task-links?link_type=blocks, which returns
one page of the project's links of a single type, oldest first, with the
same (created_at, id) cursor as the per-task listing. The Gantt view
draws its dependency arrows from it with one request instead of one per
task.
A link is listed only when both of its tasks are live and readable by
the caller: the task scope attached by scopedContext narrows a CTE of
visible tasks that both ends join against, so a scoped member never
learns about a task outside their scope and a link to a deleted task
never shows up. Items carry only the two task ids and the link type, not
a summary of either task. link_type is required and validated; page_size
defaults to 100 and is capped at 500.
The repository is covered against Postgres (paging, deleted tasks,
other projects, scoped and deny-all callers, unmapped attributes).
Signed-off-by: Asish Kumar <[email protected]>
The timeline layout becomes a Gantt chart, so its view_type is renamed from "roadmap" to "gantt" (Paca-AI#748). - Migration 000090 moves every roadmap view to gantt with its config, position and personal overrides intact, renames a view only while it still has the seeded name "Roadmap", and swaps the CHECK constraint. - For one release the API still accepts "roadmap" on create and update and stores it as "gantt" (NormalizeViewType), so older clients and MCP servers keep working. The alias is unexported: it is never persisted or returned, and switches over ViewType need not list it. - New projects are seeded with a "Gantt" timeline view. - ViewConfig gains gantt_zoom (day, week, month, quarter or year) and gantt_dependencies (shown or hidden). Unknown values are dropped like an unknown subtask_mode, and both take part in the per-user merge and diff, so a zoom picked by one member stays theirs. Tests cover the alias on create and update, the new config values and their per-user overlay, and the migration against Postgres (run twice, config kept, a table view named "Roadmap" left alone, the constraint rejecting "roadmap" afterwards). The same e2e file exercises the task link listing over HTTP: link types, paging, a deleted task, a bad cursor and a caller outside the project. Signed-off-by: Asish Kumar <[email protected]>
Rename the Roadmap layout to Gantt (component, layout, seeded view, new-view option and i18n keys in all nine locales) and give it the core Gantt features from Paca-AI#748: - Zoom: a toolbar switches the scale between Day, Week, Month, Quarter and Year. The chosen zoom is saved to the user's view config (gantt_zoom) and the date in the middle of the chart stays put when the scale changes. "Today" scrolls back to the current date, and the chart opens centred on it. The header shows a coarse band (months or years) above one cell per step; gridlines are drawn once for all rows instead of per row. - Dependency arrows: "blocks" links between two shown bars are drawn from the blocker's end to the blocked task's start. A blocked task that starts on or before its blocker's due date gets a red arrow, an outlined bar and a tooltip naming the blocker. Links come from the new project link listing; bars are measured in the DOM so nested rows that load later are included. A "Dependency arrows" view setting (gantt_dependencies) hides them, and a link change refreshes them through the realtime event and the task detail's link mutations. - Drag to reschedule: people who can edit tasks drag a bar to move it or an end to change the start or due date. Changes snap to whole days, show the new range while dragging, and Escape cancels. The bar keeps its new dates until the saved task comes back (or snaps back with an error toast if the save fails), and a toast offers Undo. The save is the regular task update, so it lands in the activity feed and reaches other clients in real time. Without edit permission the chart is read-only. Dragging a row still reorders or regroups it. Dates are handled as whole UTC days (how Paca stores them) in a new gantt-scale module, which also holds the zoom, scale, bar, drag and arrow-routing logic with its own tests. Bars now span the due date inclusively. The saved task column width keeps its old storage key so nobody loses it. Signed-off-by: Asish Kumar <[email protected]>
create_view and update_view take viewType "gantt" for the timeline layout, which was called "roadmap" before (Paca-AI#748). The API still accepts "roadmap" for one release and stores it as "gantt". Signed-off-by: Asish Kumar <[email protected]>
Update the interaction-view and timeline features and specs for the Gantt layout name, view type and timeline subtitle, and add scenarios for the Gantt toolbar: every zoom level is offered with Week selected, a picked zoom is still selected after a reload, and "Today" is present. Signed-off-by: Asish Kumar <[email protected]>
Describe the Gantt view (zoom, dependency arrows and conflicts, drag to
reschedule, undo, permissions and the roadmap alias) and its
gantt_zoom / gantt_dependencies config in the interaction views guide.
List GET /projects/{projectId}/task-links in the HTTP design, replace
roadmap with gantt in the view type references and the schema notes,
and update the roadmap entry for the timeline view.
Signed-off-by: Asish Kumar <[email protected]>
There was a problem hiding this comment.
Important
One interaction bug in the new edge-resize path, plus a note on the rename across a rolling deploy. Everything else in this large PR holds up: the migration, the alias, the scoped link listing and the Gantt geometry all match their tests and the surrounding conventions.
Reviewed changes
roadmap→ganttview type — the constant/ValidViewTypeschange, theNormalizeViewTypealias on create/update, the DTO, the seeded timeline view, MCP enum/types and the clientViewType/ViewLayoutmaps.- Migration
000090— constraint swap,view_typerewrite, seeded-name rename, config preservation and idempotency. GET /projects/{projectId}/task-links— requiredlink_type, cursor paging, and the IAM-scopedvisibleCTE that lists a link only when both tasks are live and readable; handler/service/DTO, cached-service delegation.gantt-scale.ts— UTC day arithmetic, zoom units/range/scales, bar clamping, drag snapping, reschedule payloads, block-violation test and arrow routing.gantt-view.tsx— zoom + scroll centering, Today button, pointer drag for move/edges with optimistic spans, Escape cancel, undo toast and rollback, row drag/reorder preserved, DOM-measured dependency arrows, single-draw gridlines.- View settings / realtime / docs / e2e —
gantt_dependenciessetting withpickGanttDependencies,task.link.*invalidation of the project link listing, 9 locales, MCP CHANGELOG, API/architecture docs, renamed and new Playwright specs.
ℹ️ A rolling deploy can render Gantt views as tables until the bundle reloads
The write-side alias is handled, but the read path is not. Web and API ship as separate images (ghcr.io/paca-ai/paca-web), so they roll independently, and viewTypeToLayout falls through to "Table" for any unknown view_type. A new bundle that loads before the API migration renders old roadmap rows as tables, and an old bundle against the migrated API does the same with gantt rows — either way the Timeline silently degrades until a refresh. A one-release read alias (roadmap → Gantt) would make a web-first rollout harmless, since the only thing missing from the new bundle in that window is the task-links endpoint, which already fails soft (no arrows).
Technical details
# Read-path compatibility for the renamed view type
## Affected sites
- `apps/web/src/lib/interaction-api.ts:306-312` — `viewTypeToLayout` returns "Table" for "roadmap", so the previous API value is rendered as the Table layout.
- `apps/api/... migration 000090` runs at API startup; the Helm/compose web image can be rolled before or after it.
- `apps/web/src/lib/interaction-api.ts:1342-1366` — `listProjectTaskLinks` 404s against a pre-000090 API, and `ganttLinksQuery` just yields no data, so arrows are absent rather than erroring.
## Required outcome
- A new web bundle must keep rendering a `roadmap` row (and its subviews) as the Gantt layout for one release, mirroring the API's write-side alias.
- Optionally note the intended deploy order in the PR or docs so operators upgrade web first.
## Suggested approach (optional)
- Treat `"roadmap"` as a legacy read value alongside `"gantt"` in `viewTypeToLayout` (the API never returns it after 000090, so this only matters during the rollout window).
- No server change is needed; old web bundles cannot be fixed and will need a reload.deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Unmounting the handle that holds pointer capture when the bar shrank below the handle threshold dropped the drag, so it never committed or reverted. Keep the handles for the task being dragged and add a regression test. Signed-off-by: Asish Kumar <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the one commit pushed since the prior review.
- Edge-drag pointer capture —
renderChartCellnow keeps the resize handles mounted for the bar being dragged (isDragging || box.width >= MIN_RESIZABLE_PX), so the element holding implicit pointer capture survives a drag that shrinks the bar below 20px andpointerupstill reachesendBarDragto commit or revert. - Regression test — a new
gantt-view.test.tsxcase drags the start handle of a four-day bar at month zoom across one day (24px → 18px) and asserts the handle is still connected after the move and that the reschedule is saved.
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
Turns the Roadmap view into a full Gantt view and renames it from "Roadmap" to "Gantt" (closes #748). It covers the four core items in the issue. The optional follow-ups (critical path, milestones, roll-up bars, cascade shifting, baselines, export) are not included.
1. Rename Roadmap → Gantt
000090changesview_typeroadmap→ganttand swaps theCHECKconstraint. Views keep their config, position and personal overrides. A view still named "Roadmap" (the seeded name) is renamed "Gantt"; names people chose are left alone.roadmapon create and update and stores it asgantt(NormalizeViewType). The alias is never persisted or returned.gantt-view.tsx), seeded timeline view, new-view option and i18n keys are renamed in all 9 locales. The MCP view tools and types, Playwright specs/features and docs are updated too.2. Dependency arrows
blockslinks between two shown bars are drawn as arrows from the blocker's end to the blocked task's start.gantt_dependencies:shown/hidden) hides them.GET /projects/{projectId}/task-links?link_type=blocksreturns a project's links of one type with a cursor. This avoids one request per task. A link is listed only when the caller can read both of its tasks: the IAM task scope narrows the query, so scoped members don't learn about tasks outside their scope.task.link.*realtime events and the task detail's link mutations.3. Drag to reschedule
PATCH /tasks/{id}, which the router already gates withtasks:write. So the change appears in the activity feed and reaches other clients in real time. Without edit permission the chart is read-only. Dragging a row still reorders or regroups it.4. Zoom and navigation
gantt_zoom. Like other view settings it is per user. The date in the middle of the chart stays put when you zoom.Implementation notes:
gantt-scale.ts. It also holds the scale, bar, drag and arrow-routing logic. Bars now include the due date.Type of Change
Checklist
Testing
roadmapalias on create and update, normalising the Gantt config values, and their per-user overlay. The integration test checks thatroadmapis accepted and returned asgantt.roadmap) and the endpoint over HTTP (link types, paging, bad cursor, missing type, non-member).TestRealMigrations_ApplyCleanlyFromScratch, the full unit suite,go vetandgolangci-lint(0 issues) all pass.gantt-scale.test.tscovers dates, zoom, units, range, scale cells, bars, drag snapping, reschedule updates, conflict detection and arrow routing.gantt-view.test.tsxcovers zoom persistence, bar scaling, moving and edge drags, optimistic display and undo, error rollback, click vs drag, Escape, read-only mode, and arrows and conflicts. Also new:pick-gantt-dependencies.test.tsand the realtime rule test.tsc -b,biome check, the full vitest suite andvite buildpass. One existingGitSettingstest timed out once under machine load; it passes on its own.biome lint. I didn't run the full Playwright stack, since the e2e workflow is triggered manually.