Implements feature request: https://community.gladysassistant.com/t/pouvoir-parl…er-avec-lia-dans-la-page-de-discussion/10282
> ⚠️ This pull request was opened by an automated Claude Code run. It has **not** been tested in a real browser with a real microphone. It needs human review and manual testing (Chrome desktop, Chrome Android, Safari iOS/macOS, and a check that Firefox degrades correctly) before being merged.
### Description
Adds a small microphone button inside the "write your message" input of the Chat / Discussion page, so the user can dictate a message to Gladys' AI instead of typing it.
This is a **front-only** change, no server change, no external service, no audio upload:
- Transcription uses the browser's own Web Speech API (`window.SpeechRecognition` / `window.webkitSpeechRecognition`). Gladys itself never records, stores or uploads any audio.
- Clicking the mic starts listening (the button turns red and pulses, the icon becomes a stop square). The transcription fills the message input live (`interimResults`) as the user speaks.
- Clicking again stops listening. `continuous` is enabled, but browsers that stop on the first silence are fine too, the recognition simply ends and the transcribed text stays in the input.
- **The message is never sent automatically**: the user reviews the text and presses send, exactly as when typing.
- Sending a message cancels a running recognition, so a late transcription cannot refill the input that was just emptied.
- The recognition locale follows the language selected in Gladys (`user.language`), keeping the full browser locale when it matches (a French speaking user in Canada keeps `fr-CA`), and falling back to `en-US` / `fr-FR` / `de-DE`, then to the browser locale.
**Browser support / graceful degradation**
- **Supported**: Chrome and Chromium based browsers (Edge, Opera, Chrome Android, Samsung Internet), and Safari on macOS and iOS (`webkitSpeechRecognition`).
- **Not supported**: Firefox (desktop and Android) does not implement the Web Speech API recognition part. In that case the mic button is simply **not rendered** at all, the composer looks exactly as it does today, and the extra right padding on the textarea is not applied either.
- The button is also not rendered outside a secure context (plain HTTP on a non-localhost host), because the microphone is unavailable there. This reuses the existing `isSecureRecordingContext()` helper already used by the dashboard voice assistant widget.
- Errors are handled and shown as a small message under the composer, translated in en/fr/de: permission denied, no microphone, no speech detected, network error reaching the browser's speech service, and a generic fallback. `aborted` is ignored since it just means the user stopped the recognition.
**Privacy note for reviewers:** the audio never goes through Gladys or Gladys Plus. It is handled by the browser. Note however that Chrome's implementation of the Web Speech API performs the recognition on Google servers (this is browser behaviour, same as the keyboard dictation button), while Safari can use on-device recognition. If that trade-off is not acceptable, the alternative would be to reuse the existing Gladys Plus STT endpoint used by the dashboard voice assistant widget instead — happy to switch the implementation.
**Files changed**
- `front/src/utils/speechRecognition.js` (new): thin wrapper around the Web Speech API (support detection, locale resolution, error code mapping, session factory).
- `front/src/routes/chat/ChatVoiceInputButton.jsx` (new): the mic button component.
- `front/src/routes/chat/ChatPage.js`: renders the button in the composer, holds the error state, cancels recognition on send.
- `front/src/routes/chat/style.css`: styles for the button, its listening state and the error line.
- `front/src/actions/message.js`: new `setMessageTextInput` action to set the composer text from a value instead of a DOM event.
- `front/src/config/i18n/{en,fr,de}.json`: new `chat.voiceInput` block.
## Forum
Forum: https://community.gladysassistant.com/t/pouvoir-parler-avec-lia-dans-la-page-de-discussion/10282
### Checklist
- [ ] Tests pass: `cd server && npm run coverage` (Codecov requires 100% coverage on changed lines) and Cypress (`npm run cypress:run`) if the UI changed
- [x] Linter and prettier pass on both front and server (`npm run eslint`, `npm run prettier`)
- [x] No undocumented breaking change
Notes on the checklist, filled honestly:
- **Server tests**: not run, this PR contains **no server change at all** (only files under `front/`).
- **Cypress**: not run. It needs a running Gladys instance (`start:cypress` + a live server) which was not available in the automated environment. There is also no front unit-test harness in this repo (`front/package.json` has no `test` script, only Cypress e2e specs), so no unit test was added for the new component — this matches the other front components which are not unit tested. A Cypress spec would additionally need the Web Speech API to be stubbed, since Chrome headless cannot really listen to a microphone.
- **What was actually run and passed in `front/`**: `npm run eslint` (0 errors, warning count unchanged from master, none of them in the new/changed files), `npm run prettier` + `npm run prettier-check` (all files match Prettier style), `npm run compare-translations` (en/fr/de complete), and `npm run build` (Vite build succeeds, the chat route chunk builds fine).
- **Not tested**: the actual voice behaviour in a real browser with a real microphone, and the visual result of the button. Please check the layout of the composer (the mic sits at `right: 48px`, just left of the send button) on desktop and mobile.
---
_Generated by [Claude Code](https://claude.ai/code/session_013yxguVaLdJ8ZKmw5x3HePT)_
## Summary by CodeRabbit
* **New Features**
* Added browser-based voice dictation to chat using a microphone control.
* Speech transcripts are added to the current message, with start, stop, and restart support.
* Added localized voice-input labels, errors, browser support messaging, and privacy notices in English, French, and German.
* Added visual feedback for listening, errors, focus, and reduced-motion preferences.