Skip to content

Convert application from Angular to React#523

Open
dylan-smith wants to merge 1 commit into
masterfrom
convert-angular-to-react
Open

Convert application from Angular to React#523
dylan-smith wants to merge 1 commit into
masterfrom
convert-angular-to-react

Conversation

@dylan-smith

Copy link
Copy Markdown
Owner

Summary

  • Replaces the Angular 21 + Angular Material + Karma stack with React 19 + MUI 7 + Vite 7 + Vitest + Zustand
  • Every external contract is preserved so CI.yml is unchanged: dev server on port 4200, build output at dist/dive-intelligence/browser, junit/cobertura artifacts at the paths the coverage steps read, and the same npm script names (start, build, lint, ci-test, deploy, playwright)
  • The Bühlmann ZHL-16C engine ported verbatim as plain TypeScript; BreathingGas cached fields became getters, which eliminated the hand-rolled settings subscriber pattern. App state is a single Zustand store holding a stable mutable DivePlanner with a version counter for React invalidation
  • All 27 components rebuilt with MUI, deliberately keeping font-based Material Icons and the class names the Playwright page objects select on; page objects updated for the MUI DOM (mat-icon.material-icons, mat-list-itemli + .MuiListItemText-*, etc.)
  • DivePlannerService spec ported to Vitest (the 28 empty component spec stubs were dropped); Playwright e2e suite retained as the behavioral safety net

Test plan

  • npm run ci-test — 4/4 engine tests pass; junit + cobertura emitted at CI-expected paths
  • npm run lint and npm run build — clean; output contains assets/config.json + sourcemaps for the instrumentation-key injection and sourcemap upload steps
  • npx playwright test --project=chromium — all 3 scenarios pass against the dev server (including the full deco-dive-to-100m assertions)
  • NDL scenario re-run against the production build via vite preview — passes
  • CI: firefox/webkit Playwright projects + preview-site deploy (not runnable locally)

🤖 Generated with Claude Code

Replace the Angular 21 + Angular Material + Karma stack with React 19 +
MUI 7 + Vite 7 + Vitest + Zustand while keeping every external contract
intact: dev server port 4200, build output at dist/dive-intelligence/browser,
and unit-test junit/cobertura artifact paths, so CI.yml is unchanged.

- Buhlmann engine ported verbatim as plain TypeScript; BreathingGas cached
  fields became getters, removing the hand-rolled settings subscriber list
- App state: single Zustand store holding a stable mutable DivePlanner with
  a version counter for React invalidation
- 27 Angular components rebuilt as React + MUI, keeping font-based Material
  Icons and class names the Playwright page objects rely on
- Plotly charts share a PlotlyChart wrapper (element refs, purge cleanup)
  with a MUI Dialog enlarged view
- DivePlannerService spec ported to Vitest (28 empty spec stubs dropped);
  Playwright page objects updated for the MUI DOM

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Unit Test Results

4 tests   - 2   4 ✅  - 2   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit f73c1a1. ± Comparison against base commit f3fabc1.

This pull request removes 6 and adds 4 tests. Note that renamed tests count towards both.
Chrome_Headless_143_0_0_0_(Linux_0_0_0).AppComponent ‑ AppComponent should create the app
Chrome_Headless_143_0_0_0_(Linux_0_0_0).AppComponent ‑ AppComponent should have as title 'dive-intelligence'
Chrome_Headless_143_0_0_0_(Linux_0_0_0).DivePlannerService ‑ DivePlannerService 30m for 25 mins on nitrox 32
Chrome_Headless_143_0_0_0_(Linux_0_0_0).DivePlannerService ‑ DivePlannerService NDL accounts for on-gassing during ascent
Chrome_Headless_143_0_0_0_(Linux_0_0_0).DivePlannerService ‑ DivePlannerService deco dive breaking the limits
Chrome_Headless_143_0_0_0_(Linux_0_0_0).DivePlannerService ‑ DivePlannerService with no segments on air
src/app/dive-planner-service/DivePlanner.test.ts ‑ DivePlanner > 30m for 25 mins on nitrox 32
src/app/dive-planner-service/DivePlanner.test.ts ‑ DivePlanner > NDL accounts for on-gassing during ascent
src/app/dive-planner-service/DivePlanner.test.ts ‑ DivePlanner > deco dive breaking the limits
src/app/dive-planner-service/DivePlanner.test.ts ‑ DivePlanner > with no segments on air

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

This PR has been deployed to a preview site for testing.

This site will automatically be deleted when the PR is merged.

Last deployed: 2026-07-14T15:50:59Z (UTC)

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

UI Test Results

1 files  ±0  9 suites  ±0   3m 8s ⏱️ +11s
3 tests ±0  3 ✅ ±0  0 💤 ±0  0 ❌ ±0 
9 runs  ±0  9 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f73c1a1. ± Comparison against base commit f3fabc1.

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown

Unit Tests Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
src 0% 0%
src.app 0% 0%
src.app.charts 0% 0%
src.app.components 0% 0%
src.app.dive-planner-service 78% 93%
src.app.pages 0% 0%
src.app.utility 55% 100%
Summary 28% (768 / 2741) 80% (196 / 244)

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