feat: add 5 PM features — custom statuses, Gantt, quick-add, automations, notifications

- Custom workflow statuses: per-project configurable status definitions
  replacing the fixed task_status enum. Each project defines its own
  workflow with drag-to-reorder, color coding, and category mapping.
- Gantt/timeline view: full project roadmap with task bars, dependency
  arrows, milestone diamonds, zoom levels (day/week/month), and drag
  to reschedule.
- Natural-language quick-add: NLP parser extracts dates, priorities,
  projects, labels, and recurrence from free text. Floating bar with
  'n' shortcut and live parsed preview.
- Automation rules: no-code trigger-action system per project. Triggers
  on status change, task creation, due date approaching. Actions set
  status/priority, add labels, create notifications.
- Notification center: in-app bell icon with unread badge, slide-out
  panel, real-time SSE updates, mark read/all read. Replaces raw
  activity feed dropdown.

Schema: adds status_definitions, automation_rules, notifications tables.
Migrations: 0007, 0008, 0009. 41 NLP parser tests pass.
This commit is contained in:
2026-08-19 10:54:29 +00:00
parent 1a620f16c1
commit b814a4788d
46 changed files with 4965 additions and 288 deletions
@@ -0,0 +1,50 @@
import type { TimelineTask } from "./gantt-utils";
export interface TaskPosition {
/** Left edge of the task's bar in timeline pixels. */
startX: number;
/** Right edge of the task's bar in timeline pixels. */
endX: number;
/** Vertical center of the task's row in pixels. */
y: number;
}
interface GanttDependencyArrowProps {
/** The task being depended on (arrow originates at the end of its bar). */
fromTask: TimelineTask;
/** The blocked task (arrowhead lands at the start of its bar). */
toTask: TimelineTask;
taskPositions: ReadonlyMap<string, TaskPosition>;
}
const BEND = 12;
/**
* SVG elbow arrow from the end of the blocking task's bar to the start of the
* blocked task's bar. Rendered inside the chart's overlay <svg> — the marker
* is defined there under the id `gantt-arrow`.
*/
export function GanttDependencyArrow({ fromTask, toTask, taskPositions }: GanttDependencyArrowProps) {
const from = taskPositions.get(fromTask.id);
const to = taskPositions.get(toTask.id);
if (!from || !to) return null;
const x1 = from.endX;
const y1 = from.y;
// If the target bar starts before the source ends, drop the arrowhead just
// past the source end so the elbow path never doubles back on itself.
const x2 = Math.max(to.startX, from.endX + BEND);
const y2 = to.y;
const d = `M ${x1} ${y1} H ${x1 + BEND} L ${x2 - BEND} ${y2} H ${x2}`;
return (
<path
d={d}
fill="none"
stroke="currentColor"
strokeWidth={1.5}
markerEnd="url(#gantt-arrow)"
className="text-muted-foreground/70"
/>
);
}