pediatric-ai-scribe-v3/public/js/bedside
Daniel f4140d45c4 feat(ui-state): persist sub-pill selections across reload + sign-out
Tab-level choice (ped_last_tab) already survived sign-out/in via
localStorage, but sub-pill and sub-tab selections inside a loaded tab
lived only in memory — they reset to defaults after a reload or
browser restart. Now the following are persisted under the ped_ui/
namespace:

  - Calculators nav pill (BP / BMI / GCS / …)
  - Bedside sub-pill (neonatal / airway / …)
  - Well Visit sub-tab (byvisit / milestones / shadess / note)
  - Physical Exam Guide age group + system

Implementation:
- Added public/js/ui-state.js — a ~30-line window.UIState wrapper
  around localStorage with a ped_ui/ prefix and try/catch around both
  read and write (Safari private mode + quota errors silently no-op).
- Each tab's click handler now also calls UIState.set; each tab's
  init path calls UIState.get and replays the saved value through
  the same function a click would call — so there is exactly one
  code path for "show this selection", whether it came from the user
  or from a restore. For Bedside, the restore additionally listens
  for tabChanged so the lazy-loaded HTML is guaranteed to exist by
  the time we re-activate the pill.

Tests:
- e2e/tests/ui-state-persistence.spec.js — 5 specs × 2 viewports =
  10 tests. Each clicks the feature, reloads the page, and asserts
  the same pill / subtab / dropdown value is still active. Catches
  any future regression in the persistence wiring.
- e2e/tests/soap-hospital-workflow.spec.js — fills SOAP transcript,
  generates via mocked AI, clears, opens/closes load popovers; also
  smoke-tests the Hospital Course save-bar.

Suite: 250 passed / 0 failed (+ 20 over the last run).
2026-04-23 18:58:38 +02:00
..
age-weight.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
agitation.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
airway.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
anaphylaxis.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
antiemetics.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
antimicrobials.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
burns.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
cardiac.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
image-lightbox.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
index.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
neonatal.js fix(neonatal): replace rounded Fenton 2013 LMS with peditools-validated values 2026-04-22 05:52:00 +02:00
respiratory.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
sedation.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
seizure.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
sepsis.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
shared.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
sub-nav.js feat(ui-state): persist sub-pill selections across reload + sign-out 2026-04-23 18:58:38 +02:00
toxicology.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
trauma.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00
ventilation.js feat: C — extract Bedside reference into ES modules 2026-04-20 23:19:50 +02:00