# Portfolio Executive Gantt

The Portfolio Timeline page (`/projects/timeline`) exposes three complementary views for different audiences. Each view uses the same portfolio summary API and does not duplicate planning logic from project-level Gantt or Scrum boards.

## Views

| View | Query param | Default | Audience | Purpose |
|------|-------------|---------|----------|---------|
| **Executive Gantt** | `view=executive` or omitted | Yes | CEO, CTO, department heads, portfolio directors | One row per project: schedule bars, progress, health, milestones, today line |
| **Timeline** | `view=timeline` | No | PMO | Tabular portfolio overview: owners, health, dates, coordination |
| **Detailed Gantt** | `view=gantt` | No | Project managers, scrum masters | Releases, sprints, work items, dependencies, critical path |

Legacy `/projects/gantt` redirects to `?view=gantt`.

## Data sources

All three views load from:

```
GET /api/v1/portfolio/gantt
```

Response shape: `{ summary, timeline, range_start, range_end, cross_project_dependencies }`.

Each `timeline` row is **project-level only** (no work items, sprints, or dependency graphs).

| Field | Executive Gantt | Timeline table | Detailed Gantt |
|-------|-----------------|----------------|----------------|
| `summary` | KPI strip | — | Summary chips |
| `timeline[]` | Bar chart rows | Table rows | Project list for drill-down |
| `milestones[]` on row | Diamond markers | Count / next milestone | — |
| Per-project `GET /projects/{id}/gantt` | **Not loaded** | **Not loaded** | Loaded per visible project |

## Executive Gantt behaviour

- **Bars**: start/target dates with fill proportional to `progress_percentage`.
- **Health colours**: healthy (green), at risk / attention (amber), critical (red), completed (blue).
- **Today line**: vertical marker across the chart.
- **Milestones**: diamonds on the bar; hover shows name and due date.
- **Delays**: badge when `is_delayed` (days past target).
- **Filters**: year / quarter / month plus All Projects, Active Only, At Risk, Delayed, Blocked (`?filter=`).
- **Actions**: row → project overview; secondary → Detailed Gantt view.

## Performance

Executive Gantt and Timeline are the fastest portfolio views:

- Single `portfolio/gantt` request.
- No `fetchProjectGantt` fan-out.
- No work-item or sprint payloads.

Detailed Gantt intentionally loads per-project Gantt timelines and is heavier by design.

## Analytics

| Event | When |
|-------|------|
| `executive_gantt_opened` | Default or `?view=executive` |
| `timeline_view_opened` | `?view=timeline` |
| `detailed_gantt_view_opened` | `?view=gantt` |
| `portfolio_view_switched` | User changes view toggle |

## Mobile

Executive Gantt scrolls horizontally. Today line, progress bars, and health styling are preserved; task-level detail is not shown.
