mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1255] [MERGED] feat(tts): split quoted dialogue from prose narration #5005
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5005
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1255
Author: @cha1latte
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @cha1latte
Base:
refactor← Head:port/pr-1143-refactor📝 Commits (3)
8240437feat(tts): split quoted dialogue from narrationd4c564bAddress TTS review feedback43705b5Normalize narrator voice settings📊 Changes
11 files changed (+521 additions, -39 deletions)
View changed files
📝
src/engine/contracts/types/tts.ts(+2 -0)📝
src/features/modes/shared/chat-ui/components/ChatMessage.tsx(+18 -16)📝
src/features/modes/shared/chat-ui/hooks/use-chat-tts-autoplay.ts(+6 -9)📝
src/features/modes/shared/chat-ui/hooks/use-streaming-tts.test.tsx(+52 -3)📝
src/features/shell/settings/components/settings/TTSConfigCard.tsx(+79 -0)📝
src/shared/lib/dialogue-quotes.ts(+4 -3)📝
src/shared/lib/sentence-chunker.test.ts(+29 -0)📝
src/shared/lib/sentence-chunker.ts(+42 -3)➕
src/shared/lib/tts-dialogue.test.ts(+90 -0)📝
src/shared/lib/tts-dialogue.ts(+64 -5)📝
src/shared/lib/tts-service.ts(+135 -0)📄 Description
Linked issue
Closes #1144
Ports #1143 to the refactor branch.
Why this change
Users can configure a separate narrator voice, but unstructured roleplay replies without
<speaker>tags were still spoken as one character-voice utterance. That meant prose narration and quoted dialogue could not use separate voices in normal roleplay output.This adds quote-aware routing so prose outside quotes uses the narrator voice and quoted dialogue keeps the fallback character voice when narrator splitting is enabled.
What changed
narratorVoiceEnabledandnarratorVoiceTTS config fields.Refactor impact
Primary owner:
shared TTS / chat playback
Impact areas reviewed:
src/shared/libTTS helpers, sentence chunker, and TTS serviceBoundary notes:
dialogueOnly,<speaker>tag, VN/Game speaker-line paths are intentionally left in their existing routing path.Pressure points touched:
ChatMessageuse-chat-tts-autoplayTTSConfigCardValidation
pnpm checkpasses locallypnpm typecheckpasses locallypnpm buildpasses locallypnpm check:architecturepasses locallypnpm check:docspasses locallycargo check --manifest-path src-tauri/Cargo.toml --workspacepasses locallyManual verification notes
Codex verification run:
pnpm test -- src/shared/lib/tts-dialogue.test.ts src/shared/lib/sentence-chunker.test.ts src/features/modes/shared/chat-ui/hooks/use-streaming-tts.test.tsxpassed: 3 files, 13 tests.pnpm checkpassed.pnpm buildpassed.pnpm lintpassed.Manual/provider smoke still recommended before marking ready:
Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdUI evidence
No screenshot attached. This adds a small TTS settings control and changes playback routing; local compile/build/tests passed, but real provider voice timbre still needs manual smoke verification.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.