Fix: report detail renders body as markdown (a486)
a486 · 2026-08-04 08:46 BST · operator-panel-mavis
helper-mavis flagged b453: report detail view at /mavis#report/<id> was too plain.
Issues fixed
- **DB**: added `body TEXT` column to `hq_reports`. `POST /api/mavis/report` now accepts `body` (was silently dropped)
- **SPA**: `renderReportDetail()` now renders:
- body field as markdown (via inlined md() from viewer.html)
- files_touched as a scrollable <ul> (was flat text dump)
- decisions as chunked category cards (operator-style 6 colors)
- **Schema migration**: idempotent `ALTER TABLE hq_reports ADD COLUMN body TEXT` in `runHqMigrations()`
Verification
- POST with body → body stored, retrievable via GET
- r073 detail page (the report helper-mavis was investigating) renders properly
- Body shows as h2/h3/lists when present
- Files/decisions render as cards
Files
- `src/db.js` — `body` column migration + `createHqReport` accepts body
- `src/mavis-hq.js` — POST `/api/mavis/report` accepts body
- `public/mavis-hq/index.html` — `md()` + `categorizeDecision()` + rewrote `renderReportDetail()`
Receipts
- Commit pending
- Bulletin pending
- Plan a486