Skip to content

feat(tasks): add Gantt timeline view for tasks#182

Open
paryanineil wants to merge 2 commits into
bwhtech:developfrom
paryanineil:feat/task-timeline-view
Open

feat(tasks): add Gantt timeline view for tasks#182
paryanineil wants to merge 2 commits into
bwhtech:developfrom
paryanineil:feat/task-timeline-view

Conversation

@paryanineil

Copy link
Copy Markdown
Contributor

Summary

Adds a Timeline (Gantt) view to the Tasks page, alongside List and Kanban. Each task is drawn as a horizontal bar spanning its start_datedue_date on a scrollable day axis, grouped by project.

Gantt timeline view

What's included

  • TaskTimeline component
    • Tasks grouped by project, one row each, with sticky task labels on the left
    • Status-colored bars positioned by start/due date (a task with only one date renders a single-day bar)
    • Today column highlighted on the axis
    • An "Unscheduled" tray lists tasks with no start/due date, so none are hidden
    • Clicking a bar opens the existing Task Details sheet
  • Timeline toggle added to the Tasks view switcher
  • Saveable view — adds timeline to Hive View.view_type; the mode is restored from saved views and the sidebar

Notes

  • Additive — no changes to List/Kanban behavior and no backend API changes. The one backend change is a new option on the existing Hive View.view_type Select field.
  • Existing task filters (status / priority / project / assignee) apply to the timeline.
  • Built with date-fns (already a dependency); no new packages.
  • Heads-up: touches the same view-switcher area as feat(tasks): add calendar view for tasks (month / week / day) #178 (calendar) — if that lands first I'm happy to rebase.

Testing

  • tsc --noEmit and ESLint clean on the changed files.
  • Verified in-browser on a seeded dataset (~77 tasks / 8 projects): bars render on the correct dates, group by project, scroll horizontally, today is highlighted, and clicking a bar opens the task sheet. No console errors.

@Rl0007

Rl0007 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

please add demo video and resolve the conflicts

Adds a Timeline view to the Tasks page, alongside List, Kanban and
Calendar. Each task is drawn as a horizontal bar spanning its start_date
-> due_date on a scrollable day axis, grouped by project.

- New TaskTimeline component: sticky task labels, status-colored bars,
  today highlighting, and an "Unscheduled" tray for tasks with no dates so
  none are hidden
- Timeline toggle button added to the Tasks view switcher
- Saveable as a named view: adds "timeline" to Hive View.view_type

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@paryanineil
paryanineil force-pushed the feat/task-timeline-view branch from 4c6a27d to e49b2ba Compare July 14, 2026 04:57
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown

Greptile Summary

Adds a Gantt-style Timeline view to the Tasks page, rendering each task as a horizontal bar spanning its start_datedue_date on a scrollable day axis grouped by project. The implementation is entirely additive — existing List, Kanban, and Calendar views are untouched.

  • TaskTimeline component: handles single-date tasks, reversed date ranges, tasks with no dates (shown in an "Unscheduled" tray), today-column highlighting, and status-coloured bars via TASK_STATUS_COLOR. The UTC date-parsing concern raised in review has been resolved with the parseLocalDate helper.
  • TasksPage integration: passes the pre-existing projectMap directly as projectTitles, avoiding a duplicate memo; the saved-view label, viewFiltersModified detection, and the save-dialog display all include the new "timeline" mode.
  • Schema/type changes: "timeline" is appended to the Frappe view_type Select field and to the HiveView.view_type TypeScript union.

Confidence Score: 5/5

Safe to merge — the change is purely additive with no modifications to existing views or backend APIs.

All four changed files introduce the new timeline mode without touching existing paths. The UTC date-parsing fix (T00:00:00 local-time literal) is correctly applied, the projectMap is reused without duplication, and edge cases (single-date tasks, reversed ranges, tasks without dates) are all handled. No issues were found beyond the DOM-node scalability note already raised in the prior review thread.

No files require special attention.

Important Files Changed

Filename Overview
frontend/src/components/TaskTimeline.tsx New Gantt component; UTC date-parsing bug addressed via parseLocalDate; logic for single-date tasks, reversed ranges, and unscheduled tasks all handled correctly
frontend/src/pages/TasksPage.tsx Adds timeline toggle and renders TaskTimeline with the pre-existing projectMap; no duplicate memo; view type label and saved-view logic updated correctly
frontend/src/types.ts Adds "timeline" to the HiveView.view_type union; straightforward additive change
bwh_hive/bwh_hive/doctype/hive_view/hive_view.json Appends "timeline" to the view_type Select options; additive and consistent with the frontend type change

Reviews (2): Last reviewed commit: "fix(timeline): parse date-only values as..." | Re-trigger Greptile

Comment thread frontend/src/components/TaskTimeline.tsx Outdated
Comment thread frontend/src/pages/TasksPage.tsx Outdated
Comment on lines +55 to +57
const rStart = minDate(scheduled.map((s) => s.start))
const rEnd = maxDate(scheduled.map((s) => s.end))
const allDays = eachDayOfInterval({ start: rStart, end: rEnd })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Unbounded DOM node count on wide date ranges

eachDayOfInterval returns one Date per day, and the render loop produces one div DOM node per entry in the header — no virtualisation. For a dataset where the earliest start_date and latest due_date span a year or more, the header alone generates 365+ nodes on every render. At 500 tasks (the query limit) covering different calendar years this is entirely realistic. Consider capping the visible window or switching to a virtual-scroll approach if performance becomes an issue.

Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/components/TaskTimeline.tsx
Line: 55-57

Comment:
**Unbounded DOM node count on wide date ranges**

`eachDayOfInterval` returns one `Date` per day, and the render loop produces one `div` DOM node per entry in the header — no virtualisation. For a dataset where the earliest `start_date` and latest `due_date` span a year or more, the header alone generates 365+ nodes on every render. At 500 tasks (the query limit) covering different calendar years this is entirely realistic. Consider capping the visible window or switching to a virtual-scroll approach if performance becomes an issue.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Left as-is for now: the axis spans only the min/max dates of the tasks currently in view (the page filters apply first), so in practice it is weeks-to-months rather than years, and a day cell is a single lightweight div. I would rather not add virtualisation complexity pre-emptively — happy to cap the window or switch to virtual scroll in a follow-up if you would prefer it hardened now.

🤖 Addressed by Claude Code

…tMap

Addresses review feedback:

- Date-only strings ("yyyy-MM-dd") were passed to `new Date()`, which V8
  parses as UTC midnight. For users west of UTC that resolved to the
  previous local day, shifting every bar one column to the left. Parse via
  an explicit local time component instead.
- Drop the redundant `projectTitles` memo and pass the pre-existing
  `projectMap` (same name -> title lookup) through to TaskTimeline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@paryanineil

Copy link
Copy Markdown
Contributor Author

@Rl0007 — demo video and conflicts both sorted 👇

Demo — Timeline view: bars spanning start_datedue_date on the day axis, grouped by project, horizontal scroll along the axis, and clicking a bar opening the Task Details sheet:

Timeline demo

Conflicts — resolved. #178 (calendar) landing on develop was the cause, since the timeline touches the same view-switcher. I rebased onto the updated develop, so List / Kanban / Calendar / Timeline now coexist. The PR shows MERGEABLE again.

Also pushed fixes for the two Greptile findings (local date parsing, and reusing the existing projectMap) — details on those threads.

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.

2 participants