|
| 1 | +# PRD: BUG-T18 — Error Breakdown full-width layout fix |
| 2 | + |
| 3 | +## Objective |
| 4 | +Implement the Web UI layout change so the "Error Breakdown" widget is rendered as a full-width chart card in the dashboard, not as a half-width card inside the two-column chart grid. The fix must preserve existing responsive behavior across desktop, tablet, and mobile breakpoints and avoid regressions in dashboard rendering. |
| 5 | + |
| 6 | +Scope is limited to frontend dashboard assets and associated regression tests: |
| 7 | +- `src/mcpbridge_wrapper/webui/static/index.html` |
| 8 | +- `src/mcpbridge_wrapper/webui/static/dashboard.css` |
| 9 | +- Relevant web UI unit tests that validate served dashboard markup/contracts. |
| 10 | + |
| 11 | +Out of scope: |
| 12 | +- Backend metrics aggregation logic |
| 13 | +- Chart data semantics |
| 14 | +- Non-layout redesign of dashboard widgets |
| 15 | + |
| 16 | +## Success Criteria |
| 17 | +- Error Breakdown card spans the full row width in the charts layout at non-mobile breakpoints. |
| 18 | +- Existing Tool Usage (Bar) and Tool Distribution (Pie) widgets remain correctly rendered. |
| 19 | +- Mobile layout (`<=768px`) remains single-column and unaffected. |
| 20 | +- Regression test coverage exists for the full-width Error Breakdown layout contract. |
| 21 | +- All quality gates pass with coverage remaining >= 90%. |
| 22 | + |
| 23 | +## Acceptance Tests |
| 24 | +1. Inspect served dashboard HTML and verify Error Breakdown container uses the full-width layout class. |
| 25 | +2. Verify CSS rules still allow full-width containers via `grid-column: 1 / -1`. |
| 26 | +3. Manual smoke check at representative widths: `1450px`, `1200px`, `1024px`, `768px`, and narrow mobile. |
| 27 | +4. Run quality gates: |
| 28 | + - `pytest` |
| 29 | + - `ruff check src/` |
| 30 | + - `mypy src/` |
| 31 | + - `pytest --cov` |
| 32 | + |
| 33 | +## Test-First Plan |
| 34 | +1. Add or extend a server/web UI unit test that asserts the served dashboard markup encodes a full-width Error Breakdown container. |
| 35 | +2. Run targeted test module to validate the new assertion fails before layout update (or verify current state is missing the contract). |
| 36 | +3. Apply minimal markup/CSS updates to satisfy the failing test. |
| 37 | +4. Re-run targeted tests, then full quality gates. |
| 38 | + |
| 39 | +## Execution Plan |
| 40 | +### Phase 1: Baseline and Contract Definition |
| 41 | +- Inputs: current dashboard HTML/CSS and web UI tests. |
| 42 | +- Outputs: explicit layout contract for Error Breakdown full-width behavior. |
| 43 | +- Verification: targeted test captures required class/layout structure. |
| 44 | + |
| 45 | +### Phase 2: Layout Implementation |
| 46 | +- Inputs: chart row markup and existing `.chart-container.wide` CSS behavior. |
| 47 | +- Outputs: Error Breakdown widget updated to opt into full-width spanning without changing data bindings. |
| 48 | +- Verification: served HTML and manual viewport checks confirm full-width rendering. |
| 49 | + |
| 50 | +### Phase 3: Regression and Validation |
| 51 | +- Inputs: updated tests and quality gate commands. |
| 52 | +- Outputs: passing tests, lint/type checks, and coverage report; validation report artifact. |
| 53 | +- Verification: command outputs recorded with PASS verdict and coverage >= 90%. |
| 54 | + |
| 55 | +## Constraints and Decisions |
| 56 | +- Reuse existing `wide` layout contract instead of introducing a new custom layout system. |
| 57 | +- Keep changes minimal and local to avoid unintended visual regressions. |
| 58 | +- Preserve existing chart IDs and JS hooks to avoid runtime chart initialization breakage. |
| 59 | + |
| 60 | +## Notes |
| 61 | +- Update `SPECS/Workplan.md` status fields for BUG-T18 during ARCHIVE. |
| 62 | +- If additional chart-grid responsiveness issues are discovered, track them as separate follow-up tasks rather than extending BUG-T18 scope. |
| 63 | + |
| 64 | +--- |
| 65 | +**Archived:** 2026-02-26 |
| 66 | +**Verdict:** PASS |
0 commit comments