Skip to content

chore(web): sync speech recognition language options with SRI 0.2.1 - #522

Merged
cswaney merged 2 commits into
mainfrom
514-sync-sri-launcher-params
Aug 27, 2026
Merged

chore(web): sync speech recognition language options with SRI 0.2.1#522
cswaney merged 2 commits into
mainfrom
514-sync-sri-launcher-params

Conversation

@cswaney

@cswaney cswaney commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

The service launcher offered only 8 languages and always sent one on every request. SRI 0.2.1's `TranscriptionRequest` accepts ~90 languages plus per-file auto-detect, so 82 valid values were unreachable and users could never opt into auto-detection.

  • Widen the list to mirror the batch transcribe launcher's 12-language curated set: English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, Korean, Arabic, Hindi, Russian.
  • Add "Auto-detect" as the default. `requests.js` now omits the `language` field when Auto-detect is chosen — same mechanism the batch task uses.
  • Portal the language dropdown with `anchor="bottom start"` so it escapes the sidebar's overflow context; previously the open menu was clipped by the parameter container's height.

Test plan

  • `npm run lint`
  • `npm test` (556 pass)
  • Manual: launch a speech-recognition service, transcribe an audio file with a specific language and with Auto-detect. Confirm the dropdown is fully visible when open.

Notes

Closes #514

The launcher offered a fixed set of 8 languages and always sent one on
every request. SRI 0.2.1's TranscriptionRequest accepts ~90 languages
plus omission (per-file auto-detect), so 82 valid choices were
unreachable and users could never opt into auto-detection.

Mirror the batch transcribe launcher's 12-language curated set plus an
"Auto-detect" sentinel, and default to Auto-detect. Auto-detect works
by omitting the `language` field in the request body — the same
mechanism the batch task uses. All values are already sent lowercased,
which matches SRI's Literal[...] contract.

Also portal the language ListboxOptions with `anchor="bottom start"`
so the dropdown escapes the sidebar's overflow context; previously the
open menu was clipped by the parameter container's height.

Closes #514
@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review

Nice, focused fix — the auto-detect omission logic and the anchor="bottom start" portal fix both follow patterns already established elsewhere in the codebase (e.g. ModelSelect.jsx, RevisionSelect.jsx), so the dropdown-clipping fix looks solid.

A few things worth a look before merge:

Regression: three previously-supported languages are dropped
The old list included Norwegian, Swedish, and Dutch; the new curated 12-language set (mirroring the batch transcribe launcher) drops them in favor of Italian/Portuguese/Japanese/Korean/Arabic/Hindi/Russian. Since SRI 0.2.1 apparently supports ~90 languages, was narrowing to exactly the batch launcher's set (rather than a larger curated list, or all 90) a deliberate product call? Users who relied on Norwegian/Swedish/Dutch in this launcher lose access to them with no obvious workaround other than picking Auto-detect. Worth confirming this is intentional and not just an incidental side effect of "mirroring" the batch task's list.

Wire-format mismatch vs. the launcher it claims to mirror
The batch transcribe launcher (NewJobModal.jsx) sends ISO 639-1 codes ("en", "es", "pt", …), but this PR's requests.js sends lowercased full names ("english", "spanish", "portuguese", …) via params.language.name.toLowerCase(). That may well be correct — the two code paths likely hit different backends/libraries with different expected formats — but the PR description's "mirror the batch launcher's language set" framing could give a future reader the impression the wire format matches too. Since SRI's source isn't vendored in this repo, this can't be verified statically; the manual test-plan item (checked as [ ]) is the right way to close the loop here, so make sure that actually gets run — including a couple of the newly-added languages (e.g. Portuguese, Hindi), not just English — before merging.

No test coverage for the new/changed behavior

  • requests.js's new conditional (if (params.language?.name && ... !== "Auto-detect")) is exactly the kind of small, pure logic that's cheap to unit test and easy to accidentally break later (e.g. reintroducing an unconditional body.language = ...). A test asserting the body omits language for Auto-detect and includes the lowercased name otherwise would be valuable.
  • No test exercises the new default (AUTO_DETECT) or the expanded language list in SpeechRecognitionParametersForm.

Minor / pre-existing, not introduced by this PR
LanguageSelect.propTypes still declares language: PropTypes.string, but language is actually an {id, name} object (was already wrong before this change). Not blocking, but could be fixed while this file is already being touched.

Nothing here blocks the core fix — the auto-detect bug and dropdown-clipping bug are real and well addressed. The main ask is confirming the language-list scope-down is intentional and actually running the manual test before merge.

…dling

Fixes a pre-existing propType lie (LanguageSelect.language was declared
as a string but has always been an {id, name} object) and adds unit
tests for the request body shape: an explicit language becomes the
lowercased name, Auto-detect omits the field so SRI runs per-file
detection.
@cswaney
cswaney merged commit edaa3df into main Aug 27, 2026
3 checks passed
@cswaney
cswaney deleted the 514-sync-sri-launcher-params branch August 27, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(web): sync speech recognition launcher params with SRI 0.2.1

1 participant