From 326cef0b2d81013bcbed5d9e2adf20466a54a161 Mon Sep 17 00:00:00 2001 From: Jeremy McSpadden Date: Tue, 17 Mar 2026 22:46:51 -0500 Subject: [PATCH] feat: enhance HTML report with derived metrics, visualizations, and interactivity (#1078) * feat: enhance HTML report with derived metrics, visualizations, and interactivity Add 13 features to the HTML report generator across 6 implementation waves: Wave 1 - Summary enhancements: - Executive summary paragraph with project completion %, cost, and budget context - ETA calculation based on completion rate and remaining slices - Cost/slice and Tokens/tool efficiency metrics in KV grid - Cache hit ratio percentage - Milestone scope indicator when scoped to a milestone Wave 2 - Metrics visualizations: - Cost over time inline SVG area chart with grid lines and axis labels - Duration by slice bar chart (third chart using existing buildBarChart) - Budget burndown horizontal stacked bar (spent/projected/overshoot) - Chart row CSS changed to auto-fit for flexible multi-column layout Wave 3 - Blockers section: - New section with card-based layout for blocker verifications and high-risk incomplete slices, added to sections array and TOC nav Wave 4 - Gantt chart: - SVG horizontal bar timeline grouped by slice with done/active/pending coloring and time axis labels Wave 5 - Interactive JS features: - Timeline filter input for text-based row filtering - Collapsible sections with toggle buttons (localStorage persisted) - Dark/light theme toggle in header (localStorage persisted) Wave 6 - Mobile responsiveness: - 768px and 480px breakpoints with stacked layouts and compressed padding All changes in a single file (export-html.ts). No data layer changes needed. 30 new tests covering all features and edge cases. * fix: correct Phase type literal in export-html-enhancements test Change "execution" to "executing" to match the Phase type definition. --- src/resources/extensions/gsd/export-html.ts | 366 ++++++++++++++++- .../tests/export-html-enhancements.test.ts | 374 ++++++++++++++++++ 2 files changed, 737 insertions(+), 3 deletions(-) create mode 100644 src/resources/extensions/gsd/tests/export-html-enhancements.test.ts diff --git a/src/resources/extensions/gsd/export-html.ts b/src/resources/extensions/gsd/export-html.ts index 07456fa12..b3eb0b620 100644 --- a/src/resources/extensions/gsd/export-html.ts +++ b/src/resources/extensions/gsd/export-html.ts @@ -27,6 +27,7 @@ import type { } from './visualizer-data.js'; import { formatDateShort, formatDuration } from '../shared/format-utils.js'; import { formatCost, formatTokenCount } from './metrics.js'; +import type { UnitMetrics } from './metrics.js'; // ─── Public API ──────────────────────────────────────────────────────────────── @@ -46,6 +47,7 @@ export function generateHtmlReport( const sections = [ buildSummarySection(data, opts, generated), + buildBlockersSection(data), buildProgressSection(data), buildTimelineSection(data), buildDepGraphSection(data), @@ -94,6 +96,7 @@ export function generateHtmlReport(