Skip to content

Commit 3fe3d7b

Browse files
committed
Rebuild Text To Speech browser preview
1 parent 5e39a86 commit 3fe3d7b

15 files changed

Lines changed: 1468 additions & 2115 deletions

assets/theme-v2/partials/header-nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
<a data-nav-link data-toolbox-menu-item data-route="midi" href="toolbox/midi/index.html">MIDI</a>
6767
<a data-nav-link data-toolbox-menu-item data-route="music" href="toolbox/music/index.html">Music</a>
6868
<a data-nav-link data-toolbox-menu-item data-route="particles" href="toolbox/particles/index.html">Particles</a>
69+
<a data-nav-link data-toolbox-menu-item data-route="text-to-speech" href="toolbox/text-to-speech/index.html">Text To Speech</a>
6970
<a data-nav-link data-toolbox-menu-item data-route="videos" href="toolbox/videos/index.html">Videos</a>
7071
<a data-nav-link data-toolbox-menu-item data-route="speech-to-text" href="toolbox/speech-to-text/index.html">Voice Capture</a>
71-
<a data-nav-link data-toolbox-menu-item data-route="text-to-speech" href="toolbox/text-to-speech/index.html">Voice Output</a>
7272
<a data-nav-link data-toolbox-menu-item data-route="voices" href="toolbox/voices/index.html">Voices</a>
7373
</div>
7474
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PR_26171_037 Manual Validation Notes
2+
3+
## Manual Review
4+
- Reviewed the rebuilt active page at `toolbox/text-to-speech/index.html`.
5+
- Confirmed the page uses Theme V2 paths and shared toolbox partials.
6+
- Confirmed the creator workflow exposes text input, voice selection, rate, pitch, volume, Speak, and Stop controls.
7+
- Confirmed the page copy no longer blocks browser preview behind provider-not-implemented behavior.
8+
- Confirmed unavailable speech synthesis has visible actionable status text.
9+
- Confirmed the incorrect `tools/text2speech/` path is absent.
10+
11+
## Environment Note
12+
Audio output was validated through a Playwright Web Speech API stub that records `speak` and `cancel` calls. Physical speaker playback was not audited in this headless validation environment.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR_26171_037 Requirement Checklist
2+
3+
| Requirement | Result | Notes |
4+
| --- | --- | --- |
5+
| Use archive `old_text2speech-V2` as behavior reference only | PASS | Reviewed archive controls and engine behavior; rebuilt in current architecture. |
6+
| Active tool path is `toolbox/text-to-speech/` | PASS | Page and module live under the active toolbox path. |
7+
| Restore browser TTS capability | PASS | Browser preview uses `TextToSpeechEngine` and Web Speech API. |
8+
| Creator can enter text | PASS | Textarea is wired into preview request creation. |
9+
| Creator can select available browser voice | PASS | Voice select is populated from browser voices and handles empty state. |
10+
| Creator can adjust rate, pitch, and volume | PASS | Sliders update visible values and preview request options. |
11+
| Speak/Preview can call browser TTS | PASS | Playwright confirms `speechSynthesis.speak` path is called when available. |
12+
| Stop speech | PASS | Playwright confirms Stop calls cancel. |
13+
| Visible actionable unavailable-engine error | PASS | Missing Web Speech API shows an unavailable status and disables preview actions. |
14+
| Do not block browser TTS behind provider not implemented | PASS | Browser provider is implemented locally; paid providers remain planning only. |
15+
| Remove placeholder-only provider behavior | PASS | Placeholder generation/export shell behavior was removed from active preview path. |
16+
| JavaScript external only | PASS | Page references external scripts only. |
17+
| No inline script/style/event handlers | PASS | Targeted static validation passed. |
18+
| Theme V2 only | PASS | Page references Theme V2 stylesheet and shared partials. |
19+
| No fake generation | PASS | No fake audio generation added. |
20+
| No database tables | PASS | No schema or database table changes made. |
21+
| No external paid provider integration | PASS | Paid provider adapters are planning metadata only. |
22+
| Remove incorrect `tools/text2speech` path | PASS | Static check confirms the path is absent. |
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# PR_26171_037 Validation Report
2+
3+
## Commands
4+
- `node --test tests\tools\Text2SpeechShell.test.mjs` - PASS
5+
- `npx playwright test tests/playwright/tools/TextToSpeechFunctional.spec.mjs --project=playwright --workers=1 --reporter=list` - PASS
6+
- Targeted static Text To Speech validation script - PASS
7+
- `git diff --check` - PASS
8+
- `npm run test:workspace-v2` - FAIL
9+
10+
## Targeted Coverage
11+
- Page loads from `toolbox/text-to-speech/index.html`.
12+
- Text input updates the preview model.
13+
- Voice select renders the available browser voice list and empty/unavailable state.
14+
- Rate, pitch, and volume sliders update visible values.
15+
- Speak calls the browser TTS path when Web Speech API support is available.
16+
- Stop calls `speechSynthesis.cancel()` through the engine.
17+
- Missing Web Speech API support shows a visible actionable error.
18+
- No inline scripts, style blocks, inline styles, or inline event handlers were detected.
19+
- `tools/text2speech/` was absent.
20+
21+
## Project Workspace Command Note
22+
`npm run test:workspace-v2` is the legacy command name for Project Workspace validation. The command ran and failed in `tests/playwright/tools/RootToolsFutureState.spec.mjs` on five broad root/toolbox expectations:
23+
- Root tools list expected `[data-tools-accordion-list] .control-card` entries but found none.
24+
- Common header test did not find `header.site-header` on one active page.
25+
- Learn/tool template/representative tool tests reported failed requests to `http://127.0.0.1:5501/api/...`.
26+
27+
The targeted Text To Speech unit, static, and Playwright validations passed after the functional rebuild.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PR_26171_037 Text To Speech Functional Tool Rebuild
2+
3+
## Purpose
4+
- Rebuilt Text To Speech as a functional browser TTS tool in the active path `toolbox/text-to-speech/`.
5+
- Used `archive/v1-v2/tools/old_text2speech-V2` as behavior reference material only.
6+
- Kept browser Web Speech API as the local functional engine for this PR.
7+
8+
## Implementation
9+
- Replaced the placeholder-only Text To Speech page with a Theme V2 / Tool Template V2 aligned workspace surface.
10+
- Added creator text entry, browser voice selection, rate, pitch, and volume controls with visible values.
11+
- Wired Speak and Stop actions through the existing `TextToSpeechEngine` Web Speech API wrapper.
12+
- Added visible actionable unavailable-engine messaging when `speechSynthesis` is not present.
13+
- Removed provider-not-implemented blocking behavior from the browser preview path.
14+
- Kept future paid provider adapters as planning metadata only.
15+
- Updated current toolbox registration and shared navigation labels from `Voice Output` to `Text To Speech`.
16+
- Confirmed `tools/text2speech/` does not exist.
17+
18+
## Scope Notes
19+
- No archived implementation was copied directly.
20+
- No fake generation was added.
21+
- No database tables were added.
22+
- No external paid provider integration was added.
23+
- JavaScript remains external with no inline script blocks, style blocks, inline styles, or inline event handlers.
Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
# git status --short
2-
M docs_build/dev/reports/codex_changed_files.txt
3-
M docs_build/dev/reports/codex_review.diff
2+
M assets/theme-v2/partials/header-nav.html
3+
M src/dev-runtime/admin/header-nav.local.html
4+
M src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js
5+
M src/dev-runtime/server/local-api-router.mjs
6+
M src/shared/toolbox/tool-metadata-inventory.js
7+
M tests/tools/Text2SpeechShell.test.mjs
48
M toolbox/text-to-speech/index.html
5-
?? docs_build/dev/reports/PR_26171_027-text2speech-rebuild-foundation.md
6-
?? docs_build/dev/reports/PR_26171_029-text2speech-tool-shell.md
7-
?? docs_build/dev/reports/PR_26171_031-text2speech-message-model.md
8-
?? docs_build/dev/reports/PR_26171_033-text2speech-generation-workflow.md
9-
?? docs_build/dev/reports/PR_26171_035-text2speech-provider-adapter-plan.md
10-
?? docs_build/dev/reports/PR_26171_text2speech-manual-validation.md
11-
?? docs_build/dev/reports/PR_26171_text2speech-toolbox-path-correction.md
12-
?? docs_build/dev/reports/PR_26171_text2speech-validation.md
13-
?? docs_build/dev/reports/PR_26171_text2speech-zip-verification.md
14-
?? tests/tools/Text2SpeechShell.test.mjs
15-
?? toolbox/text-to-speech/text2speech.js
9+
M toolbox/text-to-speech/text2speech.js
10+
?? docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild-manual-validation.md
11+
?? docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild-requirements.md
12+
?? docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild-validation.md
13+
?? docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild.md
14+
?? tests/playwright/tools/TextToSpeechFunctional.spec.mjs
1615

