[PR #6998] [MERGED] feat(characters): add a Voice section to the Character Editor #7421

Closed
opened 2026-10-23 04:19:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6998
Author: @SpicyMarinara
Created: 10/3/2026
Status: ✅ Merged
Merged: 10/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/character-voice-section


📝 Commits (7)

  • 70fe5c4 feat(characters): add a Voice section to the Character Editor
  • 03219ec fix(characters): make the Voice section show the voice in use and keep typing through slow saves
  • 9852343 docs(changelog): point the Voice section entry at its Engine issue
  • 00de07d Merge remote-tracking branch 'origin/staging' into feat/character-voice-section
  • 3694331 test(tts): check that chat playback calls the speaker lookup, whatever its argument names
  • c37fd91 Merge remote-tracking branch 'origin/staging' into feat/character-voice-section
  • c6e090c Merge branch 'staging' into feat/character-voice-section

📊 Changes

12 files changed (+598 additions, -66 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/characters/creating-and-editing-characters.md (+13 -4)
📝 docs/media/tts-setup.md (+4 -2)
📝 e2e/core-flows.e2e.ts (+1 -1)
📝 e2e/ux-feedback-sweep.e2e.ts (+63 -1)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+67 -15)
➕ packages/client/src/components/characters/CharacterVoicePicker.tsx (+251 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+7 -9)
📝 packages/client/src/components/panels/settings/TTSConfigCard.tsx (+27 -27)
📝 packages/client/src/lib/tts-dialogue.ts (+48 -7)
📝 packages/client/src/localization/locales/en.json (+13 -0)
📝 scripts/regressions/tts-source-persistence.regression.ts (+103 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6997

Refs Pasta-Devs/Marinara-Agents#1176, where this was requested and scoped.

Why this change

A character's Text to Speech voice could only be set in Connections → Text to Speech, which people struggle to find, and it felt disconnected from the character. The maintainer agreed on Agents#1176 to add a Voice section to the Character Editor that edits the same setting, and to leave out clone audio, voice descriptions and any new storage.

What changed

  • New Voice tab in the Character Editor (CharacterVoicePicker.tsx), between Colors and Stats. It reads and writes this character's row of the shared TTS voiceAssignments, the same list Connections → Text to Speech edits, so the two always match. A pick saves right away, as on the TTS card.
  • Reuse. It uses the TTS card's voice list query and pickers. VoiceSelect and CustomizableVoiceInput are now exported, and buildTTSVoiceOptions is shared by the card and the editor. It has a refresh button, and Preview speaks a short line through the existing ttsService.speak → /api/tts/speak path.
  • Phonetic name moved from Metadata into the Voice section and is still stored in extensions.phoneticName. Preview says it, so you can hear the pronunciation.
  • When TTS is off, or everyone shares one voice, the section shows one plain sentence, the existing Use a voice per character switch where it applies, and a button that opens the Text to Speech settings.
  • Same-name cards (for example an AU copy) now keep their own voices.
    • resolveTTSVoiceForSpeaker prefers a character's own row over a row that only matches by name.
    • An empty Voice field names the voice a same-name card would otherwise get, instead of claiming "Default voice".
    • Speak on a message now finds the speaking card the same way autoplay does.
  • Typing during a slow save is kept. Saves still waiting on the server are counted, so an earlier save's refetch no longer wipes newer text.
  • Copy and docs. English localization keys only. docs/characters/creating-and-editing-characters.md and docs/media/tts-setup.md describe the Voice tab and the new home of Phonetic name. CHANGELOG entry added.
  • Tests:
    • tts-source-persistence.regression.ts is extended for the read and write helpers and the same-name rules.
    • e2e/ux-feedback-sweep.e2e.ts now counts 10 editor sections, and a new desktop test covers the same-name placeholder and typing through a held save.
    • Each new check was shown to fail without its fix.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Run by the agent:

  • On the final tree: pnpm check, pnpm localization:check and tts-source-persistence pass.
  • Before the final rebase onto staging (base a4c32dfbe; the rebase only brought Decision changes): the e2e on desktop Chromium (both tests, 3 runs each) and the mobile section count passed, and so did pnpm smoke:ui on desktop.
  • Local CodeRabbit found one trivial item: the regression's check that both chat playback paths use the speaker lookup was tied to their local variable names. It now accepts any call to findTTSCharacterIdBySpeakerName(...); the import line alone still does not pass.
  • An adversarial review found two major and three minor problems, all reproduced and fixed. A nit is left as is: the settings button opens Connections with the Text to Speech card collapsed, but its Enable switch is already in view.
  • Not caused by this change: the e2e "ElevenLabs keeps models visible and exposes scrollable account voices in every assignment mode" also fails locally on desktop Chromium at the base commit without these changes.

Still to verify by hand:

  • Open a character's Voice section, pick a voice, and check that Connections → Text to Speech shows the same voice for that character, and the other way round.
  • Press Preview and hear the chosen voice say the Phonetic name.
  • Duplicate a character that has a voice, and check that the copy's empty field reads " (from a card with a matching name)" and Preview plays that voice.
  • With ElevenLabs (dropdown picker), check that the empty option shows the friendly voice name for a same-name copy.
  • In a group chat with two same-named cards that have different voices, Speak on each card's message plays that card's own voice, the same as autoplay.
  • Over a slow link, type a voice name in bursts and check that every keystroke stays.
  • Check the Voice section on an iPhone-sized WebKit browser; mobile-webkit was not run locally.
  • Check the two updated guides in the in-app docs viewer.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

English guides updated: docs/characters/creating-and-editing-characters.md and docs/media/tts-setup.md. A [docs-i18n] follow-up issue tracks the translations.

Summary by CodeRabbit

  • New Features
    • Added a Voice section to the Character Editor for choosing and previewing a character’s text-to-speech voice.
    • Moved Phonetic name to the Voice section. Voice settings stay synchronized with the Text to Speech settings.
    • Characters with the same name can use separate voices once each has a voice assigned; otherwise, they can share a matching character’s voice, with the global voice as a fallback.
  • Documentation
    • Updated character editing and text-to-speech guides with the new voice controls and assignment behavior.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6998 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/3/2026 **Status:** ✅ Merged **Merged:** 10/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/character-voice-section` --- ### 📝 Commits (7) - [`70fe5c4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/70fe5c4e8f848199cb2221900067ca75c25afb66) feat(characters): add a Voice section to the Character Editor - [`03219ec`](https://github.com/Pasta-Devs/Marinara-Engine/commit/03219ecd8e52b2e8ec9ffcd5539f58701f4c8bfa) fix(characters): make the Voice section show the voice in use and keep typing through slow saves - [`9852343`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9852343b6d50c7f3e3ab42e4451a0683245ce6ee) docs(changelog): point the Voice section entry at its Engine issue - [`00de07d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00de07d5f763983b98bfc1cfff09eba2a64cc220) Merge remote-tracking branch 'origin/staging' into feat/character-voice-section - [`3694331`](https://github.com/Pasta-Devs/Marinara-Engine/commit/36943318c85e66a08f7b0833714356f39b1ad31a) test(tts): check that chat playback calls the speaker lookup, whatever its argument names - [`c37fd91`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c37fd913704ead88b421913674b0940c99c6ef60) Merge remote-tracking branch 'origin/staging' into feat/character-voice-section - [`c6e090c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c6e090cca43f3eff1b953ee2058cfdee70f1f653) Merge branch 'staging' into feat/character-voice-section ### 📊 Changes **12 files changed** (+598 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/characters/creating-and-editing-characters.md` (+13 -4) 📝 `docs/media/tts-setup.md` (+4 -2) 📝 `e2e/core-flows.e2e.ts` (+1 -1) 📝 `e2e/ux-feedback-sweep.e2e.ts` (+63 -1) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+67 -15) ➕ `packages/client/src/components/characters/CharacterVoicePicker.tsx` (+251 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+7 -9) 📝 `packages/client/src/components/panels/settings/TTSConfigCard.tsx` (+27 -27) 📝 `packages/client/src/lib/tts-dialogue.ts` (+48 -7) 📝 `packages/client/src/localization/locales/en.json` (+13 -0) 📝 `scripts/regressions/tts-source-persistence.regression.ts` (+103 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6997 Refs Pasta-Devs/Marinara-Agents#1176, where this was requested and scoped. ## Why this change A character's Text to Speech voice could only be set in **Connections → Text to Speech**, which people struggle to find, and it felt disconnected from the character. The maintainer agreed on Agents#1176 to add a Voice section to the Character Editor that edits the same setting, and to leave out clone audio, voice descriptions and any new storage. ## What changed - **New Voice tab** in the Character Editor (`CharacterVoicePicker.tsx`), between Colors and Stats. It reads and writes this character's row of the shared TTS `voiceAssignments`, the same list Connections → Text to Speech edits, so the two always match. A pick saves right away, as on the TTS card. - **Reuse.** It uses the TTS card's voice list query and pickers. `VoiceSelect` and `CustomizableVoiceInput` are now exported, and `buildTTSVoiceOptions` is shared by the card and the editor. It has a refresh button, and **Preview** speaks a short line through the existing `ttsService.speak` → `/api/tts/speak` path. - **Phonetic name** moved from Metadata into the Voice section and is still stored in `extensions.phoneticName`. Preview says it, so you can hear the pronunciation. - **When TTS is off, or everyone shares one voice**, the section shows one plain sentence, the existing **Use a voice per character** switch where it applies, and a button that opens the Text to Speech settings. - **Same-name cards** (for example an AU copy) now keep their own voices. - `resolveTTSVoiceForSpeaker` prefers a character's own row over a row that only matches by name. - An empty Voice field names the voice a same-name card would otherwise get, instead of claiming "Default voice". - **Speak** on a message now finds the speaking card the same way autoplay does. - **Typing during a slow save** is kept. Saves still waiting on the server are counted, so an earlier save's refetch no longer wipes newer text. - **Copy and docs.** English localization keys only. `docs/characters/creating-and-editing-characters.md` and `docs/media/tts-setup.md` describe the Voice tab and the new home of Phonetic name. CHANGELOG entry added. - **Tests:** - `tts-source-persistence.regression.ts` is extended for the read and write helpers and the same-name rules. - `e2e/ux-feedback-sweep.e2e.ts` now counts 10 editor sections, and a new desktop test covers the same-name placeholder and typing through a held save. - Each new check was shown to fail without its fix. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Run by the agent: - On the final tree: `pnpm check`, `pnpm localization:check` and `tts-source-persistence` pass. - Before the final rebase onto staging (base a4c32dfbe; the rebase only brought Decision changes): the e2e on desktop Chromium (both tests, 3 runs each) and the mobile section count passed, and so did `pnpm smoke:ui` on desktop. - Local CodeRabbit found one trivial item: the regression's check that both chat playback paths use the speaker lookup was tied to their local variable names. It now accepts any call to `findTTSCharacterIdBySpeakerName(...)`; the import line alone still does not pass. - An adversarial review found two major and three minor problems, all reproduced and fixed. A nit is left as is: the settings button opens Connections with the Text to Speech card collapsed, but its Enable switch is already in view. - Not caused by this change: the e2e "ElevenLabs keeps models visible and exposes scrollable account voices in every assignment mode" also fails locally on desktop Chromium at the base commit without these changes. Still to verify by hand: - Open a character's **Voice** section, pick a voice, and check that **Connections → Text to Speech** shows the same voice for that character, and the other way round. - Press **Preview** and hear the chosen voice say the Phonetic name. - Duplicate a character that has a voice, and check that the copy's empty field reads "<voice> (from a card with a matching name)" and Preview plays that voice. - With ElevenLabs (dropdown picker), check that the empty option shows the friendly voice name for a same-name copy. - In a group chat with two same-named cards that have different voices, **Speak** on each card's message plays that card's own voice, the same as autoplay. - Over a slow link, type a voice name in bursts and check that every keystroke stays. - Check the Voice section on an iPhone-sized WebKit browser; mobile-webkit was not run locally. - Check the two updated guides in the in-app docs viewer. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) English guides updated: `docs/characters/creating-and-editing-characters.md` and `docs/media/tts-setup.md`. A `[docs-i18n]` follow-up issue tracks the translations. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a Voice section to the Character Editor for choosing and previewing a character’s text-to-speech voice. * Moved Phonetic name to the Voice section. Voice settings stay synchronized with the Text to Speech settings. * Characters with the same name can use separate voices once each has a voice assigned; otherwise, they can share a matching character’s voice, with the global voice as a fallback. * **Documentation** * Updated character editing and text-to-speech guides with the new voice controls and assignment behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:19:37 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
Pasta-Devs/Marinara-Engine#7421
No description provided.