Skip to content

Overlay Register — LynCareOS Frontend

Version: 1.7
Last Updated: 2026-07-29 18:29:13


This register inventories every overlay, dialog, sheet, and full-screen capture flow in the LynCareOS SPA. It exists so we can sign off on functional tier (centred dialog vs task flow vs documented exception) before consolidating ~20 bespoke fixed inset-0 implementations onto shared primitives.

Reference UX (target default): LogDoseQuickMedsModal → components/ui/Modal.tsx — centred on all viewports, fade + scale, rounded cc-card, no slide-up on mobile.

Scrim recipe (agreed target — one recipe only): bg-black/45 backdrop-blur-sm.

Rationale (mobile): backdrop-filter forces the compositor to snapshot and blur the whole viewport, and cost scales with radius and painted area. backdrop-blur-sm is 4px on Tailwind 3.4 — the cheapest radius that still reads as a blur, and a real token rather than an arbitrary value such as backdrop-blur-[2px] (which cannot be linted or tokenised cleanly). The 45% tint is the deciding factor: at bg-black/70 the scrim is opaque enough to hide the blur entirely, so the GPU cost is paid for no visible benefit — the worst trade on a low-end Android. At 45% the blur is perceptible, and if backdrop-filter is unsupported the layer degrades to a legible dim. Tailwind plus autoprefixer already emit -webkit-backdrop-filter, so iOS Safari needs no special handling.

Current state: Modal.tsx is still bg-black/70 backdrop-blur-sm; BottomSheet.tsx is bg-black/40 backdrop-blur-[2px]. Neither matches the target yet — see §Mobile readiness audit.


TierNameWhen to useShared primitive
D1Centred dialogConfirmations, short forms, pickers, read-only detailModal.tsx (enhanced)
D2Tall dialogLong scroll body + optional sticky footer; still a “popup” not a pageEnhanced Modal.tsx (scroll body + footer slot)
T1Task / immersiveCamera, crop, multi-step wizard, body map captureDedicated sheet/overlay components
T2Full-screen page (mobile)Flows that are effectively a route on small screensPage shell with breakpoint split
X1Documented exceptionProduct decision to differ from D1; must cite reasonKeep bespoke or narrow primitive
—Not a dialogDecorative backdrop, dropdown dismiss layerOut of migration scope

PrimitiveFileMobileDesktopNotes
Modalcomponents/ui/Modal.tsxCentredCentredHeadless UI Dialog; preferred default
BottomSheetcomponents/ui/BottomSheet.tsxSlide-up + swipe dismissRight panel (~28rem)Portal, scroll lock; lighter blur
Bespoke hybridVariousitems-end + animate-slide-upOften centredCopy-paste pattern; primary consolidation target

Capability gaps (Modal must close before mass migration)

Section titled “Capability gaps (Modal must close before mass migration)”

Corrected 2026-07-29 17:33 after reading @headlessui/react ^2.2.9 behaviour — two gaps were already closed:

  • Portal to document.body — Headless UI Dialog portals by default
  • Body scroll lock — Headless UI Dialog applies it by default (also gives Escape-to-close and a focus trap)
  • Scrollable body region with max height (dvh-capped)
  • Sticky footer slot (primary / secondary actions)
  • Safe-area padding (env(safe-area-inset-bottom))
  • overscroll-contain on the scroll region
  • Stacking / nested dialog policy (z-index ladder) — closed 2026-07-29 17:35, see §Stacking ladder

Consequence: the 11 dialogs already on Modal inherit correct portal, scroll-lock, Escape and focus behaviour. Every bespoke overlay has to hand-roll all of it, and most do not — that is the substance of the audit below.


Modal.tsx was pinned at z-50 while sheets and page shells sit at z-[60]. Because relative z-50 opens a stacking context, every dialog opened from inside a sheet painted behind its own parent — fully occluded by the parent’s backdrop and its opaque panel. Nothing appeared on screen, yet Headless UI still moved focus into the invisible dialog, and Escape then closed both it and the parent. The trigger looked like a dead button wired to nothing.

Live at the time of the fix:

TriggerDialogParentVisible symptom
Log a dose → Edit quick picksLogDoseQuickMedsModalLogDosePageShell z-[60]Desktop ≥1024px only: no response at all. Worked on mobile, where the shell renders as a plain page with no wrapper — which is why it shipped as “Delivered”
Log a dose / alert row → reaction detailAdverseReactionDetailModalLogDosePageShell, AlertInbox panelRegressed by the MED-04 migration in v1.2
Add items → delete saved cardDeleteCardConfirmDialogAddItemsSheet → BottomSheetRegressed by the SHOP-08 migration in v1.2

VitalEntryModal (PAIN-01, also migrated in v1.2) was unaffected — it opens from page content, with no overlay parent.

Tiers are named in frontend/tailwind.config.js under theme.extend.zIndex, following the same “named scale enforced via config” pattern as the typography scale. Use the named class; do not introduce new arbitrary z-[N] for overlays.

