Skip to content

fix: cleanup pass — HUD crash, fresh-install tests, cross-platform dev scripts - #27

Merged
authorTom merged 1 commit into
mainfrom
fix/cleanup-pass
Jul 16, 2026
Merged

fix: cleanup pass — HUD crash, fresh-install tests, cross-platform dev scripts#27
authorTom merged 1 commit into
mainfrom
fix/cleanup-pass

Conversation

@authorTom

Copy link
Copy Markdown
Owner

Summary

Full review-and-cleanup pass across the codebase. Fixes two runtime bugs, a missing style, and makes the test/dev scripts work on fresh installs and non-Windows machines.

Runtime fixes

  • Run HUD crash: clicking Run on a scenario without progression phases (created via the API or a minimal backup import) threw Cannot read properties of undefined (reading 'map'). The HUD now defaults to an empty timeline.
  • ECG animation leak: the HUD's requestAnimationFrame loop kept redrawing the ECG strip after navigating away, burning CPU behind other views. It now halts when the user leaves the HUD (re-entry always re-renders, so nothing is lost).
  • Missing .badge-danger CSS class: used by the scenario detail view for the ASPiH "Not Met" badge, but never defined — unmet standards rendered as unstyled text.

Test & dev-script fixes

  • npm test failed on fresh installs: seeded accounts start on a provisional password and the server blocks all other endpoints until it is rotated, so every test after login failed with 403 on a new deployment. The suite now completes the rotation via the API, ending back on the documented password.
  • Puppeteer scripts were Windows-only: test-ui-save.js and capture-screenshots.js searched only C:\Program Files\... for Chrome (including a hardcoded C:\Users\thom path). Discovery now covers macOS/Linux/Windows with a CHROME_PATH override, and both scripts run the same password-rotation preflight. Shared logic extracted to dev-helpers.js (dockerignored, never shipped in the image).
  • Test target port overridable via PORT env var; dead native-confirm dialog handler removed from the screenshot script.

Housekeeping

  • engines bumped to Node >=18 (fetch usage, puppeteer-core 25 requires it, Node 16 is EOL).

Test plan

  • node --check clean on all JS files
  • QA suite: 37/37 pass against existing data
  • QA suite: 37/37 pass against a seeded fresh install (both accounts on forced rotation) — previously failed with 403s
  • test-ui-save.js headless Chrome UI test passes on macOS (previously could not locate Chrome)

🤖 Generated with Claude Code

…v scripts

- Guard Run HUD against scenarios without progression phases (crashed on
  minimal/imported scenarios)
- Stop the ECG requestAnimationFrame loop when leaving the HUD view
- Add missing .badge-danger CSS class (ASPiH "Not Met" badge was unstyled)
- Make test-qa.js work on fresh installs by completing the forced
  provisional-password rotation via the API before exercising endpoints
- Replace Windows-only Chrome discovery in puppeteer scripts with
  cross-platform lookup (macOS/Linux/Windows) plus CHROME_PATH override;
  shared helpers extracted to dev-helpers.js (dockerignored)
- Preflight the same password rotation in test-ui-save.js and
  capture-screenshots.js; drop dead native-confirm dialog handler
- Allow overriding the test target port via PORT env var
- Bump engines to Node >=18 (fetch usage, puppeteer-core 25, Node 16 EOL)

Verified: 37/37 QA tests pass against existing data and a seeded fresh
install; headless Chrome UI save test passes on macOS.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@authorTom
authorTom merged commit ee56ffd into main Jul 16, 2026
1 check passed
@authorTom
authorTom deleted the fix/cleanup-pass branch July 16, 2026 21:50
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