fix(renderer): make the Gantt gap options work (audit C5) #70

Merged
abiwab merged 4 commits from fix/audit-c5 into main 2026-09-30 20:31:42 +02:00
Owner

Audit C5, present since the Gantt was added. toGanttHTML documents two options, gapThresholdMinutes and compressedGapSize; measured on a recipe with a 2 h rest:

  • compressedGapSize: ignored everywhere (getVirtualTime was always called with its default 20): 5, 20 and 60 gave the same 528 px chart
  • gapThresholdMinutes: used for the axis gaps but not by buildTracks, which recomputed its own gaps with the default. The chart's width and the blocks' percentages were then computed from different gaps: with a threshold above the wait (no compression wanted) the blocks ran to 279.5% of the chart (the passive block was 272.7% wide)

Fix: one resolveGapOptions yields the two numbers (missing, NaN or negative -> default; Infinity is valid and means never compress), and buildTracks, computeVisualGaps, computeTimeTicks and the blocks' getVirtualTime calls in toGanttHTML all take them from it. getVirtualTime also never lets a gap grow: a size above the gap's own length would have stretched it.

Checked: the default output is byte-identical to main (3 recipes x 2 schedules); the new tests (7) fail 3 on the previous code, including the 272.7% block. Docs EN/FR say what Infinity and the clamp do. New patch changeset for the renderer (visible vs 1.3.0). ci (1342 tests) and conformance 98/98 pass.

Audit C5, present since the Gantt was added. `toGanttHTML` documents two options, `gapThresholdMinutes` and `compressedGapSize`; measured on a recipe with a 2 h rest: - `compressedGapSize`: ignored everywhere (`getVirtualTime` was always called with its default 20): 5, 20 and 60 gave the same 528 px chart - `gapThresholdMinutes`: used for the axis gaps but not by `buildTracks`, which recomputed its own gaps with the default. The chart's width and the blocks' percentages were then computed from different gaps: with a threshold above the wait (no compression wanted) the blocks ran to 279.5% of the chart (the passive block was 272.7% wide) Fix: one `resolveGapOptions` yields the two numbers (missing, NaN or negative -> default; `Infinity` is valid and means never compress), and `buildTracks`, `computeVisualGaps`, `computeTimeTicks` and the blocks' `getVirtualTime` calls in `toGanttHTML` all take them from it. `getVirtualTime` also never lets a gap grow: a size above the gap's own length would have stretched it. Checked: the default output is byte-identical to main (3 recipes x 2 schedules); the new tests (7) fail 3 on the previous code, including the 272.7% block. Docs EN/FR say what `Infinity` and the clamp do. New patch changeset for the renderer (visible vs 1.3.0). ci (1342 tests) and conformance 98/98 pass.
abiwab merged commit dd3e6088b3 into main 2026-09-30 20:31:42 +02:00
abiwab deleted branch fix/audit-c5 2026-09-30 20:31:43 +02:00
Sign in to join this conversation.
No description provided.