Repository navigation
Description
Task
T-088a· Milestone M8 — Dashboard · Size M · Priority P0 · Epic #8Implements FR-DSH-002
Branch
feat/t-088a-campaign-console-header-controls-progress— one task = one branch = one PR (doc 32 §6)
Summary
Implement features/console/ top half per doc 13 §3.3: name/strategy/backend/seed header with Pause/Resume/Cancel (pending state until server confirms), progress counters, phase, discovery curve (unique cases vs runs; optional random reference band), alert banner on alert SSE events.
Context / motivation
US-003/US-012: watch and control a running campaign.
Scope
In scope
- Discovery curve as lightweight SVG (Plotly not needed here).
Implementation guidance
features/console/ConsolePage.tsx(tabconsoleof/campaigns/:id) withheader/CampaignHeader.tsx(name, strategy, backend, seed; Pause/Resume/Cancel shown per status; Cancel requires a confirmation dialog),progress/ProgressPanel.tsx(budget progress, PASS/FAIL/INVALID counts with verdict shapes, current phase),progress/DiscoveryCurve.tsx(SVG step line of unique cases vs runs; optional reference band from an experiment's random arm), andAlertBanner.tsx(alerts from the SSE store; dismissible; INFRA_UNHEALTHY links to runbook RB-01).- Commands via a
useCampaignCommand(id)mutation: pending state until 202 returns; on 409 show inline ProblemView and refetch the campaign. - Data:
useCampaign(id),useCampaignProgress(id); SSE patches counters; the discovery curve appends onrun.finished/mode.discovered. - 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
- Live counters update from SSE within 2 s (MSW SSE).
- Pause/Resume/Cancel flows incl. error handling.
- Buttons reflect the allowed transitions from doc 12 §5 (parametrised test).
- Alert banner appears on an
alertevent (MSW SSE). - Cancel confirmation is accessible (focus trap, Esc).
- 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/console/*.test.tsx.
Dependencies
Blocked by: #165 (T-085d), #167 (T-086b)
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/console/header/**web/src/features/console/progress/**
Parallel with T-088b (different subfolder).
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-088a (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.3 · doc 12 §5 · doc 14 §6 · doc 30 §RB-01
Requirements: FR-DSH-002 (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): add live campaign Console and run stream (#306)
fix(web): keep Console cancel confirmation keyboard accessible (T-088…