[P3] Unit changes leave the safety-stop target and switch-depth draft in the old units #33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Priority: P3
Type: bug
Source: project review requested 2026-10-26 (second pass)
Location:
src/App.tsx:559-566, 3032Problem and evidence
Switching imperial to metric during a simulated safety stop changes the stop depth from 4.572 m (15 ft) to 5 m; the stop is silently cancelled and the diver holds at 4.6 m indefinitely. Loading a plan saved in the other unit system calls setUnits directly, so the Advanced-mode switch-depth draft ("70" ft) becomes 70 m and Add switch fails.
Suggested correction
Record the safety-stop depth when the stop starts rather than deriving it from current units, and apply the same switch-depth conversion when a plan restores units.
Acceptance criteria
Browser regression for the unit switch during a safety stop and for restored-plan units; pnpm verify passes.
Scope: maintenance of the educational simulator. Preserve historical R1 acceptance and operational-validation limits.
Fixed on
maintenance/review-2026-10-27in137cfcf,96ec976— PR #40.Safety stop records its depth at start; restored plan units convert the switch-depth draft. Follow-up from independent review: the once-registered share-link listener now reads the latest restore callback (later same-tab links had misconverted 21.3 → 6.5). Browser regression fails without the fix.
Branch verification:
pnpm verify145 tests and release budgets; Chromium/Firefox/WebKit review, replay, compatibility and offline lifecycle checks; CI verify runs #111/#112 pass. Record:docs/MAINTENANCE-2026-10-27.md. Closes on merge of PR #40.