Skip to content

fix(web): remediate GUI Crucible findings (a11y, honesty, states, perf)#62

Open
jungdaesuh wants to merge 1 commit into
developfrom
bugfix/gui-crucible-fixes
Open

fix(web): remediate GUI Crucible findings (a11y, honesty, states, perf)#62
jungdaesuh wants to merge 1 commit into
developfrom
bugfix/gui-crucible-fixes

Conversation

@jungdaesuh

Copy link
Copy Markdown
Collaborator

Summary

Remediates the confirmed GUI findings from an adversarial (Crucible) review —
accessibility, honesty of the live/mock signal, missing UI states, and a re-render
perf issue. Adopts the existing theme.css token system; minimal token-driven diffs.

Related issue

Relates to #43 — the equilibrium overlay control is disabled/"(coming soon)" until
its backend node lands; the contract branch is intentionally retained.

Type of change

  • Analysis core (src/magnetics/core)
  • Data source (src/magnetics/data)
  • Service / API (src/magnetics/service)
  • Web GUI (gui/web)
  • Docs
  • Other

What changed

  • Perf: per-field useStore selectors so the shell no longer re-renders on every
    time-cursor scrub (App didn't read cursorMs).
  • Honesty: the "live backend" badge keys off the backend's per-machine mock flag
    (was !!API_BASE, which reads "live" over a mock machine list); RotatingTab's
    data-source label follows suit. Adds mock?: boolean to MachineInfo.
  • UI states: SensorsTab empty state for incomplete geometry meta; RotatingTab
    "computing mode map…" placeholder + persistent scrubber while the heavy mode_number
    STFT loads; ErrorBoundary retry; PullControl shot validation (+ inputMode/
    aria-invalid); equilibrium control disabled + "(coming soon)" (Add real equilibrium (LCFS / flux-surface) plotting to the Sensors view #43).
  • Accessibility: keyboard-operable tabs / shot list / resize divider / collapse
    headers; aria-pressed toggles; slider labels; role=status/aria-live +
    role=progressbar on the live-pull progress.
  • Docs/tests: qsTransforms.phiPeak docstring corrected (signed argmax is the
    intended, physically-correct behavior) + a signed-vs-|·| test; ErrorBoundary retry
    test; cross-tab theme-sync store listener + tests.

How I tested it

In gui/web: npm run lint / npm run typecheck / npm test (28 passed) /
npm run build → all green. (The >500 kB chunk warning is pre-existing/plotly.)

Checklist

  • CI is green (analysis: ruff + pytest; web: lint + build) — validated locally
  • No secrets/credentials committed
  • No large files or tokamak data committed
  • Physics kept in core (device-agnostic); none added to service routes
  • Docs updated if behavior/usage changed (n/a — no user-facing usage change)

🤖 Generated with Claude Code

Adopts the existing theme.css token system; minimal token-driven diffs.

- Perf: per-field useStore selectors so the shell no longer re-renders on every
  time-cursor scrub.
- Honesty: the "live backend" badge keys off the backend's per-machine `mock` flag
  (was !!API_BASE, which reads "live" over a mock machine list); RotatingTab label
  follows suit. Adds mock?: boolean to MachineInfo.
- UI states: SensorsTab empty state for incomplete geometry meta; RotatingTab
  "computing mode map…" placeholder + persistent scrubber while mode_number loads;
  ErrorBoundary retry; PullControl shot validation (+ inputMode/aria-invalid);
  equilibrium control disabled + "(coming soon)" while its node is absent (#43).
- a11y: keyboard-operable tabs / shot list / resize divider / collapse headers;
  aria-pressed toggles; slider labels; role=status/aria-live + progressbar on the
  live-pull progress.
- Docs/tests: qsTransforms.phiPeak docstring corrected (signed argmax is intentional)
  + signed-vs-|·| test; ErrorBoundary retry test; cross-tab theme-sync store listener
  + tests. Frontend 28 tests pass; lint/typecheck/build green.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant