feat(autoresearch): render run dashboard with quill-charts#3213
Conversation
Adds an Export dropdown to the autoresearch run header that downloads the report as a self-contained HTML file or a PNG image. The report is generated from run data (header, stats, inline SVG metric chart, iterations table, brief) with inline styles and no external resources; the PNG path rasterizes the same markup via SVG foreignObject onto a canvas. Dependency-free. Generated-By: PostHog Code Task-Id: c0f4e30c-8329-433a-a2cb-0565df4ecb8b
|
😎 Merged manually by @pauldambra - details. |
|
/trunk merge |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
/trunk cancel |
pauldambra
left a comment
There was a problem hiding this comment.
Note
🤖 Automated comment by QA Swarm — not written by a human
QA Swarm review complete. See inline comments.
|
Note 🤖 Automated comment by QA Swarm — not written by a human Multi-perspective review: paul-reviewer, xp-reviewer, security-audit (qa-team unavailable in this environment — skipped) Verdict: 💬 APPROVE WITH NITSNo correctness or security blockers. The one substantive theme is duplication between the export module and its live-UI neighbours; everything else is preference. Key findings🟡 MEDIUM
🟢 LOW / ⚪ NIT
ConvergenceThe chart-layout duplication was flagged independently by paul-reviewer and xp-reviewer — highest-confidence finding. Reviewer summaries
Automated by QA Swarm — not a human review |
There was a problem hiding this comment.
Gates denied due to size (576L exceeds 500L ceiling). The PR is purely additive and low-risk, but the automated QA Swarm left unresolved MEDIUM concerns about duplicated chart layout math and formatting logic that could silently diverge from the on-screen view — worth a quick human sign-off before merging.
- Narrow deltaColor signature to accept direction primitive instead of whole run (fixes feature envy) - Thread exportedAt through renderReportPng/exportRunAsPng so HTML and PNG exports use same timestamp - Add data-attr attributes to Export trigger and menu items for autocapture measurement Generated-By: PostHog Code Task-Id: c0f4e30c-8329-433a-a2cb-0565df4ecb8b
Extract reportTitle helper for the duplicated title fallback and tighten a let to const in renderReportPng. Generated-By: PostHog Code Task-Id: c0f4e30c-8329-433a-a2cb-0565df4ecb8b
|
Note 🤖 Automated comment by QA Swarm — not written by a human Round 2 re-review of the fix commits ( Verdict: ✅ APPROVEAll three reviewers verified the round-1 fixes (narrowed |
There was a problem hiding this comment.
The PR exceeds the size gate ceiling and has two unresolved MEDIUM inline comments about duplicated chart layout math (silently diverges from on-screen view) and duplicated formatting/delta logic that mirrors existing code. These warrant a quick human sign-off before merging.
…d report export Addresses the two open review threads about duplication: - New chartLayout.ts owns the chart geometry (scale, paths, target line); MetricChart and the report export's SVG builder both call it, so the exported chart can no longer silently drift from the on-screen one. - metricFormat.ts now owns the shared metric number formatter, the compact chart-axis formatter, the signed delta formatter, and a deltaTone decision that renderers map to their own color space (Radix tokens on screen, fixed hex in the export). IterationsTable, MetricChart, AutoresearchPanel, and reportExport all use them instead of local copies. - Adds metricFormat.test.ts covering deltaTone, formatMetricDelta, formatChartValue, and computeChartLayout. Generated-By: PostHog Code Task-Id: c0f4e30c-8329-433a-a2cb-0565df4ecb8b
…rt export Direction change after review discussion: the quill migration wins over the export feature. - MetricChart is now a quill-charts LineChart: value series with point dots, dashed best-so-far frontier, goal ReferenceLine for the target (kept on-plot via valueDomain include), crosshair + tooltips, theme-aware. - RunStats cards are quill-charts MetricCards; Best and Last carry sparklines of the frontier and raw values. - The HTML/PNG report export is removed: reportExport, chartLayout, the Export button, and their tests. The shared metricFormat helpers stay. - Canvas series colors use the resolved theme palette — canvas strokeStyle ignores var(--…) strings, so explicit CSS-variable colors never painted. - Adds an Autoresearch/RunDashboard storybook story (in-progress minimize run, completed maximize run, empty state) for visual review. Generated-By: PostHog Code Task-Id: c0f4e30c-8329-433a-a2cb-0565df4ecb8b
There was a problem hiding this comment.
The PR was denied solely for exceeding the size gate (637L vs 500L ceiling). All substantive review concerns — duplicated chart layout math and formatting logic — were addressed in follow-up commits by extracting shared helpers. The changes are purely UI (Storybook stories, chart refactor, format utilities, tests) with no data model, API contract, or security surface. Needs a human sign-off to confirm the extracted helpers actually replaced the duplication correctly.
@fercgomes can we switch to the quill chart library?
Summary
Renders the autoresearch run dashboard with
@posthog/quill-charts(already apackages/uidependency — no new packages):MetricChartis now a quillLineChart: solid value series with point dots, dashed "best so far" frontier, and a goalReferenceLinefor the target (kept on-plot viavalueDomain: { include }). Gains crosshair + tooltips and follows the app theme viauseChartTheme().RunStatscards are quillMetricCards: Best and Last carry sparklines (best-so-far frontier / raw values, with hover-to-inspect headlines); Iterations formatsN / max; Target shows the target or "—".strokeStyleignoresvar(--…)strings, so explicit CSS-variable colors silently never painted (caught via the new storybook story). The DOM-renderedReferenceLinekeepsvar(--green-9).Autoresearch/RunDashboard(in-progress minimize run, completed maximize run, empty state) for visual review —pnpm --filter code storybook.metricFormat.tshelpers (deltaTone,formatMetricDelta,metricNumberFormat,formatChartValue) remain, used by the chart, cards, and iterations table.We changed our minds 🙂
This PR started as an HTML/PNG report export (see early commits and review threads). Review surfaced duplication between the export's hand-rolled chart and the live one; unifying on quill-charts turned out to be incompatible with a static export (canvas rendering + DOM-overlay reference lines + runtime CSS-variable theming don't survive static rasterization). Choosing between the two, the quill migration won — the export feature is removed (
reportExport,chartLayout, the Export button, and their tests). The QA Swarm review threads about export code refer to deleted code.Testing
build-storybookclean.🤖 Generated with Claude Code
Screenshots
From the
Autoresearch/RunDashboardstorybook stories (dark theme, 2×):Minimize run in progress — value line + best-so-far frontier + target line; Best/Last cards with sparklines:
Maximize run completed —
%unit, no target, best tag at iteration 9:Images live on the non-merging
posthog-code/pr-3213-assetsbranch, so no binaries land inmainwith this PR.