pediatric-ai-scribe-v3/client
Daniel cd1f762f34 feat(notes): restore audio recording + save/load across all 7 note pages
Recovered from git history (commit be14578) — the vanilla recording UI
was deleted during the "minimum-viable" note ports without being
re-implemented. Every note page now gets the full vanilla behavior
back:

Recording (Encounter, Dictation, SOAP, Sick Visit, Hospital Course):
  • AudioRecorder — MediaRecorder mono/16kHz/EC+NS/opus 32kbps
  • Pause / Resume (native where supported, restart-on-same-stream
    fallback for Safari)
  • Live preview via Web Speech API (opt-in in Settings)
  • On stop → upload to /api/transcribe; fall back to live preview
    if server unavailable or blob > 24 MB
  • Failed uploads → /api/audio-backups (IndexedDB fallback)

Save / Load / New-patient toolbar (all 7 note pages):
  • sessionStorage keys _savedEncId_<type> + _idempKey_<type>
    survive page refresh + sign-out within the same tab
  • Optimistic locking via expected_version (409 → "Someone else
    edited this encounter")
  • Load popover lists saved encounters of matching type only
  • Draft #N chip shows current session-bound row

Well Visit and Chart Review: toolbar only — vanilla had no recorder
on those tabs (paste-based workflows).

New components:
  client/src/components/Recorder.tsx
  client/src/components/EncounterToolbar.tsx

New libraries:
  client/src/lib/recorder.ts            — AudioRecorder class
  client/src/lib/transcribe.ts          — /api/transcribe + audio backup
  client/src/lib/web-speech.ts          — webkit speech preview + dedupe
  client/src/lib/encounter-persistence.ts — save/load/version tracking
2026-04-24 05:24:09 +02:00
..
public feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
src feat(notes): restore audio recording + save/load across all 7 note pages 2026-04-24 05:24:09 +02:00
.gitignore feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
components.json feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
eslint.config.js feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
index.html feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
package-lock.json feat: day 7 — first tab ported to React (Extensions) + Express serves /app/* 2026-04-23 22:09:04 +02:00
package.json feat(client): port age→weight + BSA + dose + GCS; shared/clinical module 2026-04-24 01:11:58 +02:00
README.md feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
tsconfig.app.json feat(client): port age→weight + BSA + dose + GCS; shared/clinical module 2026-04-24 01:11:58 +02:00
tsconfig.json feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
tsconfig.node.json feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00
vite.config.ts feat(client): day 6 — scaffold React 19 + Vite + Tailwind v4 + shadcn/ui 2026-04-23 21:58:37 +02:00

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])