Skip to content

T2 · Migrate SPC charts #182

Open
Open

Description

@Siddardth7

Summary

Migrate the SPC control charts (X̄-R, I-MR, c-chart with Western Electric / Nelson overlays, plus the Week-10 EWMA/CUSUM depth) from Streamlit to the Next.js app, consuming the API delivered in P3.

Mostly stateless compute→render. The rule-overlay rendering is the interesting part; the disturbance simulator needs a client-side state model.

Part of P4 · Tool migration. Needs P2 (web foundation) and P3 (API). Strangler fig: Streamlit keeps serving every tool not yet migrated.

Scope

  • React view(s) under web/app/app/, calling the P3 endpoints.
  • Client-side state only — session state lives in React, there is no server-side session.
  • Plotly figures render via the existing framework-agnostic figure builders (react-plotly.js); the chart layer is a host swap, not a rewrite.
  • Loading and error states for every API call — this is where API cold start becomes a UX concern rather than an availability one.
  • Delete the corresponding Streamlit page in this same issue, once parity is verified.

Constraints

  • Session-state sites to re-implement: 2 (docs/research/frontend-migration.md §3.3).
  • Exact endpoint names bind at execution time against the API actually delivered in P3 — do not assume names from the plan doc.
  • Do not touch quality_core or engine logic. Presentation + transport only.
  • Parity is measured on numbers, not layout: same input must produce identical results to the Streamlit page it replaces.

Definition of Done

  • View live in the web app, wired to the P3 endpoints
  • Parity verified against the Streamlit page on the same input — outputs identical
  • Loading + error states implemented
  • Streamlit page for this tool deleted; nav updated; remaining Streamlit tools still work
  • web-gate and gate both green; zero diff to engines
  • SME verification
  • Definition of Done (📌 Definition of Done — the contract (read before every issue) #43) honored

Refs: epic #107, docs/research/web-platform-migration.md §5.2, docs/research/frontend-migration.md §3.3

Activity

  1. added
    type:refactorrestructure, no behavior change
    priority:P1release-critical — the version can't ship without it
    size:Mmedium — a day-ish, a few files
    tool:webweb/ Next.js surface
    phase:F-webappWeb platform migration (P1-P5)
    on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase:F-webappWeb platform migration (P1-P5)priority:P1release-critical — the version can't ship without itsize:Mmedium — a day-ish, a few filestool:spcSPC apptool:webweb/ Next.js surfacetype:refactorrestructure, no behavior change

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions