|
| 1 | +# PR_26130_013-text-to-speech-v2-polish |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +Polish the existing `text2speach-V2` tool so user-facing surfaces read as `Text to Speech V2`, the header follows the shared first-class tool shell pattern, named sentence selection fully hydrates Speech Options, and Rate / Speed is capped to the practical browser `speechSynthesis` range used by the tool. |
| 6 | + |
| 7 | +## Scope |
| 8 | + |
| 9 | +Changed only Text to Speech V2 runtime/defaults/schema/UI, the visible tool registry/workspace navigation labels needed for launch surfaces, and targeted Workspace Manager V2 Playwright coverage. |
| 10 | + |
| 11 | +The internal tool id, schema id, DOM ids, path, folder, and workspace toolState key remain `text2speach-V2`. |
| 12 | + |
| 13 | +No `start_of_day` files were changed. |
| 14 | + |
| 15 | +## Implementation Summary |
| 16 | + |
| 17 | +- Updated visible tool title, card/nav labels, how-to/readme naming, sample copy, status messages, queue data name, and schema title to `Text to Speech V2`. |
| 18 | +- Added the shared `toolShellCommon.css` header frame and kept the tool-specific header class for scoped styling/tests. |
| 19 | +- Renamed the left queue accordion to `Named Sentences`. |
| 20 | +- Added complete named sentence defaults so each queue item carries language, voice, gender, age, presets, queue mode, auto speak, repeat, delay, volume, rate, pitch, and text. |
| 21 | +- Fixed named sentence selection hydration by rebinding the requested queue item voice when the selected item changes, preventing the previous voice selection from leaking into the newly selected item. |
| 22 | +- Added `gender` to required queue item options and to the schema/default queue payload. |
| 23 | +- Capped Rate / Speed at `2` in defaults, schema, UI range setup, engine utterance clamping, and Playwright assertions. |
| 24 | + |
| 25 | +## Playwright Impact |
| 26 | + |
| 27 | +Playwright impacted: Yes. |
| 28 | + |
| 29 | +Coverage added/updated for: |
| 30 | + |
| 31 | +- visible `Text to Speech V2` naming on the tools index, direct tool page, and Workspace Manager V2 launch tile |
| 32 | +- shared header layout class on the Text to Speech V2 intro/header |
| 33 | +- `Named Sentences` accordion label |
| 34 | +- schema-complete named sentence defaults including required `gender` |
| 35 | +- named sentence selection hydrating all Speech Options fields from selected JSON data |
| 36 | +- Rate / Speed slider maximum and schema maximum capped at `2` |
| 37 | +- updated status log text using the visible `Text to Speech V2` label |
| 38 | + |
| 39 | +Expected pass behavior: selecting each named sentence updates text, gender, language, voice, age, presets, queue mode, repeat, delay, volume, rate, pitch, and summary state from the selected JSON item. |
| 40 | + |
| 41 | +Expected fail behavior: tests fail if visible naming regresses to `text2speach-V2`, the shared header frame is missing, Rate / Speed exceeds `2`, queue items are schema-incomplete, or named sentence selection preserves stale option values. |
| 42 | + |
| 43 | +## Validation |
| 44 | + |
| 45 | +Passed: |
| 46 | + |
| 47 | +```text |
| 48 | +npm run test:workspace-v2 |
| 49 | +``` |
| 50 | + |
| 51 | +Result: |
| 52 | + |
| 53 | +```text |
| 54 | +28 passed |
| 55 | +``` |
| 56 | + |
| 57 | +Additional checks passed: |
| 58 | + |
| 59 | +```text |
| 60 | +node --check src/engine/audio/TextToSpeechDefaults.js |
| 61 | +node --check src/engine/audio/TextToSpeechEngine.js |
| 62 | +node --check tools/text2speach-V2/js/TextToSpeechToolApp.js |
| 63 | +node --check tools/text2speach-V2/js/controls/SpeechOptionsControl.js |
| 64 | +node --check tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js |
| 65 | +node --check tools/toolRegistry.js |
| 66 | +node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs |
| 67 | +node -e "JSON.parse(require('node:fs').readFileSync('tools/schemas/tools/text2speach-V2.schema.json','utf8'));" |
| 68 | +rg -n -P "<script(?![^>]*\bsrc=)|<style|\son[a-zA-Z]+=" tools/text2speach-V2/index.html tools/text2speach-V2/how_to_use.html |
| 69 | +git diff --check HEAD -- . |
| 70 | +``` |
| 71 | + |
| 72 | +The inline HTML restriction scan returned no matches. `git diff --check` reported only the existing Windows line-ending warnings and no whitespace errors. |
| 73 | + |
| 74 | +## Full Samples Smoke Test |
| 75 | + |
| 76 | +Skipped. The full samples smoke test is intentionally out of scope because this PR is limited to Text to Speech V2 polish, schema/default alignment, named sentence hydration, and targeted Workspace Manager V2 Playwright coverage. |
| 77 | + |
| 78 | +## ZIP Artifact |
| 79 | + |
| 80 | +Repo-structured delta ZIP: |
| 81 | + |
| 82 | +```text |
| 83 | +tmp/PR_26130_013-text-to-speech-v2-polish_delta.zip |
| 84 | +``` |
| 85 | + |
| 86 | +## Manual Validation Steps |
| 87 | + |
| 88 | +1. Open `tools/text2speach-V2/index.html`. |
| 89 | +2. Confirm the browser title and visible heading read `Text to Speech V2`. |
| 90 | +3. Confirm the intro/header uses the shared first-class tool shell framing and the queue accordion reads `Named Sentences`. |
| 91 | +4. Select `Alert warning`, `Narrator welcome`, and `Hero ready`; Speech Options should update every option from the selected named sentence. |
| 92 | +5. Confirm Rate / Speed cannot exceed `2`. |
| 93 | + |
| 94 | +Expected outcome: user-facing naming is polished, the internal `text2speach-V2` contract is preserved, named sentences hydrate all speech options, and the practical Rate / Speed cap is enforced. |
| 95 | + |
| 96 | +## Changed Files |
| 97 | + |
| 98 | +- `src/engine/audio/TextToSpeechDefaults.js` |
| 99 | +- `src/engine/audio/TextToSpeechEngine.js` |
| 100 | +- `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` |
| 101 | +- `tools/schemas/tools/text2speach-V2.schema.json` |
| 102 | +- `tools/text2speach-V2/README.md` |
| 103 | +- `tools/text2speach-V2/how_to_use.html` |
| 104 | +- `tools/text2speach-V2/index.html` |
| 105 | +- `tools/text2speach-V2/js/TextToSpeechToolApp.js` |
| 106 | +- `tools/text2speach-V2/js/controls/SpeechOptionsControl.js` |
| 107 | +- `tools/text2speach-V2/styles/text2speach-V2.css` |
| 108 | +- `tools/toolRegistry.js` |
| 109 | +- `tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js` |
| 110 | +- `docs/dev/reports/PR_26130_013-text-to-speech-v2-polish.md` |
| 111 | +- `docs/dev/reports/codex_review.diff` |
| 112 | +- `docs/dev/reports/codex_changed_files.txt` |
| 113 | +- `docs/dev/codex_commands.md` |
| 114 | +- `docs/dev/commit_comment.txt` |
0 commit comments