Modernize dependencies and language detection #10

Merged
kleb merged 7 commits from modernize-2026-07 into main 2026-07-20 06:18:36 +02:00
Owner

Purpose

Modernize Voice Typer's dependency stack and improve automatic language detection, recording performance, accessibility, and model-download integrity.

Key changes

  • Upgrade the Electron/main and React/Vite UI dependencies and refresh the Bun lockfiles and quality tooling.
  • Rework Whisper and Parakeet automatic language detection with explicit evidence handling, multi-window voting, and broader detector model choices.
  • Move microphone capture to an AudioWorklet, reduce renderer work during recording, and improve settings/setup accessibility and responsiveness.
  • Verify Whisper model downloads with catalogued checksums and persistent verification markers.
  • Refresh repository hygiene and development documentation for the current Bun-based workflow.

Verification

  • bun run check
  • bun run test (73 tests passed)
  • bun run build

The production build reports only the existing informational warning that the local caniuse-lite data is six months old.

## Purpose Modernize Voice Typer's dependency stack and improve automatic language detection, recording performance, accessibility, and model-download integrity. ## Key changes - Upgrade the Electron/main and React/Vite UI dependencies and refresh the Bun lockfiles and quality tooling. - Rework Whisper and Parakeet automatic language detection with explicit evidence handling, multi-window voting, and broader detector model choices. - Move microphone capture to an AudioWorklet, reduce renderer work during recording, and improve settings/setup accessibility and responsiveness. - Verify Whisper model downloads with catalogued checksums and persistent verification markers. - Refresh repository hygiene and development documentation for the current Bun-based workflow. ## Verification - `bun run check` - `bun run test` (73 tests passed) - `bun run build` The production build reports only the existing informational warning that the local `caniuse-lite` data is six months old.
- Remove Forgejo CI workflow (intentionally no CI)
- Delete stray nul file and unused ui starter asset
- Ignore .impeccable/ in root and ui
- Pin packageManager bun@1.4.0; describe both engines
- Declare sharp as devDependency; icons generated before packaging
- Document Electron 40 EOL / 43 target and lazy binary download
- Add large-v2 to README model table; format worker-host test
- Electron 43.1.1 (exact), electron-builder 26.15.7
- @fugood/whisper.node 1.1.1, sherpa-onnx-node 1.13.4, koffi ^3.1.1, uiohook-napi ^1.5.5
- Root TypeScript: tsgo preview -> stable tsc 7.0.2
- knip ^6.27, oxlint ^1.74, oxfmt ^0.59, concurrently ^10, wait-on ^9.0.10
- @types/node aligned to Electron 43's Node 24 line
- Overrides: tar 7.5.20; drop rollup/minimatch (all paths patched) and
  ajv (electron-builder requires AJV 8; legacy consumers still resolve 6.14.0);
  add node-abi 4.33.0 so Electron 43 postinstall resolves without VS rebuild
- Ignore .playwright-mcp artifacts
- Vite 8 (rolldown): rollupOptions -> rolldownOptions, manualChunks ->
  output.codeSplitting.groups; vendor splits preserved, React Compiler
  rewired via reactCompilerPreset + @rolldown/plugin-babel (102/102
  components compiled)
- ESLint 10 + typescript-eslint 8.64: fixed surfaced findings properly
  (CVA factories to button-variants/badge-variants, i18n locale module
  split, effect-state cleanups, translator ref update in effect)
- React 19.2.7, Radix latest, lucide 1.25, tailwind-merge 3.6, fonts 5.3
- UI stays on TypeScript 5.9 (typescript-eslint constraint)
- Document Qwen3-ASR 0.6B benchmark rejection in DEVELOPMENT.md
- Fix whisper.cpp log parser to the real whisper_full_with_state format
  (2-3 letter codes, 6-digit probabilities) and wire it into the worker
  via transcription-scoped capture; auto mode now carries detected
  language, confidence, and low-confidence flag (source native-log),
  falling back to provider language; forced mode ignores evidence
- Reset language to auto atomically when switching engine to Parakeet
  (computeEngineSwitchLanguagePatches in settings-validation), fixing
  the stale forced-language bug that silently disabled the detector
- Parakeet language ID: 3s minimum for all detector sizes, detected and
  fallback codes validated against the model's 25 supported languages,
  and three-window majority vote for recordings over 45s (no synthetic
  confidence from votes)
- New pure helpers in parakeet-detection.ts; tests extended to 70
- Replace deprecated ScriptProcessorNode with a mono-mixing AudioWorklet
  (transferred 4096-sample chunks, 30-minute buffer cap)
- Waveform: cache theme CSS variables, pause idle animation when hidden
  or unfocused
- Drop synchronous level scan from recording submission (validation stays
  synchronous)
- Surface previously console-only settings failures as dismissible
  localized inline errors; failed queued downloads keep a visible retry
  state
- Setup wizard: explicit model-list error state with retry
- Show cancel hotkey hint during transcription; add localized
  file-preparation state and disable drops meanwhile
- Re-show repeated identical errors via occurrence-keyed dismissal
- A11y: semantic wizard steps with aria-current, model-specific button
  labels, aria-live hotkey hints
