pediatric-ai-scribe-v3/public/components
Daniel 9bb4879be1 feat(notes): read-mode default + Edit toggle + autosave + mobile layout
Four changes landing together so the UX flows properly.

1. Fix voice-generation model error.
   /api/notes/from-voice was passing `req.body.model` (undefined)
   through to callAI, which resolved to LITELLM_DEFAULT_MODEL (empty
   for LiteLLM deployments with no explicit default) → `model=""` →
   LiteLLM 400 "Invalid model name". Server now reads the admin-
   configured `models.default` setting, falls back to the
   LITELLM_DEFAULT_MODEL env var, and only passes a model if one
   resolved. Empty string never reaches the provider.

2. Read mode as the default post-save.
   Opening an existing note or saving a new one now lands on a
   clean, read-only rendering of the body (sanitized HTML with an
   allowlist — p/h2/h3/strong/em/u/s/a/ul/ol/li/blockquote/code/pre).
   Click the "Edit" button to switch to the Tiptap editor. Matches
   the mental model of "notes are documents I review, not drafts I'm
   always editing."

3. Autosave during edit.
   Title-input + Tiptap onUpdate trigger a 1.2-second-debounced save.
   In-flight saves coalesce: if the user types more while a save is
   in progress, a follow-up fires right after it lands so the last
   keystroke never gets stranded. beforeunload uses navigator.
   sendBeacon to best-effort flush on tab close. The manual Save
   button is kept as a "save + switch to reader" shortcut. Ctrl/
   Cmd+S still works in the editor.

4. Mobile layout.
   The two-pane layout collapses to a single-pane view below 900px,
   driven by a data-view attribute on .notes-layout. Back buttons
   appear in the reader + editor heads on mobile to return to the
   list. Desktop layout unchanged (sidebar + right pane always
   visible).

Also:
  • CSS specificity fix — .hidden{display:none} was losing to
    .notes-rec-indicator{display:inline-flex} on source order, so
    the "Recording" indicator was showing when idle. Added explicit
    .notes-rec-indicator.hidden + .notes-voice-bar .btn-sm.hidden
    overrides at higher specificity.
  • Reader-body sanitizer — allowlist of safe tags + attributes;
    <a> links get target=_blank + rel=noopener.
  • SW cache bumped to pedscribe-v12-notes2 so clients pick up the
    new module / component / CSS.
2026-04-24 12:45:30 +02:00
..
admin.html Replace all browser dialogs with modern modal, add OIDC admin UI 2026-04-09 02:43:23 +02:00
bedside.html feat(nav): promote Bedside to its own tab; reorganise sidebar sections 2026-04-23 18:58:38 +02:00
calculators.html fix(nav): move image lightbox to index.html so NRP + seizure pathways 2026-04-23 18:58:38 +02:00
catchup.html Fix quiz SQL bug, security hardening, componentize HTML, speed improvements 2026-03-23 20:01:54 -04:00
chart.html v10: Local Whisper transcription, bigger text areas, flexible AI memory 2026-03-28 22:00:30 +00:00
cms.html v6.1: Turnstile bot protection, LiteLLM provider, PPTX tables, audio backup fixes, docs 2026-04-04 22:56:24 +02:00
dictation.html v10: Local Whisper transcription, bigger text areas, flexible AI memory 2026-03-28 22:00:30 +00:00
encounter.html Fix TTS axios/Vertex, generic toast, add stop button to encounter 2026-03-29 22:09:56 -04:00
extensions.html feat(extensions): personal Pagers & Extensions directory with soft-delete 2026-04-22 18:54:26 +02:00
faq.html Add automatic ICD-10 and CPT billing code suggestions 2026-04-11 01:50:17 +02:00
hospital.html v10: Local Whisper transcription, bigger text areas, flexible AI memory 2026-03-28 22:00:30 +00:00
learning.html Render presentations as slides in Learning Hub viewer 2026-03-24 03:04:14 -04:00
notes.html feat(notes): read-mode default + Edit toggle + autosave + mobile layout 2026-04-24 12:45:30 +02:00
pe-guide.html feat(pe-guide): Cardiovascular system with APTM auscultation SVG 2026-04-22 20:15:08 +02:00
settings.html Hide Active Sessions for SSO-only users 2026-04-14 05:07:07 +02:00
sickvisit.html v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
soap.html Add pause/stop buttons to SOAP note recording 2026-04-11 05:19:12 +02:00
vaxschedule.html Fix quiz SQL bug, security hardening, componentize HTML, speed improvements 2026-03-23 20:01:54 -04:00
wellvisit.html v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00