MEGAINFRA-WEBAPP/docs/superpowers/plans
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
..
2026-08-19-po-import-queue-implementation.md
2026-08-19-purchase-order-upload.md
2026-08-26-needs-review-modal-resize-and-pdf-viewer.md
2026-08-26-pdf-url-fix-and-modal-compact.md
2026-08-26-purchasing-ui-tweaks.md
2026-08-27-po-supplier-edit-and-dn-collapse.md docs(plan): PO supplier edit + DN collapse implementation 2026-08-27 00:50:44 +02:00
2026-08-28-fuel-attention-dismissal.md docs(plan): fuel attention dismissal implementation plan 2026-08-28 12:24:14 +02:00
2026-08-28-plant-hours-weekly-log.md docs(plan): plant hours weekly log implementation plan 2026-08-28 12:26:35 +02:00
2026-08-28-site-overhead-monthly-and-oneoff.md docs(plan): fix byDateDesc to return 0 on equal dates 2026-08-28 12:54:02 +02:00
2026-08-29-agent-tool-layer-mcp.md docs(plan): agent tool layer + read-only MCP server (phase 2B) 2026-08-29 20:13:39 +02:00
2026-08-29-chat-detail-tools-upload-pwa.md docs(plan): chat detail tools, PO upload and standalone PWA 2026-08-30 08:27:49 +02:00
2026-08-29-chat-ui-phase3.md docs(plan): chat UI + provider abstraction (phase 3) 2026-08-29 20:33:03 +02:00
2026-08-29-fuel-attention-extraction.md docs(plan): fuel attention extraction plan (phase 2A) 2026-08-29 20:04:51 +02:00
2026-08-29-metrics-extraction.md fix(vehicles): handle empty unit_type during updates 2026-08-29 19:17:14 +02:00
2026-08-30-agent-coverage-vision-pdf.md docs(plan): agent coverage gaps, vision and PDF export 2026-08-30 12:27:38 +02:00
2026-08-30-pwa-split-icon.md docs(plan): MEGA Ask vs MEGA OPS PWA split-install icon plan 2026-08-30 22:12:30 +02:00
2026-08-31-vehicle-unit-type-toggle-ui.md docs(plan): implement vehicle unit_type inline-edit UI on Fleet + Plant 2026-08-31 12:57:18 +02:00
2026-09-11-ingestion-restructure.md chore: untrack compiled Python bytecode, fix missed Task 17 checkboxes 2026-09-11 16:18:06 +02:00
2026-09-11-project-month-week.md docs(project-calendar): add the project month/week plan; fix a stale doc reference 2026-09-11 22:35:41 +02:00
2026-09-11-site-scope.md docs(site-scope): correct stale line refs, record tasks 1-5 as done 2026-09-11 23:05:10 +02:00
2026-09-11-suppliers.md docs(plan): suppliers implementation plan 2026-09-11 18:08:30 +02:00
2026-09-11-workers-timesheets-qr.md chore(assets): update application icons and logo with new designs 2026-09-11 20:54:44 +02:00
2026-09-12-mega-clock-timeclock-pwa.md docs(clock): add implementation plan for MEGA Clock timeclock PWA 2026-09-12 00:30:54 +02:00
2026-09-17-delivery-note-inbox-pipeline.md docs(delivery-notes): add the phase 2-3 inbox pipeline implementation plan 2026-09-17 12:51:03 +02:00
2026-09-17-delivery-note-unit-correctness.md docs(delivery-notes): add the phase 1 unit correctness implementation plan 2026-09-17 11:51:21 +02:00
2026-09-17-dn-inbox-corrections.md docs(delivery-notes): record the Task 3 fixture files the plan missed 2026-09-17 21:04:39 +02:00
2026-09-18-hybrid-delivery-note-ingestion.md docs: plan hybrid delivery note ingestion 2026-09-18 18:43:52 +02:00
2026-09-25-ask-reports.md fix: overview counts, wrong-unit fuel limits, meter guard, en-ZA numbers, vehicle merge, docs 2026-09-25 22:04:08 +02:00
2026-09-25-clock-daily-shifts-and-exceptions.md feat(clock): review missed scan-outs without changing phone flow 2026-09-25 07:27:12 +02:00
2026-09-25-pocketbase-login.md fix(auth): remove the ?demo=1 PIN bypass 2026-09-26 17:37:20 +02:00
2026-09-26-ask-agent-actions.md feat(ask): download Ask-made PDF reports 2026-09-26 21:25:00 +02:00