RungClassValueUsed for
Chromez-chrome40Fixed app chrome — mobile top bar, nav
Popoverz-popover50Anchored dropdowns, selects, click-away layers
Sheet backdropz-sheet-backdrop55Dimmer behind a sheet or side panel
Sheetz-sheet60BottomSheet panel, LogDosePageShell, AlertInbox desktop panel
Dialogz-dialog100Modal.tsx — opened from page content or from a sheet
Taskz-task200Immersive capture opened from a dialog — ImagePickerSheet, CropImageSheet
Interruptz-interrupt1100App-level interrupt — UpgradeGate, WelcomeModal, idle warning
Notificationz-notification9999Transient hints and toasts

Ordering rule: an overlay may only open into a higher tier — never a lower or equal one. A Modal that needs to launch a camera or crop step must use the task rung, not another dialog. ImagePickerSheet (was 80) and CropImageSheet (was 70) moved up to task for exactly this reason: today they are only opened from bespoke sheets, but SHOP-05 ShoppingListRow is slated to become a Modal, which would have occluded them. They share one rung safely because both call sites unmount the picker before opening the crop step.

Portaled overlays (createPortal to document.body, or Headless UI Dialog) leave their parent’s stacking context and compete on the global ladder — they must use a named rung (z-sheet, z-dialog, etc.).

Inline overlays and inline panels (e.g. a clock face expanding inside an open dialog, a nested sheet rendered as a child of its parent overlay) are scoped by the parent’s stacking context. Their z-index is relative to siblings inside that parent only; they do not need an absolute rung number to beat unrelated overlays elsewhere in the app.

ClockPickerField (2026-07-29) was corrected to always render its panel inline inside its container. The previous mobile-only portal to document.body at zIndex: 60 painted behind Modal at z-dialog (100) on phones. Desktop already used the inline path — mobile now matches.

