Repository navigation
Description
Task
T-110b· Milestone M8 — Dashboard · Size S · Priority P1 · Epic #8Implements FR-DSH-003 · FR-ANA-003
Branch
feat/t-110b-insights-panel-shap-bars-interaction— one task = one branch = one PR (doc 32 §6)
Summary
Implement features/casebook/insights/ and components/charts/plotly.ts (lazy partial bundle: heatmap, scatter, box) showing importance bars, parameter × parameter interaction heatmap, lengthscale comparison with disagreement flag, CV AUC + low-confidence label.
Context / motivation
Answers 'why'; Plotly loaded only on this route to stay within bundle budget.
Scope
In scope
- Shared lazy Plotly wrapper used by Atlas and Trials too.
Implementation guidance
components/charts/plotly.ts:export const loadPlotly = () => import('./plotlyBundle'), whereplotlyBundle.tsregisters onlyheatmap,scatter,boxandcontourtraces onplotly.js/lib/core(partial bundle, doc 13 §5); aPlotlyChartwrapper (react-plotly.js/factory) with a theme layout derived from CSS variables at runtime andconfig: {displaylogo: false, responsive: true}.features/casebook/insights/InsightsPanel.tsx(tabinsightsand casebook side panel): SHAP global bars (sorted, GP 1/ℓ rank alongside with a disagreement icon), interaction heatmap (param × param, symmetric), CV quality (AUC ± std, balanced accuracy, low-confidence label with explanation), per-mode importance selector.- Charts include a text summary for screen readers (sentence naming the top-3 parameters).
- 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
- Plotly not in the initial chunk (bundle analysis test).
- Charts render fixture data.
- Initial chunk excludes Plotly (checked locally here, enforced in T-114).
- Low-confidence explanation shown when flagged.
- 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/casebook/insights/*.test.tsx; bundle check in T-114.
Dependencies
Blocked by: #165 (T-085d), #164 (T-085c)
Blocks: #178 (T-111a), #181 (T-112b)
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/casebook/insights/**web/src/components/charts/plotly.ts
Parallel with T-110a.
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-110b (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.5 · doc 13 §5 · doc 09 §4
Requirements: FR-DSH-003 · FR-ANA-003 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
/config.json), SSE client with reconnect/Last-Event-ID and query-cache patching #165Add Casebook failure modes and campaign Insights (#307)
fix(api): supply runtime Casebook and Insights data (T-110) (#311)
CodewithJha commentedon Nov 22, 2026
Shipped on main (merged PR).
fix(web): render the Risk Atlas with lazy Plotly (T-111a) (#326)