From 1431498fd63299abcce8c1768c3f2d3ebef8b574 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 23 Apr 2026 16:27:21 +0200 Subject: [PATCH] feat(nav): promote Bedside to its own tab; reorganise sidebar sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bedside is now a top-level tab instead of a sub-pill inside Calculators — it's the highest-traffic emergency reference in the app and deserves a one-click entry. Same DOM structure and JS modules; only the container moved. Sidebar reorg: - Notes: Hospital Course, Chart Review, SOAP Note, Well Visit, Sick Visit (Well Visit + Sick Visit relocated from the old "Pediatric" group — they're clinical note workflows, not pure reference tools). - Section rename: "Pediatric" → "Clinical Tools". The section now holds Vaccine Schedule, Catch-Up Schedule, Physical Exam Guide, Bedside, Calculators, Pagers & Extensions, Learning Hub, Content Manager — mix of reference tables + active calculators + utilities, none strictly pediatric. "Clinical Tools" reads naturally for the combined set. Layout changes: - calculators.html: dropped 480 lines of bedside panel + the Bedside nav-pill. The shared age→weight estimator moved with it. - bedside.html: new component file, contains the full bedside card + the age→weight estimator prepended. - index.html: added bedside-tab section, sidebar restructured. - e2e-harness.html: renders calculators + bedside side-by-side (not the old calc-tab→bedside-pill dance) so the bedside smoke suite still works without auth. e2e-bootstrap fetches both with a cache-buster. - bedside-smoke.spec.js: removed the now-obsolete calc-nav-pill click from each test. Tab persistence is unchanged — ped_last_tab already survives sign-out, and the lazy-load cache keeps sub-pill state across navigation within a session. Persistence across browser restart for sub-pills is a separate follow-up. --- e2e/tests/bedside-smoke.spec.js | 15 +- public/components/bedside.html | 523 ++++++++++++++++++++++++++++ public/components/calculators.html | 526 ----------------------------- public/e2e-harness.html | 5 + public/index.html | 15 +- public/js/e2e-bootstrap.js | 14 +- 6 files changed, 557 insertions(+), 541 deletions(-) create mode 100644 public/components/bedside.html diff --git a/e2e/tests/bedside-smoke.spec.js b/e2e/tests/bedside-smoke.spec.js index 2793e43..3d20e3a 100644 --- a/e2e/tests/bedside-smoke.spec.js +++ b/e2e/tests/bedside-smoke.spec.js @@ -1,21 +1,22 @@ // Bedside module smoke tests. -// Each test navigates to the Calculators tab, opens Bedside, clicks the target -// sub-pill, and asserts a known string is rendered. Catches "button doesn't -// fire / section goes blank" regressions. +// The harness renders the Calculators + Bedside components side-by-side, so +// each test selects the target sub-pill (if any) and asserts a known string +// is rendered. Bedside was promoted to a top-level tab, so there is no longer +// a calc-nav-pill[data-calc="bedside"] — the panel is always visible in the +// harness and always the full tab in the live app. const { test, expect } = require('@playwright/test'); -// Helper — open Calculators tab + Bedside panel + (optionally) a sub-pill async function openCalculators(page) { await page.goto('/e2e-harness.html'); await page.waitForFunction(() => window.__harnessReady === true); - // Give the async innerHTML injection + JS init one more microtask tick - await page.waitForSelector('button.calc-nav-pill[data-calc="bedside"]'); + // Wait for the bedside component to finish injecting — #bedside-age is the + // first input in the shared age→weight estimator at the top of the tab. + await page.waitForSelector('#bedside-age'); } async function openBedside(page, subPill) { await openCalculators(page); - await page.click('button.calc-nav-pill[data-calc="bedside"]'); if (subPill) { await page.click(`button.calc-pill[data-em="${subPill}"]`); } diff --git a/public/components/bedside.html b/public/components/bedside.html new file mode 100644 index 0000000..c2c936b --- /dev/null +++ b/public/components/bedside.html @@ -0,0 +1,523 @@ + + +
+
Age → Weight estimator
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
Estimator only — copy the weight into whichever calculator you need.
+ + +
+ Weight-estimation formulas +
+
APLS (Luscombe & Owens 2007 / APLS-UK 2016)
+
+ • 0-12 months: (0.5 × age in months) + 4
+ • 1-5 years: (2 × age in years) + 8
+ • 6-12 years: (3 × age in years) + 7 +
+
Best Guess (Tinning & Acworth 2007)
+
+ • 1-11 months: (age in months + 9) / 2
+ • 1-4 years: 2 × (age in years + 5)
+ • 5-14 years: 4 × age in years +
+
Broselow tape (length-based) is most accurate when available.
+
+
+
+
+
+

Bedside

+ Weight-based pediatric reference. Always verify against institutional protocols. +
+
+
+ + + + + + + + + + + + + + + +
+ + +
+

Neonatal Assessment

+

GA classification, birth weight assessment (AGA/SGA/LGA), and prematurity category. Fenton 2013 / WHO.

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ NRP Resuscitation Pathway +

AHA Neonatal Resuscitation Program 2020. Static visual pathway — enter weight to calculate drug doses.

+
+ +
+
+
+
+ + +
+ +
+
+
+ + +
+

Apgar Score

+

Assess at 1 and 5 minutes. If <7 at 5 min, repeat every 5 min up to 20 min. Apgar is a description — never delay resuscitation waiting for a score.

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/public/components/calculators.html b/public/components/calculators.html index be0c320..41f5f15 100644 --- a/public/components/calculators.html +++ b/public/components/calculators.html @@ -15,53 +15,8 @@ - - -
-
Age → Weight estimator
-
-
- - -
-
- - -
-
- - -
- -
-
-
Estimator only — copy the weight into whichever calculator you need.
- - -
- Weight-estimation formulas -
-
APLS (Luscombe & Owens 2007 / APLS-UK 2016)
-
- • 0-12 months: (0.5 × age in months) + 4
- • 1-5 years: (2 × age in years) + 8
- • 6-12 years: (3 × age in years) + 7 -
-
Best Guess (Tinning & Acworth 2007)
-
- • 1-11 months: (age in months + 9) / 2
- • 1-4 years: 2 × (age in years + 5)
- • 5-14 years: 4 × age in years -
-
Broselow tape (length-based) is most accurate when available.
-
-
-
@@ -696,487 +651,6 @@
- -