Timeline: draw stage-period ranges from activities, milestones on top

Each stage-transition activity now becomes a horizontal range on its lane: start = the activity's date, end = the next activity with a higher stage rank, or extending to today if still in effect. Milestone date-field dots overlay on top of the ranges. Activity dots at each range start carry a tooltip with the activity subject. Added computeStageRanges in lib/stageRank.ts and switched DateTimeline to take activities directly (deriving both the rank resolver and the ranges internally). Wide year-spanning timelines now show their full extent even when no milestone dates have been entered.
This commit is contained in:
Joel Brock
2026-06-11 14:14:36 -07:00
parent d3b88d92c2
commit 13d7f6e93b
4 changed files with 290 additions and 68 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import type {
StageSectionConfig,
} from "@/types/form";
import { STAGE_OPTION_GROUP_ID } from "@/config/form";
import { STAGE_RANK, buildStageRankAtDate } from "@/lib/stageRank";
import { STAGE_RANK } from "@/lib/stageRank";
import { StageIcon } from "./StageIcon";
import {
FieldHistoryGroup,
@@ -121,7 +121,7 @@ export function ReportView({ config, cid, cs }: ReportViewProps) {
<DateTimeline
sections={config.sections}
fieldHistory={data.fieldHistory}
stageRankAtDate={buildStageRankAtDate(data.activities)}
activities={data.activities}
/>
{sectionsToRender.length === 0 ? (