1716
# git ls-files --others --exclude-standard
18-
docs_build/dev/reports/PR_26171_027-text2speech-rebuild-foundation.md
19-
docs_build/dev/reports/PR_26171_029-text2speech-tool-shell.md
20-
docs_build/dev/reports/PR_26171_031-text2speech-message-model.md
21-
docs_build/dev/reports/PR_26171_033-text2speech-generation-workflow.md
22-
docs_build/dev/reports/PR_26171_035-text2speech-provider-adapter-plan.md
23-
docs_build/dev/reports/PR_26171_text2speech-manual-validation.md
24-
docs_build/dev/reports/PR_26171_text2speech-toolbox-path-correction.md
25-
docs_build/dev/reports/PR_26171_text2speech-validation.md
26-
docs_build/dev/reports/PR_26171_text2speech-zip-verification.md
27-
tests/tools/Text2SpeechShell.test.mjs
28-
toolbox/text-to-speech/text2speech.js
17+
docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild-manual-validation.md
18+
docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild-requirements.md
19+
docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild-validation.md
20+
docs_build/dev/reports/PR_26171_037-text2speech-functional-tool-rebuild.md
21+
tests/playwright/tools/TextToSpeechFunctional.spec.mjs
2922

3023
# git diff --stat
31-
docs_build/dev/reports/codex_changed_files.txt | 40 +-
32-
docs_build/dev/reports/codex_review.diff | 1428 ++++++++++++++++++++++--
33-
toolbox/text-to-speech/index.html | 76 +-
34-
3 files changed, 1406 insertions(+), 138 deletions(-)
24+
assets/theme-v2/partials/header-nav.html | 2 +-
25+
src/dev-runtime/admin/header-nav.local.html | 2 +-
26+
.../game-journey-mock-repository.js | 2 +-
27+
src/dev-runtime/server/local-api-router.mjs | 13 +-
28+
src/shared/toolbox/tool-metadata-inventory.js | 27 ++-
29+
tests/tools/Text2SpeechShell.test.mjs | 36 ++-
30+
toolbox/text-to-speech/index.html | 78 ++++---
31+
toolbox/text-to-speech/text2speech.js | 260 +++++++++++++++++----
32+
8 files changed, 309 insertions(+), 111 deletions(-)

0 commit comments

Comments
 (0)