inou/portal/static
James f58a4f804e feat: add AI commentary to lab trend charts
After lab trend charts render, a POST to /dossier/{id}/labs/commentary
sends compact series summaries (first→last value, % change, dates,
reference range) to Claude Haiku, which returns one sentence per metric.
Commentary appears below each chart as an italic insight, e.g.:
  'Cholesterol dropped 15% from 210→178 mg/dL since March — now within range.'

Implementation:
- New handleLabCommentary() in dossier_sections.go — auth-gated, POST only,
  gracefully skips if no Anthropic key configured
- Route: POST /dossier/{id}/labs/commentary (registered before /labs in mux)
- renderFilterChart() now wraps each SVG in .lab-chart-wrap with a
  .lab-commentary placeholder showing a pulsing '…' while loading
- fetchLabCommentary() fires async after chart render, patches commentary
  divs by data-abbr attribute when response arrives
- CSS: .lab-chart-wrap, .lab-commentary, .lab-commentary-text,
  .lab-commentary-loading with pulse animation
2026-03-23 12:27:20 -04:00
..
download Initial commit from dev 2026-02-01 08:03:12 +00:00
api-docs.html Initial commit 2026-02-01 02:43:27 -05:00
api-docs.txt Fix misleading auth docs and Grok token instruction 2026-02-23 02:21:57 -05:00
app-ads.txt Initial commit 2026-02-01 02:43:27 -05:00
apple-touch-icon.png Initial commit 2026-02-01 02:43:27 -05:00
carousel-1.webp Checkpoint: all pending changes across lib, portal, api, tools 2026-03-11 23:37:44 -04:00
carousel-2.webp Checkpoint: all pending changes across lib, portal, api, tools 2026-03-11 23:37:44 -04:00
carousel-3.webp Checkpoint: all pending changes across lib, portal, api, tools 2026-03-11 23:37:44 -04:00
carousel-4.webp Checkpoint: all pending changes across lib, portal, api, tools 2026-03-11 23:37:44 -04:00
carousel-5.webp Checkpoint: all pending changes across lib, portal, api, tools 2026-03-11 23:37:44 -04:00
carousel-6.webp Checkpoint: all pending changes across lib, portal, api, tools 2026-03-11 23:37:44 -04:00
carousel.js Document processing pipeline: OpenRouter OCR + Stepfun extraction 2026-03-15 05:28:05 -04:00
claditor-logo.css chore: commit accumulated WIP (Mar 23) 2026-03-23 12:11:13 -04:00
controls.css Document processing pipeline: OpenRouter OCR + Stepfun extraction 2026-03-15 05:28:05 -04:00
favicon.ico Initial commit 2026-02-01 02:43:27 -05:00
favicon.svg Initial commit 2026-02-01 02:43:27 -05:00
llms.txt Initial commit 2026-02-01 02:43:27 -05:00
logo-square.svg Checkpoint: all pending changes across lib, portal, api, tools 2026-03-11 23:37:44 -04:00
openapi.yaml Initial commit 2026-02-01 02:43:27 -05:00
page.css Document processing pipeline: OpenRouter OCR + Stepfun extraction 2026-03-15 05:28:05 -04:00
pricing.html Initial commit 2026-02-01 02:43:27 -05:00
robots.txt Initial commit 2026-02-01 02:43:27 -05:00
sitemap.xml Initial commit 2026-02-01 02:43:27 -05:00
style.css feat: add AI commentary to lab trend charts 2026-03-23 12:27:20 -04:00
swagger.html Initial commit 2026-02-01 02:43:27 -05:00
upload.js Document processing pipeline: OpenRouter OCR + Stepfun extraction 2026-03-15 05:28:05 -04:00
viewer.css Lab reference charts, import tracking, DossierFromEntry consolidation 2026-02-24 05:15:03 -05:00
viewer.js feat: add Compare button for side-by-side study comparison 2026-03-23 12:14:02 -04:00