Repository navigation
Description
Task
T-113b· Milestone M8 — Dashboard · Size S · Priority P1 · Epic #8Implements FR-DSH-007
Branch
feat/t-113b-report-export-ui-request-report— one task = one branch = one PR (doc 32 §6)
Summary
Implement features/reports/: 'Export report' buttons on console and comparison (POST /reports → poll job → open), and the /reports/:id route embedding the server-rendered HTML in a sandboxed iframe with a print action.
Context / motivation
FR-DSH-007: shareable offline reports.
Scope
In scope
sandboxiframe attributes; no script execution from report HTML.
Implementation guidance
features/reports/useReportJob.ts:POST /reports {kind, id}→ pollGET /reports/{id}with a configurable interval (runtime config, default 1.5 s) and backoff untildone|error.ExportReportButtonis placed in the console header and the comparison page through a slot prop (one-line change in those features)./reports/:idroute:ReportPagewith<iframe sandbox="allow-same-origin" src={contentUrl}>(noallow-scripts), a Print button callingiframe.contentWindow.print(), and a Download link.- Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
- Job lifecycle (queued → done/error) handled.
- Print uses report print CSS.
- Polling stops on unmount.
- The iframe has no
allow-scripts(test). - Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
features/reports/*.test.tsx.
Dependencies
Blocked by: #165 (T-085d), #157 (T-084a)
Blocks: #187 (T-118)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
web/src/features/reports/**
Independent folder.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-113b (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 13 §3.9 · doc 12 §2
Requirements: FR-DSH-007 (traceability: doc 28)
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
/config.json), SSE client with reconnect/Last-Event-ID and query-cache patching #165feat(web): T-113a/b T-115 spaces, reports, shortcuts