MEGAINFRA-WEBAPP/docs
DEls ba75c65795 feat(ask): download Ask-made PDF reports
Added mid-plan (docs/superpowers/plans/2026-09-26-ask-agent-actions.md,
new Task 9b — image generation from Task 9 is untouched): the user can
ask for any custom report and get a finished PDF, e.g. "give me a PDF
on fuel at The Hills for September", not just a manual export of
whatever is on screen (Task 8).

make_pdf_report({ title, subtitle?, filename? }) is the model's own
"this answer is a finished report" signal, called last once it has
already built the report (headings, narrative, KPI tables quoting tool
display strings, charts via make_chart). extractPdfMeta splits the
meta out the same way extractCharts/extractActionCard already do: the
model gets an ack, the browser gets the full meta via a new `event:
pdf`. The assistant's ask_messages row stores it in the existing
`parsed` json field, so reopening the thread still shows the report
cover and Download button — no schema change.

chat-view.tsx renders a report cover (wordmark, title, subtitle, date,
"Prepared by Ask for {name}") and a prominent "Download PDF · {title}"
button reusing Task 8's answerToPdf (same page-slicing, so a chart is
never cut across pages), and auto-downloads once per turn via
nextPdfTurnToDownload — a pure decision function, unit-tested directly
since this codebase's component tests use renderToStaticMarkup rather
than interactive DOM testing.

Live check skipped: needs a thread, which needs ask_threads (not yet
applied). Covered by unit tests (tool meta, the route's pdf event and
persistence, and the once-per-turn auto-download decision) instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 21:25:00 +02:00
..
handoffs docs: add the Hermes brief for the needs-attention queue 2026-09-18 00:23:47 +02:00
n8n chore: 410 the old ocr-result route and archive its workflow export 2026-09-17 15:31:29 +02:00
setup feat(delivery-notes): enhance delivery note upload and processing 2026-08-26 15:33:30 +02:00
superpowers feat(ask): download Ask-made PDF reports 2026-09-26 21:25:00 +02:00
api-reference.md docs(ask): reports and shortcuts 2026-09-26 09:57:28 +02:00
architecture.md fix(auth): remove the ?demo=1 PIN bypass 2026-09-26 17:37:20 +02:00
clock-daily-exceptions-rollout.md feat(clock): review missed scan-outs without changing phone flow 2026-09-25 07:27:12 +02:00
cooler-env.template fix: overview counts, wrong-unit fuel limits, meter guard, en-ZA numbers, vehicle merge, docs 2026-09-25 22:04:08 +02:00
data-flows.md docs(schema): bring bootstrap and data-model docs back to truth 2026-09-11 16:17:41 +02:00
data-model.md feat(plant): fleet map page with GPS-denormalised vehicles, clustering, and tile switcher 2026-09-22 21:39:25 +02:00
minimax-multi-site-audit-prompt.md feat(dashboard): enhance operations dashboard with rain outlook and coordinate support 2026-09-06 19:59:52 +02:00
modules.md docs(ask): reports and shortcuts 2026-09-26 09:57:28 +02:00
multi-site-assessment.md feat(dashboard): enhance operations dashboard with rain outlook and coordinate support 2026-09-06 19:59:52 +02:00
operations.md fix(auth): remove the ?demo=1 PIN bypass 2026-09-26 17:37:20 +02:00
pwa-install-verification.md docs(pwa): manual install verification steps for real devices 2026-08-30 22:42:55 +02:00