pediatric-ai-scribe-v3/public/js
Daniel f31afcdbf4 Fix biometric login, and keep recording alive across screen lock
Biometric sign-in has never worked. auth.js drove
window.Capacitor.Plugins.NativeBiometric — the API of
capacitor-native-biometric, which is not a dependency of this project. The
installed plugin is @aparajita/capacitor-biometric-auth, registered as
BiometricAuthNative with an entirely different API and no credential
storage at all. bioPlugin() therefore always returned null, bioAvailable()
always resolved {ok:false}, and the button was never revealed.

Rewritten against what is actually installed, with no new dependency:
BiometricAuthNative (checkBiometry/authenticate) presents the prompt, and
the already-working SecureStoragePlugin — via the window.SecureStorage
wrapper — holds the credentials. Credentials are only read after
authenticate() resolves, so the OS still gates access. biometryType is a
numeric enum in this plugin, so the old FACE_ID/TOUCH_ID string maps are
replaced with a single lookup exposed as typeName.

Secure storage itself was fine and is unchanged: SecureStoragePlugin
matches the name the wrapper looks up and is registered in
capacitor.settings.gradle.

Recording across screen lock: window.nativeKeepAwake() called Capacitor's
KeepAwake plugin, which is also not installed here, so it silently did
nothing and the device slept mid-encounter — taking the WebView's
MediaRecorder with it. keepAwake() is now a method on the existing
NativeRecording JavascriptInterface, which sets FLAG_KEEP_SCREEN_ON, and
is bound to the WebView so it survives the launcher's navigation to the
remote origin. The Capacitor plugin remains a fallback.

If the screen is locked anyway (power button, incoming call), the activity
pauses and Chromium throttles timers for hidden WebViews, starving
MediaRecorder's chunk delivery. MainActivity now calls resumeTimers() on
pause while recording. The foreground service was already correct — it
holds a partial wake lock and declares FOREGROUND_SERVICE_TYPE_MICROPHONE.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 01:12:47 +02:00
..
assistant Fix authenticated mobile image downloads 2026-06-09 16:02:11 +02:00
bedside allow bedside respiratory without weight 2026-05-08 09:10:33 +02:00
calculators consolidate calculator growth helpers 2026-05-08 04:36:39 +02:00
learningHub extract learning hub ai panel controller 2026-05-08 16:54:48 +02:00
notes split notes frontend modules 2026-05-08 02:44:22 +02:00
wellVisit extract well visit schedule data 2026-05-08 05:11:29 +02:00
admin-docs.js docs refresh current workflows 2026-05-09 00:40:45 +02:00
admin.js feat: improve clinical assistant prompts 2026-06-06 00:01:07 +02:00
app.js Fix biometric login, and keep recording alive across screen lock 2026-07-31 01:12:47 +02:00
audioBackup.js harden audio backup settings rendering 2026-05-08 08:23:38 +02:00
auth.js Fix biometric login, and keep recording alive across screen lock 2026-07-31 01:12:47 +02:00
authFetch.js convert auth helpers to modules 2026-05-08 07:56:41 +02:00
calc-math.js feat: Bedside clinical reference module + age→weight estimator + dose-math unit tests 2026-04-20 02:49:42 +02:00
calculators.js remove redundant module wrappers 2026-05-08 05:30:32 +02:00
chartReview.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
clinicalAssistant.js Fix generated image mobile downloads 2026-06-09 15:20:06 +02:00
diagrams.js fix diagram delete confirmation 2026-05-08 06:28:12 +02:00
documents.js convert settings loaders to modules 2026-05-08 07:17:29 +02:00
drugs-loader.js convert admin docs and drug loader to modules 2026-05-08 07:50:26 +02:00
e2e-bootstrap.js fix docs toc fallback and remove redundant iifes 2026-05-08 23:08:47 +02:00
ed-encounters.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
encounters.js fix docs toc fallback and remove redundant iifes 2026-05-08 23:08:47 +02:00
extensions.js feat: add extension import preview 2026-05-08 22:26:53 +02:00
hospitalCourse.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
learningHub.js extract learning hub ai panel controller 2026-05-08 16:54:48 +02:00
liveEncounter.js fix docs toc fallback and remove redundant iifes 2026-05-08 23:08:47 +02:00
memories.js clarify template-only AI memory context 2026-05-08 07:38:27 +02:00
milestones.js test clinical note entrypoints 2026-05-08 06:33:34 +02:00
milestonesData.js v4: Fix milestones display + add OpenID auth + 100MB PDF support 2026-04-01 17:59:51 +00:00
nextcloud.js convert settings loaders to modules 2026-05-08 07:17:29 +02:00
notes.js remove redundant module wrappers 2026-05-08 05:30:32 +02:00
peGuide.js move pe guide data to json 2026-05-08 08:56:21 +02:00
secureStorage.js convert auth helpers to modules 2026-05-08 07:56:41 +02:00
shadess.js harden clinical assistant source handling 2026-05-09 19:59:04 +02:00
sickVisit.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
soap.js feat: add patient education handouts 2026-05-08 22:26:53 +02:00
speechRecognition.js convert speech helpers to modules 2026-05-08 08:09:38 +02:00
transcriptionSettings.js convert settings helpers to modules 2026-05-08 07:54:08 +02:00
ui-state.js convert settings helpers to modules 2026-05-08 07:54:08 +02:00
voiceDictation.js fix docs toc fallback and remove redundant iifes 2026-05-08 23:08:47 +02:00
voicePreferences.js convert settings helpers to modules 2026-05-08 07:54:08 +02:00
wellVisit.js remove redundant module wrappers 2026-05-08 05:30:32 +02:00