Skip to content

fix: correctness quick-wins (batch A) — prod WASM opt, error surfacin…#67

Draft
diegokingston wants to merge 1 commit into
mainfrom
fix/quickwins-batch-a
Draft

fix: correctness quick-wins (batch A) — prod WASM opt, error surfacin…#67
diegokingston wants to merge 1 commit into
mainfrom
fix/quickwins-batch-a

Conversation

@diegokingston

Copy link
Copy Markdown
Collaborator

…g, a11y, type/report bugs

Six independent fixes, all present on current main:

  • deploy-gh-pages.yml: drop --no-opt so the PRODUCTION WASM solver runs wasm-opt (binaryen) — the shipped binary was unoptimized (~15-40% slower/larger). CI keeps --no-opt for build speed.
  • Toolbar.svelte (2D + 3D): solveCombinations{,3D} returning a string error (e.g. a load case is a mechanism) was silently dropped while the success toast fired anyway. Now surface the error.
  • WhatIfPanel.svelte: four catch {/ignore/} blocks + silent string-error returns hid every singular/instability during what-if exploration, leaving stale results with no feedback. Capture and show it inline (a toast per 60ms re-solve tick would spam); clear on close.
  • App.svelte: toast container had no live-region semantics. Each toast now announces to screen readers — errors assertive (role=alert), rest polite (role=status), aria-atomic.
  • auto-verify.ts / verification-service.ts: AutoVerifyModelData declared its section/material maps too narrowly (no a/iz/iy/j/e), so the steel path read material.e / section.a etc. as TS2339 (runtime was fine — callers pass full objects). Widen the type to the optional fields actually read, add a presence guard in the steel path (narrows the types + skips malformed input), and drop three as any casts (fu/tw/tf).
  • calc-report.ts: the element table read e.hingeStart/hingeEnd (removed in the typed-Release migration) → the hinge column was always "—". Use releaseI/releaseJ.mz.

Verified: vite build passes; auto-verify + calc-report suites green; the #2 TS2339s are resolved with no new errors. (Pre-existing, left as-is: harmless d.uy/d.rz legacy-field fallbacks in the calc-report 2D table, and some unused imports.)

…g, a11y, type/report bugs

Six independent fixes, all present on current main:

- deploy-gh-pages.yml: drop --no-opt so the PRODUCTION WASM solver runs wasm-opt
  (binaryen) — the shipped binary was unoptimized (~15-40% slower/larger). CI
  keeps --no-opt for build speed.
- Toolbar.svelte (2D + 3D): solveCombinations{,3D} returning a string error
  (e.g. a load case is a mechanism) was silently dropped while the success toast
  fired anyway. Now surface the error.
- WhatIfPanel.svelte: four catch {/*ignore*/} blocks + silent string-error
  returns hid every singular/instability during what-if exploration, leaving
  stale results with no feedback. Capture and show it inline (a toast per 60ms
  re-solve tick would spam); clear on close.
- App.svelte: toast container had no live-region semantics. Each toast now
  announces to screen readers — errors assertive (role=alert), rest polite
  (role=status), aria-atomic.
- auto-verify.ts / verification-service.ts: AutoVerifyModelData declared its
  section/material maps too narrowly (no a/iz/iy/j/e), so the steel path read
  material.e / section.a etc. as TS2339 (runtime was fine — callers pass full
  objects). Widen the type to the optional fields actually read, add a presence
  guard in the steel path (narrows the types + skips malformed input), and drop
  three `as any` casts (fu/tw/tf).
- calc-report.ts: the element table read e.hingeStart/hingeEnd (removed in the
  typed-Release migration) → the hinge column was always "—". Use
  releaseI/releaseJ.mz.

Verified: vite build passes; auto-verify + calc-report suites green; the #2
TS2339s are resolved with no new errors. (Pre-existing, left as-is: harmless
d.uy/d.rz legacy-field fallbacks in the calc-report 2D table, and some unused
imports.)
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