ESLint (no-restricted-syntax on src/pages/** and src/components/**) rejects new fixed inset-0 overlays that use arbitrary z-[N]. Files listed in §Raw z-index exceptions are grandfathered until migration.

Bespoke overlays keep their own values until their migration row lands. Deliberate exceptions worth knowing:

  • FirstDoseReactionModal z-[70] sits between sheet and dialog on purpose: it opens over the log-dose shell, and the Modal-based AdverseReactionDetailModal it can launch must land above it. Explicit ordering here is more robust than giving both the dialog rung and relying on DOM order as the tie-break. Revisit with MED-03.
  • ConditionPackPreviewDialog, CancelSubscriptionDialog z-[1000] drop to z-dialog on migration — both open from plain pages, so nothing needs to stack above them.
  • CareCaptureOverlay z-[1100] is a task (T1) parked on the interrupt value; it opens from a page, so re-tiering is cosmetic.
  • The VitalsCaptureSheet / MobileTopBar z-40 tie (defect theme 5) closed 2026-07-29 — VitalsCaptureSheet moved to z-sheet (60), above z-chrome (40) mobile top bar.

These files still use arbitrary z-[N] on fixed inset-0 overlays. ESLint excludes them until each row migrates. Map nested chains explicitly — do not blanket-rename.

FileCurrentTarget rungNotes
CancelSubscriptionDialog.tsxz-[1000]z-dialogOpens from plain page
UpgradeGate.tsxz-[1100]z-interruptApp-level gate
WelcomeModal.tsxz-[1100]z-interruptApp-level gate
CareCaptureOverlay.tsxz-[1100]z-taskFull-screen capture (T1)
ConditionPackPreviewDialog.tsxz-[1000]z-dialogOpens from plain page
FamilyHelpBoardPopup.tsxz-[55]z-sheet-backdrop + z-sheetHybrid popup
GroupDispenseModal.tsxz-[60]z-dialogNested under CellSheet z-50 — map chain
FirstDoseReactionModal.tsxz-[70]keep between sheet/dialogDeliberate — see above
ScanFlow.tsx (nested step)z-[60]z-dialogNested inside parent z-50 step
admin/Subscriptions.tsxz-[1000]z-dialogAdmin modal
history/HistoryView.tsxz-[1100]z-interruptHistory-lock upgrade prompt

Bare z-50 / z-60 (no brackets) — not yet ESLint-guarded; still tracked for migration: IntakeOutputInlineCapture, CellSheet, GroupModal, ScriptActionSheet, EditScriptModal, FillModal, NewListModal, AddCustomProductSheet, AutoDispense, ImageOverlay, ScanFlow (outer step).


Method (2026-07-29 17:33): static census of frontend/src for scrim signatures (fixed inset-0 + dark tint), viewport units, createPortal, document.body.style.overflow, overscroll-contain, env(safe-area-inset-*), role="dialog" / aria-modal, Escape handlers, and z-index values. Not verified: behaviour on physical devices, touch-target sizes, and the inner content of the 7 overlays that sit on BottomSheet (they inherit the primitive’s behaviour, but their bodies were not individually inspected).

1. vh instead of dvh — 8 overlays (highest impact). On iOS Safari 100vh is the largest viewport (URL bar retracted), so a max-h-[90vh] panel is taller than the visible area whenever the URL bar is showing, pushing the save/confirm row off-screen with no way to reach it. Offenders: ScanFlow (95vh), CellSheet (90vh), ConditionPackPreviewDialog (90vh), FamilyHelpBoardPopup (92vh), NewFamilyHelpRequestModal (70vh), LogDoseQuickMedsModal (50vh), CancerPrimarySitePicker (45/55vh), ImageOverlay (90vh). Already correct: IntakeOutputInlineCapture, LogDosePageShell, EditScriptModal, CareCaptureOverlay, BottomSheet, admin/Subscriptions.

2. No body scroll lock — ~19 bespoke overlays. The page scrolls behind the sheet under a touch drag, and on iOS the reading position is lost on dismiss. Only LogDosePageShell, CareCaptureOverlay, BottomSheet and the Headless UI Modal lock scroll. Note IntakeOutputInlineCapture (urine/bowel) portals and caps height correctly but does not lock scroll.

3. No portal — ~19 bespoke overlays. position: fixed resolves against the nearest transformed or filtered ancestor, so an inline fixed inset-0 can be offset or clipped inside Layout’s scroll container and the isolate / z-stacking contexts in PainBodyMapTab. The original VitalEntryModal header comment documented exactly this hazard; it is now handled for that file by Headless UI, but not for the bespoke set.

4. No overscroll-contain on scroll bodies — all but 4. Reaching the end of a modal list rubber-bands and scroll-chains to the page behind on iOS. Present only in IntakeOutputInlineCapture, CareCaptureOverlay, BottomSheet, CancerPrimarySitePicker.

5. Ad-hoc z-index ladder — no tokens. Partly fixed 2026-07-29 17:35 — tailwind.config.js now defines a named zIndex scale and the overlay tiers that matter are on it (see §Stacking ladder). This was not a latent risk: Modal at z-50 sat below the z-[60] sheets that open it, so three dialogs were invisible in production. Still open: VitalsCaptureSheet (z-40, not portaled) ties MobileTopBar (z-40), so paint order depends only on DOM order — fragile and needs device verification; and SleepSelectionHint (z-[9999]) plus the ScheduledDosesStrip tooltip (z-[6000]/z-[8000]) sit above every dialog including the interrupt tier.

6. Scrim fragmentation — 6 recipes plus 9 with no blur. bg-black/70 blur-sm (Modal, 11 dialogs), bg-slate-900/60 blur-sm (4 bespoke), bg-black/45 blur-sm (2), bg-black/40 blur-sm (2), bg-black/40 blur-[2px] (BottomSheet), bg-slate-900/40 blur-[2px] (2), bg-black/30 blur-[2px] (1); the whole scripts/medication family plus FamilyHelpBoardPopup use a plain tint with no blur.

7. Mobile layout split. The scripts/medication family and the shopping sheets use items-end + animate-slide-up on mobile; Modal, UpgradeGate, WelcomeModal and LogDosePageShell centre on all viewports. Doc reference UX says centred — each surviving slide-up needs an X1 justification or migration.

8. Keyboard and a11y. Escape-to-close is hand-rolled in only 4 bespoke files; 14 files declare role="dialog" / aria-modal. Bespoke sheets have no focus trap, so keyboard and screen-reader users can reach the page behind the scrim.

9. Touch targets — close buttons and secondary icon buttons systematically undersized. (Added 2026-07-29 17:50 — closes the “touch targets not audited” caveat from v1.3.) Standard per 03-DESIGN-SYSTEM.md is ≥44px, 48px for primary. Primary actions comply almost everywhere because .btn / .cc-btn / .input bake in min-h-[44px] / 48px. The failure is concentrated in dismiss and secondary controls, and every dialog has one:

ComponentElementRendered size
ui/BottomSheetClosecc-icon-chip w-9 h-9 → 36×36 (inherited by all 7 consumers)
AlertInboxClose (desktop panel)w-9 h-9 → 36×36
NewListModalClosew-9 h-9 → 36×36
AddItemsSheetClear searchw-9 h-9 → 36×36
ShoppingListRowCompact qty −/+w-9 h-9 → 36×36 (desktop branch; mobile branch is w-12 h-12 ✓)
LogDosePageShellClosep-2 + 18px icon → ~34×34
FamilyHelpBoardPopupClosep-2 + 18px icon → ~34×34
ConditionPackPreviewDialogClosep-2 + 18px icon → ~34×34
UpgradeGateClosep-1 + icon → ~32×32
IntakeOutputInlineCaptureClosep-1.5 + 15px icon → ~27×27
IntakeOutputSectionDelete entryp-1.5 + 13px icon → ~25×25 (smallest found)

Root cause: the shared .cc-icon-chip primitive is w-10 h-10 — 40px, already 4px under standard — and callers routinely shrink it further to w-9 h-9. Fixing the primitive to 44px and removing the caller overrides clears five of the rows above in one change.

Compliant references: VitalsCaptureSheet close (w-11 h-11), ShoppingListRow mobile controls (w-12 h-12 / w-11 h-11), FamilyHelpDetailSheet actions (!min-h-[48px]), AddItemsSheet search input (!min-h-[48px]).

One case static reading cannot settle: ui/Modal’s close button is btn-ghost p-1.5 with a 16px icon. .btn-ghost extends .btn, which sets both min-h-[44px] and px-4, then p-1.5 overrides padding. Height is therefore ≥44px, but the final horizontal box is somewhere between ~28px and ~48px depending on which padding utility wins in the compiled sheet. This needs a rendered measurement, not a source read.

10. BottomSheet consumer bodies are the healthiest surfaces in the app. (Closes the second v1.3 caveat.) All 7 consumers were inspected — AddItemsSheet, ShoppingListRow, FamilyHelpDetailSheet, AlertInbox, CalendarView, Schedule, Layout (person picker). They inherit correct portal, scroll lock, Escape, overscroll-contain, dvh cap and safe-area padding from the primitive, and their primary actions are explicitly 48px. Only two content defects were found, both listed in theme 9: AddItemsSheet’s clear-search chip and ShoppingListRow’s compact stepper branch. The one defect all 7 share is the primitive’s own 36px close button.

Re-audit 2026-07-29 17:56 — themes re-verified against the working tree

Section titled “Re-audit 2026-07-29 17:56 — themes re-verified against the working tree”

Every theme above was re-checked after the v1.4 z-index work. Themes 1, 2, 3, 4, 6, 7, 8, 9, 10 are unchanged and still accurate — same file lists, same counts. OverlayScrim.tsx and check-overlay-scrims.mjs do not exist yet, so Phase 0 (scrim unification) and the enforcement guard are still open. Modal remains bg-black/70 backdrop-blur-sm; BottomSheet remains bg-black/40 backdrop-blur-[2px].

Two findings sharpened:

Theme 5 revised — the ladder exists but adoption stalled at 6 files, and the raw values now conflict with it. On the ladder: Modal (z-dialog), BottomSheet, AlertInbox, LogDosePageShell (z-sheet), ImagePickerSheet, CropImageSheet (z-task). Roughly 20 overlays are still on raw values that no longer map to any rung — z-50 (ScanFlow, ScriptActionSheet, GroupModal, CellSheet, EditScriptModal, FillModal, AutoDispense, NewListModal, AddCustomProductSheet, ImageOverlay, IntakeOutputInlineCapture), z-[55] (FamilyHelpBoardPopup panel — sitting on the backdrop rung), z-[60] (GroupDispenseModal, ScanFlow’s nested step), z-[70] (FirstDoseReactionModal), z-[1000] (ConditionPackPreviewDialog, CancelSubscriptionDialog, admin/Subscriptions — no rung at 1000), z-[1100] (UpgradeGate, WelcomeModal, HistoryView bespoke, CareCaptureOverlay).

Latent recurrence of the exact bug v1.4 fixed. Modal now sits at z-dialog (100). Any overlay above 100 that opens a Modal will hide it the same way LogDoseQuickMedsModal was hidden. Seven overlays are above the dialog rung on raw values: ConditionPackPreviewDialog, CancelSubscriptionDialog, admin/Subscriptions (1000), UpgradeGate, WelcomeModal, CareCaptureOverlay and HistoryView’s bespoke overlay (1100). HistoryView is the sharpest case — its four dialogs (HIST-01…04) are on Modal at 100 while the same file renders a bespoke overlay at 1100. Also still open: VitalsCaptureSheet (z-40) and TenantSwitcher’s dismiss layer (z-40) both tie MobileTopBar on the chrome rung.

Theme 9 is broader than overlays — it is app-wide. The v1.5 pass scoped touch targets to dialogs; re-auditing every .cc-icon-chip call site shows the same deficit throughout the app on interactive chips (decorative <span> uses are out of scope): LogDoseDatePicker and FamilyHelpDatePicker month arrows (w-8 h-8 → 32px), CatalogItemManager edit/confirm/cancel/delete (four at 32px), ModuleAccessRow open-module (32px), admin/Patients remove-carer (36px), AlertBell in the app chrome and ShoppingCatalogAdmin refresh (40px). Good counter-example in the same family: LogDoseAmountField steppers use w-12 h-12 (48px). This strengthens the case for fixing .cc-icon-chip itself to 44px rather than patching call sites.

Verification status — what is proven and what is not

Section titled “Verification status — what is proven and what is not”

Verified statically (high confidence): every claim in themes 1–10 is a direct source read of frontend/src, re-checked against the working tree at 17:50. Fixed-dimension sizes (w-9 h-9, w-11 h-11) are exact; padding-plus-icon sizes are computed and marked ~.

Not verified on a device — and cannot be from the workstation. The dev stack was only partly up (backend reachable on 8021/8020, Vite on 5173 down) and the e2e harness needs E2E_USER_EMAIL / E2E_USER_PASSWORD against a seeded dev account, so no authenticated overlay was rendered.

More importantly, Chromium emulation would give a false pass on the top finding. vh and dvh diverge only where browser chrome dynamically retracts — iOS Safari and Android Chrome. In desktop Chromium, including Playwright’s Pixel 7 profile and any setViewportSize, 100vh === 100dvh, so theme 1’s clipping is invisible under emulation. The same holds for iOS rubber-band scroll chaining and for the real GPU cost of backdrop-filter. Emulation is not a substitute here.

Machine-checkable without a device (recommended additions):

  • a11y.spec.ts currently runs axe with wcag2a / wcag2aa / wcag21aa only. Target Size (Minimum) is WCAG 2.2 SC 2.5.8, tagged wcag22aa in axe-core — so theme 9 is invisible to the existing suite. Adding that tag is a one-line change that surfaces it automatically.
  • Rendered-geometry assertions in the mobile-chrome project would settle the ambiguous ui/Modal close-button width.
  • The vh, scroll-lock, portal and scrim invariants are better enforced by the proposed check-overlay-scrims.mjs text scan than by any browser, since they are source properties.

Residual device-only items → add to 22-PRODUCTION-MANUAL-QA.md: iOS Safari vh clipping with the URL bar visible (confirm the save row is reachable in ScanFlow, CellSheet, ConditionPackPreviewDialog, FamilyHelpBoardPopup); iOS rubber-band chaining on modal lists; backdrop-filter cost on a low-end Android; and VitalsCaptureSheet vs MobileTopBar paint order.

Legend: OK = correct · — = absent · n/a = not applicable to that shell

IDComponentHeight unitPortalScroll lockOverscrollScrim
MED-01LogDoseQuickMedsModal50vhOK (Modal)OK—black/70
MED-03FirstDoseReactionModaln/a———black/60 no blur
MED-05EditScriptModalOK (92dvh)———black/60 no blur
MED-06FillModaln/a———black/60 no blur
MED-07ScanFlow95vh———black/60 no blur
MED-08ImageOverlay90vh——n/ablack/90 no blur
MED-09ScriptActionSheetn/a———black/60 no blur
MED-10CellSheet90vh———black/60 no blur
MED-11GroupModaln/a———black/60 no blur
MED-12GroupDispenseModaln/a———black/60 no blur
MED-13AutoDispense → GroupConfirmModaln/a———black/60 no blur
SHOP-02AddCustomProductSheetn/a———black/40 blur-sm
SHOP-03NewListModaln/a———black/40 blur-sm
PAIN-02VitalsCaptureSheetn/a———opaque; z-40 clash
PAIN-03IntakeOutputInlineCaptureOK (90dvh)OK—OKblack/45 blur-sm
FH-01NewFamilyHelpRequestModal70vhOK (Modal)OK—black/70
FH-03FamilyHelpBoardPopup92vh———black/45 no blur
CP-01ConditionPackPreviewDialog90vh———slate-900/60 blur-sm
ALERT-01AlertInbox (desktop panel)n/a———black/30 blur-[2px]
PLAT-03WelcomeModaln/a———slate-900/60 blur-sm
PLAT-04UpgradeGaten/a———slate-900/60 blur-sm
PLAT-05CancelSubscriptionDialogn/a———slate-900/40 blur-[2px]
PLAT-06admin/SubscriptionsOK (100dvh)———slate-900/40 blur-[2px]
HIST-01HistoryView (bespoke z-1100)n/a———slate-900/60 blur-sm

Reference implementations to copy from: MED-02 LogDosePageShell (portal, scroll lock, dvh, Escape, 45% + blur-sm) and CARE-01 CareCaptureOverlay (adds overscroll-contain and full safe-area padding). PLAT-06 admin/Subscriptions is the only overlay handling all four safe-area insets.

  1. Phase 0 — enhance Modal.tsx: adopt the bg-black/45 backdrop-blur-sm scrim, add a dvh-capped scroll body with overscroll-contain, a sticky footer slot, and safe-area padding. Extract the scrim into ui/OverlayScrim.tsx so Modal and BottomSheet share one implementation. This alone fixes themes 1, 4 and 6 for all 11 dialogs already on the primitive.
  2. Phase 0b — z-index tokens: DONE 2026-07-29 17:35. zIndex scale added to tailwind.config.js; Modal moved to the dialog rung, which fixed the three occluded dialogs. Remaining from this phase: the VitalsCaptureSheet / MobileTopBar tie, and adopting named rungs in the bespoke overlays as they migrate.
  3. Phase 1 — vh → dvh sweep: mechanical, low-risk, highest mobile payoff; can ship ahead of any migration.
  4. Phase 2 — migrate the 9-file scripts/medication family off the copy-pasted bg-black/60 shell; they share one pattern, so they convert as a batch and gain portal, scroll lock and blur together.
  5. Phase 3 — remaining bespoke D1/D2 per the existing verdict column.
  6. Enforcement (with Phase 0): ESLint no-restricted-syntax banning scrim signatures outside components/ui/** and approved T1 files, plus frontend/scripts/check-overlay-scrims.mjs as a text-scan backstop wired into npm run validate:architecture alongside check-brand-touchpoints.mjs. ESLint cannot catch class strings assembled in a separate module (e.g. lib/vitalsTheme.ts), which is why the script backstop is needed.

Legend — Current shell: Modal | BottomSheet | Bespoke-centred | Bespoke-slide-up | Bespoke-hybrid (slide mobile / centred desktop) | Task | Dual-layout
Verdict: Keep | Migrate → Modal | Migrate → enhanced Modal | Keep tier T | Review
Status: Baseline (audit complete, no code change yet)

IDComponentUser goalCurrent shellFunctional needsTierVerdictStatusNotes
MED-01logDose/LogDoseQuickMedsModal.tsxEdit quick-pick meds on log-doseModalShort form, centredD1Keep (reference)Fixed 2026-07-29Gold standard for shell + content. Was unreachable on desktop — occluded by its own parent shell until Modal moved to z-dialog; see §Stacking ladder. Only entry point for quick-pick config (no Medications settings screen)
MED-02logDose/LogDosePageShell.tsxLog a dose (full flow)Dual-layoutMobile: full page; desktop ≥1024px: centred modalT2 / D1Keep tier T2z-sheet 2026-07-29Documented exception. z-[60] → z-sheet (same value); it opens MED-01 and MED-04, so it must stay below dialog
MED-03medication/FirstDoseReactionModal.tsxRecord first-dose reactionBespoke-hybridForm + validationD1Migrate → ModalBaselineNo slide-up need. Keeps z-[70] deliberately — see §Stacking ladder “Not yet on the ladder”
MED-04medication/AdverseReactionDetailModal.tsxView reaction detailModalRead-only detailD1Migrate → ModalDone 2026-07-29Swapped shell to Modal; kept coral icon chip + clinical contacts content, dropped duplicate inner heading (title now lives in Modal’s title bar). Was invisible from Log a dose and the alert panel until the z-dialog fix
MED-05scripts/EditScriptModal.tsxEdit script fieldsBespoke-hybridMedium form, scroll likelyD2Migrate → enhanced ModalBaseline
MED-06scripts/FillModal.tsxRecord script fill / restockBespoke-hybridForm + datesD2Migrate → enhanced ModalBaseline
MED-07scripts/ScanFlow.tsxScan prescription (multi-step)Bespoke-hybridWizard, camera step, nested schedule offerT1Keep tier TBaselineStack risk: wizard → schedule
MED-08scripts/ImageOverlay.tsxView scan at full resolutionBespoke-centredLightbox, tap-away dismissT1Keep tier TBaselineSame class as image lightbox
MED-09medication-schedule/ScriptActionSheet.tsxScript row actions (archive, etc.)Bespoke-slide-upAction listD1Migrate → ModalBaselineCould be action menu pattern
MED-10medication-schedule/CellSheet.tsxCell / slot detail in schedule gridBespoke-slide-upDetail + actionsD1Migrate → ModalBaseline
MED-11medication-schedule/GroupModal.tsxCreate / edit medication groupBespoke-hybridTall formD2Migrate → enhanced ModalBaseline
MED-12medication-schedule/GroupDispenseModal.tsxConfirm group dispense from scheduleBespoke-hybridConfirm + listD2Migrate → enhanced ModalBaseline
MED-13pages/AutoDispense.tsx → GroupConfirmModalConfirm “dispense all” for groupBespoke-hybridConfirm + item listD2Migrate → enhanced ModalBaselineInline component in page file
IDComponentUser goalCurrent shellFunctional needsTierVerdictStatusNotes
SHOP-01shopping/AddItemsSheet.tsxAdd items from catalogBottomSheetTall scroll, search, multi-selectD2Review → enhanced ModalBaselinePilot candidate after Modal gaps closed
SHOP-02shopping/AddCustomProductSheet.tsxAdd custom productBespoke-slide-upFormD2Migrate → enhanced ModalBaselineOften stacked on SHOP-01
SHOP-03shopping/NewListModal.tsxCreate shopping listBespoke-hybridShort formD1Migrate → ModalBaseline
SHOP-04shopping/CatalogItemEditModal.tsxEdit catalog item (admin)ModalFormD1KeepBaselineAlready on primitive
SHOP-05shopping/ShoppingListRow.tsxAdjust qty / row actionsBottomSheetStepper + actionsD1Migrate → ModalBaseline
SHOP-06shopping/ShoppingItemCard.tsx (edit qty portal)Adjust item quantity inline———RemovedDone 2026-07-29Component was dead code (only self-referenced by its own test) — ShoppingListRow is the live implementation. Deleted file + test block, no UX change (nothing rendered it)
SHOP-07shopping/ShoppingItemCard.tsx (photo lightbox)View item photo———RemovedDone 2026-07-29Same dead-code removal as SHOP-06
SHOP-08shopping/DeleteCardConfirmDialog.tsxConfirm delete saved cardModalConfirmD1Migrate → ModalDone 2026-07-29Swapped shell to Modal; same props/behaviour, no call-site changes needed. Was invisible inside SHOP-01 until the z-dialog fix — see §Stacking ladder
SHOP-09ui/ImagePickerSheet.tsxPick image (camera / gallery)TaskNative picker, full viewportT1Keep tier Tz-task 2026-07-29Used in shopping + scripts. Moved z-[80] → z-task so it stays above dialogs when SHOP-05 migrates
SHOP-10shopping/CropImageSheet.tsxCrop product photoTaskCrop UI, gesturesT1Keep tier Tz-task 2026-07-29Stack: picker → crop. Moved z-[70] → z-task; safe on one rung because both call sites unmount the picker first
IDComponentUser goalCurrent shellFunctional needsTierVerdictStatusNotes
PAIN-01pain/VitalEntryModal.tsxLog vital from body map barModalTime + value formD1Migrate → ModalDone 2026-07-29Swapped shell to Modal; removed now-redundant manual Escape handler and close button (Headless UI Dialog already provides both)
PAIN-02vitals/VitalsCaptureSheet.tsxCapture vitals (mobile-first)TaskLarge controls, possibly cameraT1Keep tier TBaseline
PAIN-03vitals/IntakeOutputInlineCapture.tsxI/O capture inlineDual-layoutMobile sheet / desktop modalT2 / D1Keep dualBaselineBreakpoint split intentional
IDComponentUser goalCurrent shellFunctional needsTierVerdictStatusNotes
CARE-01care-capture/CareCaptureOverlay.tsxCare note / capture wizardTaskMulti-step, full attentionT1Keep tier TBaseline
FH-01familyHelp/NewFamilyHelpRequestModal.tsxNew help requestModalFormD1KeepBaseline
FH-02familyHelp/FamilyHelpDetailSheet.tsxView help request detailBottomSheetRead detail, actionsD2Migrate → enhanced ModalBaseline
FH-03familyHelp/FamilyHelpBoardPopup.tsxBoard popup / quick viewBespoke-hybridDetail overlayD1Migrate → ModalBaseline
CP-01condition-packs/ConditionPackPreviewDialog.tsxPreview template packBespoke-hybridRead-only previewD2Migrate → enhanced ModalBaseline
IDComponentUser goalCurrent shellFunctional needsTierVerdictStatusNotes
CAL-01pages/calendar/CalendarView.tsxAdd care shiftBottomSheetFormD2Migrate → enhanced ModalBaseline
CAL-02pages/Schedule.tsxShift detailBottomSheetDetail + actionsD2Migrate → enhanced ModalBaseline
ALERT-01alerts/AlertInbox.tsxAlert detail (mobile)BottomSheetDetail; desktop uses panelX1ReviewBaselineDesktop inline panel — mobile sheet may stay X1
ALERT-02alerts/AlertInbox.tsxFilter / dismiss backdropBespoke (backdrop)Click-away—Out of scopeBaselineNot a dialog tier
IDComponentUser goalCurrent shellFunctional needsTierVerdictStatusNotes
SET-01settings/InviteShareModal.tsxInvite / share accessModalForm + copy linkD1KeepBaseline
SET-02settings/ReasonModal.tsxCollect reason (audit)ModalShort textD1KeepBaseline
SET-03settings/DeleteUserModal.tsxConfirm user removalModalDestructive confirmD1KeepBaseline
PLAT-01Layout.tsxSelect person (mobile)BottomSheetPicker listD1Migrate → ModalBaseline
PLAT-02IdleWarningModal.tsxSession idle warningModalTimer + actionsD1KeepBaseline
PLAT-03WelcomeModal.tsxFirst-run welcomeBespoke-centredMarketing / onboardingD1Migrate → ModalBaselineHigh z-index [1100]
PLAT-04UpgradeGate.tsxTier upgrade promptBespoke-centredCTA + dismissD1Migrate → ModalBaselinez [1100] — align stacking policy
PLAT-05CancelSubscriptionDialog.tsxConfirm cancel subscriptionBespoke-hybridConfirm + copyD1Migrate → ModalBaseline
PLAT-06pages/admin/Subscriptions.tsxUpgrade / plan confirmBespoke-hybridConfirmD1Migrate → ModalBaselineAdmin surface
AUTH-01auth/TenantSwitcher.tsxDropdown dismiss layerLight backdropClick-outside—Out of scopeBaselineNot a dialog
AUTH-02auth/AuthWelcomeBackdrop.tsxLogin illustrationFixed decorativeNon-interactive—Out of scopeBaselineNot a dialog
IDComponentUser goalCurrent shellFunctional needsTierVerdictStatusNotes
HIST-01pages/history/HistoryView.tsxAudit entry detailModalRead-only JSON/detailD2KeepBaselinesize lg
HIST-02pages/history/HistoryView.tsxDose detailsModalRead-onlyD1KeepBaseline
HIST-03pages/history/HistoryView.tsxDelete record confirmModalDestructive confirmD1KeepBaseline
HIST-04pages/history/HistoryView.tsxEdit dispensingModalEdit formD2KeepBaseline

CategoryCount
Total register entries50 (48 active, 2 removed as dead code)
Already on Modal.tsx15
On BottomSheet.tsx7
Bespoke (hybrid / slide-up / centred)16
Task / immersive (T1)7
Dual-layout (T2)2
Out of scope (not dialogs)3
Removed (dead code)2
VerdictCount
Keep as-is (reference or already Modal)11
Keep tier T / dual9
Migrate → Modal — done4
Migrate → Modal — remaining11
Migrate → enhanced Modal10
Review (needs product sign-off)2
Out of scope (not a dialog)3
Removed (dead code)2

(Counts corrected 2026-07-29 16:57 — verified against actual row count; updated 2026-07-29 17:17 after first quick-win batch. See revision history.)


Nested overlays must be tested during migration:

SHOP-01 Add items

SHOP-02 Custom product

SHOP-09 Image picker

SHOP-10 Crop

MED-07 ScanFlow

Schedule offer modal

MED-02 Log dose

MED-03 First dose reaction

MED-01 Quick meds Modal


Migration policy (draft — pending sign-off)

Section titled “Migration policy (draft — pending sign-off)”
  1. Default: all new overlays use Modal.tsx unless register tier is T1, T2, or approved X1.
  2. Phase 0: enhance Modal.tsx (portal, scroll body, footer, safe-area, z-index).
  3. Phase 1 pilot: Shopping — AddItemsSheet → enhanced Modal; validate scroll + sticky footer.
  4. Phase 2: Batch migrate bespoke D1 hybrids (confirm dialogs, short forms).
  5. Phase 3: Batch migrate D2 (tall forms); retire or narrow BottomSheet to approved X1 only.
  6. CI guard (proposed): fail PRs that add fixed inset-0 under pages/ or components/ outside ui/ and approved T1 files.

Use this when reviewing each row:

  • User goal still accurate?
  • Tier (D1 / D2 / T1 / T2 / X1) agreed?
  • Any mobile slide-up that is required for ergonomics (thumb zone) — if yes, mark X1 with reason
  • Stacking with parent flow documented?
  • QA smoke path noted in 22-PRODUCTION-MANUAL-QA.md after migration


VersionDateChange
1.62026-07-29 17:56Re-audit against the working tree after the v1.4 z-index work. Themes 1–4 and 6–10 re-verified unchanged (same files, same counts); confirmed OverlayScrim.tsx and check-overlay-scrims.mjs do not exist, so Phase 0 and enforcement are still open. Revised theme 5: the ladder is real but adoption stalled at 6 files, with ~20 overlays on raw values that map to no rung — and flagged a latent recurrence of the v1.4 bug, since 7 overlays sit above the dialog rung (100) and would hide any Modal they open (HistoryView is the sharpest case: four Modal dialogs at 100 alongside its own bespoke overlay at 1100). Widened theme 9: the touch-target deficit is app-wide, not overlay-only — interactive .cc-icon-chip call sites in both date pickers, CatalogItemManager, ModuleAccessRow, admin/Patients, AlertBell and ShoppingCatalogAdmin are 32–40px. No code changed in this revision
1.52026-07-29 17:50Closed both v1.3 audit caveats. Added theme 9 (touch targets — 11 undersized dismiss/secondary controls; root cause is .cc-icon-chip at 40px with callers shrinking to 36px) and theme 10 (all 7 BottomSheet consumer bodies inspected — healthiest surfaces in the app, only 2 content defects). Added Verification status section: recorded that device verification is not possible from the workstation and, critically, that Chromium emulation gives a false pass on theme 1 because 100vh === 100dvh without retracting browser chrome. Noted that a11y.spec.ts cannot see theme 9 because Target Size is WCAG 2.2 (wcag22aa) and the suite only requests through wcag21aa. Listed residual device-only checks for doc 22. No code changed in this revision
1.42026-07-29 17:35Closed Phase 0b (z-index ladder) and fixed a live bug. Modal was pinned at z-50 beneath the z-[60] sheets that open it, so three dialogs rendered behind their own parent and looked like dead buttons: LogDoseQuickMedsModal (desktop Edit quick picks — reported by product owner), AdverseReactionDetailModal and DeleteCardConfirmDialog (both regressed by the v1.2 migrations). Added a named zIndex scale to tailwind.config.js (chrome/popover/sheet-backdrop/sheet/dialog/task/interrupt/notification); moved Modal to z-dialog; adopted named rungs in LogDosePageShell, BottomSheet, AlertInbox (values unchanged) and lifted ImagePickerSheet + CropImageSheet to z-task so future Modal migrations cannot occlude the camera/crop steps. Also corrected the stale “Medications → Manual dose shortcuts” entry point in the developer guide — that screen does not exist
1.32026-07-29 17:33Added Mobile readiness audit — static census of all overlays for viewport units, portal, scroll lock, overscroll containment, safe-area, z-index and scrim recipe. Agreed one scrim recipe (bg-black/45 backdrop-blur-sm) with mobile rationale; corrected two Modal capability gaps already closed by Headless UI; recorded 8 vh-instead-of-dvh defects and the z-index tie between VitalsCaptureSheet and MobileTopBar. No code changed in this revision
1.22026-07-29 17:17First quick-win batch shipped: deleted dead-code ShoppingItemCard.tsx (SHOP-06, SHOP-07); migrated DeleteCardConfirmDialog (SHOP-08), AdverseReactionDetailModal (MED-04), VitalEntryModal (PAIN-01) onto Modal.tsx as-is — no primitive enhancement needed. Verified: npm run build, lint:strict (no new errors), Shopping + PainTracking Vitest suites (73 tests) pass
1.12026-07-29 16:57Corrected summary counts — actual row count is 50, not 44; verdict tally recomputed and reconciled against every row
1.02026-07-29Initial register from frontend audit