- Pin publisher SHA-256 for the Parakeet v3 archive
- Add project-pinned SHA-256 (official URLs, sizes matched release API,
  hashed locally 2026-07-20) plus exact extracted ONNX byte sizes for
  all four language-ID detector archives; enforce both fail-closed
- Replace detector readiness heuristics with exact byte-size validation
- Whisper: exact sizeBytes (from HF LFS metadata, oids cross-checked
  against catalog hashes) required for a model to count as cached;
  wrong-size files are replaced via the verified tmp+rename flow; full
  re-hash after CPU load failure removes same-size corrupt files
- Hitting the 30-minute recording cap now stops and submits via the
  normal stop flow with a localized warning instead of silently
  discarding further audio
- AudioWorklet flush handshake preserves the final partial chunk;
  provisional AudioContext is closed when setup fails
- Language-log capture uses generation tokens so a cancelled
  transcription can no longer clear a newer capture
- Failed engine-switch activation rolls back the staged language reset
- Cached Whisper models get one-time full SHA-256 verification via
  sha256-ok markers before load; corrupt files self-heal
- Successful model-list retry clears the stale settings error
Collaborator

kReview review

Verdict: 1 Medium

The main regression is the removal of the existing automated validation workflow, leaving its pull-request and main-branch quality gates inactive.

Medium (1)

  • Restore the automated validation workflow.forgejo/workflows/ci.yml
    Future changes will no longer receive this workflow's typecheck, lint, formatting, dependency, test, and build validation on pull requests or pushes to main. Deleting the workflow without adding a replacement removes an important regression gate; restore it or introduce an equivalent workflow as part of this PR.
    Suggested fix: Keep .forgejo/workflows/ci.yml, updating its Bun version or commands as needed, or add a replacement workflow that runs the same validation gates on pull requests and main-branch pushes.

Excluded as generated or vendored (not reviewed): bun.lock, ui/bun.lock.

Reviewed by kReview at 444b5285db. This comment is conservative and based only on the PR diff and metadata.

Est. cost ~$0.52 (77.4k in / 5.1k out / gpt-5.6-sol).

<!-- codex-forgejo-review --> <!-- codex-forgejo-review-head:444b5285dbdfce2f3ee92e1d5822172785d03418 --> ## kReview review **Verdict:** 1 Medium The main regression is the removal of the existing automated validation workflow, leaving its pull-request and main-branch quality gates inactive. ### Medium (1) - **Restore the automated validation workflow** — [`.forgejo/workflows/ci.yml`](https://git.kleb.sh/kleb/VoiceTyper/src/commit/444b5285dbdfce2f3ee92e1d5822172785d03418/.forgejo/workflows/ci.yml) Future changes will no longer receive this workflow's typecheck, lint, formatting, dependency, test, and build validation on pull requests or pushes to main. Deleting the workflow without adding a replacement removes an important regression gate; restore it or introduce an equivalent workflow as part of this PR. Suggested fix: Keep `.forgejo/workflows/ci.yml`, updating its Bun version or commands as needed, or add a replacement workflow that runs the same validation gates on pull requests and main-branch pushes. _Excluded as generated or vendored (not reviewed):_ `bun.lock`, `ui/bun.lock`. _Reviewed by kReview at `444b5285db`. This comment is conservative and based only on the PR diff and metadata._ _Est. cost ~$0.52 (77.4k in / 5.1k out / gpt-5.6-sol)._ <!-- codex-forgejo-review-state:eyJoZWFkU2hhIjoiNDQ0YjUyODVkYmRmY2UyZjNlZTkyZTFkNTgyMjE3Mjc4NWQwMzQxOCIsInN1bW1hcnkiOiJUaGUgbWFpbiByZWdyZXNzaW9uIGlzIHRoZSByZW1vdmFsIG9mIHRoZSBleGlzdGluZyBhdXRvbWF0ZWQgdmFsaWRhdGlvbiB3b3JrZmxvdywgbGVhdmluZyBpdHMgcHVsbC1yZXF1ZXN0IGFuZCBtYWluLWJyYW5jaCBxdWFsaXR5IGdhdGVzIGluYWN0aXZlLiIsImZpbmRpbmdzIjpbeyJzZXZlcml0eSI6Im1lZGl1bSIsInRpdGxlIjoiUmVzdG9yZSB0aGUgYXV0b21hdGVkIHZhbGlkYXRpb24gd29ya2Zsb3ciLCJmaWxlIjoiLmZvcmdlam8vd29ya2Zsb3dzL2NpLnltbCIsImxpbmUiOm51bGwsInF1b3RlZF9zbmlwcGV0IjoiLSAgcHVsbF9yZXF1ZXN0OiJ9XSwiY3VtdWxhdGl2ZUNvc3QiOnsidXNkIjowLjUyMjQwNiwiaW5wdXRUb2tlbnMiOjc3NDAyLCJvdXRwdXRUb2tlbnMiOjUwNzAsIm1vZGVsIjoiZ3B0LTUuNi1zb2wifX0= -->
kleb merged commit c6e8f2f8ed into main 2026-07-20 06:18:36 +02:00
kleb deleted branch modernize-2026-07 2026-07-20 06:18:36 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kleb/VoiceTyper!10
No description provided.