Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): find French in the voice language filter with decomposed accents #48294

Opensaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48294/headopened View on GitHub

Problem

In SpeechModelBrowser (apps/web/src/components/settings/VoiceSettingsPanel.tsx), the voice model language filter lowercases the search query and Intl.DisplayNames label without Unicode normalization. Pasting a canonically equivalent NFD string such as français (c + U+0327) fails to match the NFC label français (U+00E7), showing no matching languages even though the text looks identical.

Deterministic repro on origin/main (4b8199987cb63f82912b8f3dbe9de6a96cdb057b):

  1. Set Settings → General → Language to Français (fr).
  2. Open Settings → Voice (/settings/voice), select a local environment under Transcrire avec with any speech model catalog entry containing "fr" (e.g. languages: ["en", "fr", "de"]).
  3. Open Filtrer par langue and enter "franc\u0327ais" (literal c followed by U+0327) into Rechercher une langue.
  • Observed: Menu shows Aucune langue ne correspond. (getByRole("menuitemcheckbox", { name: "français", exact: true }) has count 0), while NFC "fran\u00e7ais" shows français.
  • Expected: The français checkbox option appears for both NFC and NFD forms.

Change

Normalize both languageSearch.trim() and languageLabel(code, locale) to NFC (.normalize("NFC")) before .toLocaleLowerCase() in SpeechModelBrowser (apps/web/src/components/settings/VoiceSettingsPanel.tsx), keeping language-code matching unchanged. This covers both web and desktop (Electron) Voice settings; mobile (VoiceModelSection.tsx) has no language search filter. Added a browser regression test in apps/web/src/components/settings/VoiceSettingsPanel.browser.test.tsx.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • Focused browser regression test (vp test run apps/web/src/components/settings/VoiceSettingsPanel.browser.test.tsx -t "finds French in the voice language filter with decomposed accents"):
    • Base (4b8199987cb63f82912b8f3dbe9de6a96cdb057b): FAIL — NFC "fran\u00e7ais" matched français in 12 ms; NFD "franc\u0327ais" timed out waiting for menuitemcheckbox français.
    • Head (6a728b6822257c9d7061fcc7be91f637461050d3): PASS (1445 ms) — NFC, NFD, and code ("fr") queries all match français.
  • Real-app scenario proof (vp run scenarios:prove against base vs head): failsOnBase: true (expected: count 1, observed: count 0), passesOnHead: true. Full transcript: https://gist.github.com/saphid/97cd29164b81cbd3a17c721f47255414
  • vp run check:changed: exit 0 (format, lint, knip, typecheck, VoiceSettingsPanel.browser.test.tsx 24/24 passed, reactCompilerCoverage).
Before (4b8199987cb6)After (6a728b682225)
Before: NFD search shows Aucune langue ne correspond.After: NFD search shows français

Not shown: Full repo-wide test suite and packaged Electron desktop build (desktop renders the same apps/web VoiceSettingsPanel component).

Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).

Not shown

  • apps/web/src/components/settings/VoiceSettingsPanel.browser.test.tsx:1058 — The fr assertion does not independently verify code matching because français also contains fr; use de → allemand, or stop describing that assertion as proof of the code-matching branch.
  • apps/mobile/src/features/settings/SettingsVoiceModelsRouteScreen.tsx:46 — The draft overstates the mobile distinction: mobile can search model language codes, but it has no picker that searches localized language labels. Clarify that distinction in Change; no mobile code change is needed.
    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Approved at eb613b9

      Macroscope's review found this PR approvable — The language filter now matches canonically equivalent accented text, including decomposed French accents. The change only affects search-menu results and leaves language selection and product defaults unchanged.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Language filtering now normalizes the trimmed query and localized labels to NFC before lowercasing. A browser test checks French language matching with precomposed accents, decomposed accents, and the prefix fr.

      Changes: Voice language search

      Layer / File(s)Summary
      Normalize and test language filtering
      apps/web/src/components/settings/VoiceSettingsPanel.tsx, apps/web/src/components/settings/VoiceSettingsPanel.browser.test.tsx
      SpeechModelBrowser normalizes the query and localized labels to NFC before lowercasing. The browser test checks French matching with precomposed and decomposed accents, and with fr.

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge, tiliakoos

      Merge Risk: Minimal · up to eb613

      This change lets users find French in the voice language filter when the accent is typed in decomposed form. It affects only a small client-side filter and is easy to revert. There is no known merge-blocking risk.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the change: French matches in the voice language filter when the search uses decomposed (NFD) accents. The raw summary confirms the change normalizes the query and labels to NFC in Spe…
      Description checkPassedThe description follows the template sections: Problem, Change, Scope, and Verification. It gives a clear repro, the exact code change, the reason no issue is needed, and focused test results with bas…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the change: French matches in the voice language filter when the search uses decomposed (NFD) accents. The raw summary confirms the change normalizes the query and labels to NFC in SpeechModelBrowser, which is the main fix. It uses a conventional commit prefix, though the scope is a single component within web.

      Full details: Description check

      Explanation

      The description follows the template sections: Problem, Change, Scope, and Verification. It gives a clear repro, the exact code change, the reason no issue is needed, and focused test results with base and head revisions. It includes before/after screenshots, a scenario proof, and a list of unverified items. The Not shown section gives two review notes: the fr assertion does not prove code matching, and the mobile wording in Change should be clarified. These are non-critical gaps, so the description is mostly complete.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between 43328e8f0a680a491c84995b398f5c635ff37a90 and eb613b90c56713486230cae192ef5e8d1d20d91c.

      Files selected for processing: 2

      • apps/web/src/components/settings/VoiceSettingsPanel.browser.test.tsx
      • apps/web/src/components/settings/VoiceSettingsPanel.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Sign in to join this conversation.