Files
fusion/docs/plugins/reports.md
Fusion 2963923571 feat(FN-4050): add one-click install support for reports plugin
- Add reports plugin to bundled plugin resolver so it can be installed from packaged assets
- Expose reports plugin in dashboard plugin manager and server routes for one-click install flows
- Add CLI and dashboard test coverage for bundled install behavior and plugin route availability
- Update reports/plugin management/settings docs and include a changeset for @runfusion/fusion
2026-05-11 21:48:26 -07:00

31 lines
1.8 KiB
Markdown

# Reports Plugin
## Install
1. Open **Settings → Plugins → Fusion Plugins**.
2. In **Bundled Plugins**, click **Install** for **Reports**.
3. Enable the plugin if it is not already started.
When installed and enabled, the plugin registers the **Reports** dashboard view destination.
## Rendering & Export
The reports plugin renders deterministic HTML via `src/render/html-template.ts` using ordered `data-section` blocks and tokenized styles from `src/render/html-styles.ts`. Section toggles and `sectionOrder` are respected from report settings metadata, and both dark/light themes are embedded directly in the output document (no dashboard stylesheet dependency).
Standalone exports are produced by `renderStandaloneReportHtml` in `src/render/standalone-html.ts`. The export is fully self-contained (single document, inlined `<style>`, no remote CSS/fonts, and no non-allowlisted external `href/src` URLs). Exported HTML is cached back into the report store (`rendered_html`, `rendered_html_generated_at`) on first export.
HTTP endpoints:
- `GET /api/plugins/reports/reports/:id/export.html` → attachment download (`Content-Disposition` + `text/html`)
- `GET /api/plugins/reports/reports/:id/preview.html` → body-only HTML fragment for embedded preview viewers
## Dashboard view
The Reports dashboard view is registered as a primary plugin destination (`viewId: "reports"`).
UX includes:
- Reports history list with cadence/status/date/title/agent filtering
- Detail viewer with sandboxed iframe `srcDoc` preview from `/reports/:id/preview.html`
- Section quick-jump sidebar based on stable rendering-contract `data-section` markers
- Compare drawer with two report selectors and section-level diff buckets (added/removed/changed/unchanged)
- Download action that opens `/reports/:id/export.html` for standalone HTML export