Skip to content

Commit 9df4942

Browse files
authored
PR_26171_061 text to speech engine audio feature parity
Restore Text To Speech feature parity from old_text2speech-V2 using the shared engine/audio module. Validation: - node --check src\engine\audio\TextToSpeechEngine.js - node --check toolbox\text-to-speech\text2speech.js - node --test tests\tools\Text2SpeechShell.test.mjs - npx playwright test tests/playwright/tools/TextToSpeechFunctional.spec.mjs - npm run test:workspace-v2 - git diff --check
1 parent 0c35f32 commit 9df4942

14 files changed

Lines changed: 3222 additions & 1090 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PR_26171_061 Engine Audio Ownership Checklist
2+
3+
## Engine Ownership
4+
5+
- PASS: Reusable TTS voice filtering lives in `src/engine/audio/TextToSpeechEngine.js`.
6+
- PASS: Reusable TTS preset shaping lives in `src/engine/audio/TextToSpeechEngine.js`.
7+
- PASS: Reusable TTS queue item helpers live in `src/engine/audio/TextToSpeechEngine.js`.
8+
- PASS: Existing defaults remain in `src/engine/audio/TextToSpeechDefaults.js`.
9+
- PASS: Active toolbox UI consumes the engine module instead of duplicating all engine behavior locally.
10+
11+
## Active Tool Ownership
12+
13+
- PASS: Active tool remains under `toolbox/text-to-speech/`.
14+
- PASS: Active HTML remains Theme V2 only.
15+
- PASS: Active JavaScript remains external.
16+
- PASS: Active tool owns DOM wiring, status display, and control event handling.
17+
- PASS: Active tool does not create database behavior.
18+
19+
## Boundary Checks
20+
21+
- PASS: No `tools/text2speech/` path was created.
22+
- PASS: Archived `old_text2speech-V2` was used as a read-only functionality sample.
23+
- PASS: Archived tool files were not activated in navigation.
24+
- PASS: Browser SpeechSynthesis is the implemented local provider.
25+
- PASS: Planned providers remain documented but do not block browser preview.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# PR_26171_061 Instruction Compliance Checklist
2+
3+
## Pre-Work Gate
4+
5+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before file changes.
6+
- PASS: Read `docs_build/dev/PROJECT_MULTI_PC.txt` before file changes.
7+
- PASS: Reported instruction compliance PASS/FAIL before file changes.
8+
- PASS: `git branch --show-current` reported `main` before branch creation.
9+
- PASS: `git checkout main` completed before branch creation.
10+
- PASS: `git pull origin main` completed before branch creation.
11+
- PASS: `git status` reported a clean working tree before branch creation.
12+
- PASS: Created branch `pr/26171-061-text2speech-engine-audio-feature-parity` from clean latest `main`.
13+
14+
## Owner And Parity
15+
16+
- PASS: PR number `061` is odd.
17+
- PASS: Odd parity maps to Laptop / Environment 2.
18+
- PASS: Text To Speech / TTS is owned by Laptop / Environment 2.
19+
- PASS: Implementation path matches active owner path: `toolbox/text-to-speech/`.
20+
- PASS: Shared engine path matches approved reusable audio path: `src/engine/audio/`.
21+
22+
## Hard Stop Checks
23+
24+
- PASS: Instructions were present and readable.
25+
- PASS: Branch workflow could be followed.
26+
- PASS: Repository was clean before branching.
27+
- PASS: No owner mismatch.
28+
- PASS: No parity mismatch.
29+
- PASS: No wrong implementation path.
30+
- PASS: Scoped validation was not skipped.
31+
- PASS: Required reports were created.
32+
- PASS: Required repo ZIP was created.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# PR_26171_061 Manual Validation Notes
2+
3+
## Manual Review
4+
5+
- Confirmed active Text To Speech path is `toolbox/text-to-speech/`.
6+
- Confirmed no `tools/text2speech/` directory was created.
7+
- Confirmed old functionality sample path is `archive/v1-v2/tools/old_text2speech-V2/`.
8+
- Confirmed active HTML has external scripts only.
9+
- Confirmed active HTML has no inline style attributes or inline event handlers.
10+
- Confirmed no database files were changed.
11+
12+
## Automated Browser Coverage Used For Manual Equivalents
13+
14+
- Opened active Text To Speech page through targeted Playwright validation.
15+
- Verified browser voices render.
16+
- Verified restored control groups render.
17+
- Verified preset shaping updates pitch and volume values.
18+
- Verified named sentence Add, Duplicate, and Delete.
19+
- Verified output summary includes queue JSON.
20+
- Verified Speak, Pause, Resume, and Stop call the browser SpeechSynthesis mock.
21+
- Verified unavailable SpeechSynthesis shows actionable error.
22+
23+
## Out Of Scope Manual Checks
24+
25+
- No paid provider was manually exercised.
26+
- No generated audio file export was manually exercised.
27+
- No database behavior was manually exercised.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# PR_26171_061 Old TTS Feature Parity Checklist
2+
3+
Functionality sample: `archive/v1-v2/tools/old_text2speech-V2/`
4+
5+
## Controls And Options
6+
7+
- PASS: Gender helper filter restored.
8+
- PASS: Language filter restored.
9+
- PASS: Voice dropdown restored.
10+
- PASS: Voice details restored.
11+
- PASS: Voice Age select restored.
12+
- PASS: Character Preset select restored.
13+
- PASS: SSML-like Preset select restored.
14+
- PASS: Volume slider restored with visible value.
15+
- PASS: Rate / Speed slider restored with visible value.
16+
- PASS: Pitch slider restored with visible value.
17+
- PASS: Name field restored.
18+
- PASS: Text To Speak editor restored.
19+
20+
## Queue And JSON
21+
22+
- PASS: Named Sentences queue restored.
23+
- PASS: Add named sentence restored.
24+
- PASS: Duplicate named sentence restored.
25+
- PASS: Delete named sentence restored.
26+
- PASS: Output Summary JSON restored.
27+
- PASS: Import JSON restored for standalone launch.
28+
- PASS: Copy JSON restored for standalone launch.
29+
- PASS: Export JSON restored for standalone launch.
30+
- PASS: URL JSON source loading restored through `samplePresetPath`.
31+
32+
## Playback And Status
33+
34+
- PASS: Speak restored.
35+
- PASS: Pause restored when browser support exists.
36+
- PASS: Resume restored when browser support exists.
37+
- PASS: Stop restored.
38+
- PASS: Clearable status log restored.
39+
- PASS: Actionable unavailable-browser error restored.
40+
- PASS: No placeholder provider-blocking behavior remains for browser preview.
41+
42+
## Workspace
43+
44+
- PASS: Project Workspace launch detection restored.
45+
- PASS: Standalone JSON actions hide during Project Workspace launch.
46+
- PASS: Return to Project Workspace action restored.
47+
- PASS: Project Workspace toolState loading restored.
48+
- PASS: Project Workspace dirty-state writeback restored.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# PR_26171_061 Text To Speech Engine Audio Feature Parity
2+
3+
## Summary
4+
5+
Restored active Text To Speech feature parity from the archived `old_text2speech-V2` functionality sample while keeping active implementation in `toolbox/text-to-speech/` and reusable engine behavior in `src/engine/audio/`.
6+
7+
## Changed Scope
8+
9+
- Rebuilt reusable Text To Speech voice filtering, preset shaping, and queue-item helpers in `src/engine/audio/TextToSpeechEngine.js`.
10+
- Expanded `toolbox/text-to-speech/index.html` with Theme V2 controls for the old V2 feature set.
11+
- Rebuilt `toolbox/text-to-speech/text2speech.js` so the active tool consumes the engine audio module.
12+
- Expanded targeted browser validation in `tests/playwright/tools/TextToSpeechFunctional.spec.mjs`.
13+
- Updated Playwright V8 coverage artifacts for changed runtime JavaScript.
14+
15+
## Requirement Checklist
16+
17+
- PASS: Used `archive/v1-v2/tools/old_text2speech-V2/` as the required functionality sample.
18+
- PASS: Reusable TTS behavior lives in `src/engine/audio/`.
19+
- PASS: `toolbox/text-to-speech/` consumes `src/engine/audio/TextToSpeechEngine.js`.
20+
- PASS: Restored old controls/options/features in the active tool.
21+
- PASS: Browser SpeechSynthesis provider remains implemented.
22+
- PASS: Planned provider adapters do not block browser preview behavior.
23+
- PASS: No `tools/text2speech/` path was created.
24+
- PASS: No database files were changed.
25+
- PASS: Theme V2 remains the styling source.
26+
- PASS: HTML uses external JavaScript only.
27+
- PASS: No inline script, style, or event handler was added.
28+
29+
## Restored Feature Set
30+
31+
- Import JSON.
32+
- Copy JSON.
33+
- Export JSON.
34+
- Project Workspace return action during workspace launch.
35+
- Gender helper filter.
36+
- Language filter.
37+
- Browser voice selection.
38+
- Voice details.
39+
- Voice age shaping.
40+
- Character presets.
41+
- SSML-like presets.
42+
- Volume, rate, and pitch sliders with visible values.
43+
- Named sentence Name field.
44+
- Add, Duplicate, and Delete named sentence actions.
45+
- Text To Speak editor.
46+
- Speak, Pause, Resume, and Stop playback actions.
47+
- Named Sentences queue.
48+
- Output Summary JSON.
49+
- Clearable Status log.
50+
- URL JSON preset loading through `samplePresetPath`.
51+
- Project Workspace toolState loading and dirty-state writeback.
52+
53+
## Validation Summary
54+
55+
- PASS: `node --check src\engine\audio\TextToSpeechEngine.js`
56+
- PASS: `node --check toolbox\text-to-speech\text2speech.js`
57+
- PASS: `node --test tests\tools\Text2SpeechShell.test.mjs`
58+
- PASS: `npx playwright test tests/playwright/tools/TextToSpeechFunctional.spec.mjs`
59+
- PASS: `npm run test:workspace-v2`
60+
- Note: command name is legacy; user-facing language is Project Workspace.
61+
- PASS: `git diff --check`
62+
- PASS: changed runtime JS coverage collected for `src/engine/audio/TextToSpeechEngine.js`.
63+
- PASS: changed runtime JS coverage collected for `toolbox/text-to-speech/text2speech.js`.
64+
65+
## Out Of Scope
66+
67+
- No database changes.
68+
- No external paid provider implementation.
69+
- No generated audio file export provider.
70+
- No new `tools/text2speech/` path.
71+
- No archived tool activation.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PR_26171_061 Validation Report
2+
3+
## Commands Run
4+
5+
- `node --check src\engine\audio\TextToSpeechEngine.js`
6+
- PASS.
7+
- `node --check toolbox\text-to-speech\text2speech.js`
8+
- PASS.
9+
- `node --test tests\tools\Text2SpeechShell.test.mjs`
10+
- PASS: 3 tests passed.
11+
- `npx playwright test tests/playwright/tools/TextToSpeechFunctional.spec.mjs`
12+
- PASS: 2 tests passed.
13+
- Covers restored controls, preset shaping, queue add/duplicate/delete, output summary, pause/resume, speak, stop, and unavailable SpeechSynthesis error handling.
14+
- PASS: rerun after merging `origin/main` into the PR branch for conflict resolution.
15+
- `npm run test:workspace-v2`
16+
- PASS: 5 Project Workspace tests passed.
17+
- Note: command name is legacy; user-facing language is Project Workspace.
18+
- Note: first execution used a 120s timeout and timed out before completion; rerun with a longer timeout completed successfully.
19+
- PASS: rerun after merging `origin/main` into the PR branch for conflict resolution.
20+
- `git diff --check`
21+
- PASS.
22+
23+
## Coverage
24+
25+
- PASS: `docs_build/dev/reports/playwright_v8_coverage_report.txt` produced changed runtime JS coverage.
26+
- PASS: `docs_build/dev/reports/coverage_changed_js_guardrail.txt` reports no changed runtime JS coverage warnings.
27+
- PASS: `src/engine/audio/TextToSpeechEngine.js` covered at 71%.
28+
- PASS: `toolbox/text-to-speech/text2speech.js` covered at 71%.
29+
30+
## Artifact Verification
31+
32+
- PASS: `docs_build/dev/reports/codex_review.diff` exists.
33+
- PASS: `docs_build/dev/reports/codex_changed_files.txt` exists.
34+
- PASS: `tmp/PR_26171_061-text2speech-engine-audio-feature-parity_delta.zip` exists.
35+
- PASS: ZIP size is greater than zero.
36+
- PASS: ZIP contents preserve repo-relative paths.
37+
38+
## Skipped
39+
40+
- Full samples validation skipped because no sample JSON or sample runtime behavior changed.
41+
- Database validation skipped because no database files or runtime persistence changed.
42+
- External provider validation skipped because paid/provider generation is out of scope and browser SpeechSynthesis is the implemented provider for this PR.
Lines changed: 43 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,54 @@
1-
# Codex Changed Files - PR_26171_041-idea-board-production-polish
1+
# Codex Changed Files - PR_26171_061-text2speech-engine-audio-feature-parity
22

33
## Git Workflow
4-
- Current branch: `codex/pr-26171-041-idea-board-production-polish`.
5-
- Expected starting branch: `main` (PASS before branch creation).
6-
- Created branch: `codex/pr-26171-041-idea-board-production-polish`.
7-
- Commit before conflict resolution: `ca626873a4cf19925229851b0da2a4ff55c2073f`.
8-
- Initial push result: PASS, branch pushed to `origin/codex/pr-26171-041-idea-board-production-polish`.
9-
- PR URL: `https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/17`.
10-
- Conflict resolution: merged `origin/main` at `0a364f85516aea82e38eea2f498fde5980f9adf9`; conflicts were limited to `codex_changed_files.txt` and `codex_review.diff`.
11-
- Conflict resolution push result: pending until after merge-validation commit.
12-
- Merge result: pending until after PR validation/merge.
13-
- Final main sync: pending until after merge and final pull.
4+
- Starting branch: `main`.
5+
- Created branch: `pr/26171-061-text2speech-engine-audio-feature-parity`.
6+
- Initial commit: `e4541d63719ab777b0654c8fecf4b13237d31256`.
7+
- PR branch was merged with `origin/main` during PR conflict recovery.
8+
- Conflicts were limited to generated report artifacts.
149

15-
## Git Status
10+
## Scoped Diff Stat
1611
```text
17-
M assets/theme-v2/css/tables.css
18-
M assets/theme-v2/js/tool-display-mode.js
19-
M docs_build/dev/reports/codex_changed_files.txt
20-
M docs_build/dev/reports/codex_review.diff
21-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
22-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
23-
M src/shared/toolbox/tool-metadata-inventory.js
24-
M tests/playwright/tools/IdeaBoardTableNotes.spec.mjs
25-
M tests/playwright/tools/ToolboxRoutePages.spec.mjs
26-
M toolbox/idea-board/index.html
27-
M toolbox/idea-board/index.js
12+
...R_26171_061-engine-audio-ownership-checklist.md | 25 +
13+
...R_26171_061-instruction-compliance-checklist.md | 32 +
14+
.../PR_26171_061-manual-validation-notes.md | 27 +
15+
...R_26171_061-old-tts-feature-parity-checklist.md | 48 ++
16+
..._061-text2speech-engine-audio-feature-parity.md | 71 ++
17+
docs_build/dev/reports/PR_26171_061-validation.md | 42 +
18+
docs_build/dev/reports/codex_changed_files.txt | 118 +--
19+
.../dev/reports/coverage_changed_js_guardrail.txt | 7 +-
20+
.../dev/reports/playwright_v8_coverage_report.txt | 36 +-
21+
src/engine/audio/TextToSpeechEngine.js | 208 ++++-
22+
.../tools/TextToSpeechFunctional.spec.mjs | 30 +
23+
toolbox/text-to-speech/index.html | 119 +--
24+
toolbox/text-to-speech/text2speech.js | 853 +++++++++++++++++----
25+
13 files changed, 1317 insertions(+), 299 deletions(-)
2826
```
2927

30-
## Diff Stat
31-
```text
32-
assets/theme-v2/css/tables.css | 70 +++++++-
33-
assets/theme-v2/js/tool-display-mode.js | 2 +-
34-
.../dev/reports/coverage_changed_js_guardrail.txt | 5 +-
35-
.../dev/reports/playwright_v8_coverage_report.txt | 11 +-
36-
src/shared/toolbox/tool-metadata-inventory.js | 6 +-
37-
.../playwright/tools/IdeaBoardTableNotes.spec.mjs | 71 +++++++-
38-
tests/playwright/tools/ToolboxRoutePages.spec.mjs | 26 ++-
39-
toolbox/idea-board/index.html | 31 ++--
40-
toolbox/idea-board/index.js | 191 ++++++++++++++++++++-
41-
9 files changed, 368 insertions(+), 45 deletions(-)
42-
```
43-
44-
## Requirement Evidence
45-
- PASS: Removed creator-visible Create Project from the right-side Next Steps area; no disabled `data-idea-board-create-project` panel remains.
46-
- PASS: Create Project is shown only in a Ready idea row's Actions column.
47-
- PASS: Clicking Create Project changes the idea status from Ready to Project and replaces Create Project/Delete with Open Project and Archive.
48-
- PASS: Project rows show Open Project and Archive and do not show Delete.
49-
- PASS: Added Archived status; archived rows are hidden by default.
50-
- PASS: Archived rows show Restore and Delete.
51-
- PASS: Restore returns archived ideas to their previous non-archived status, with Refining fallback in runtime.
52-
- PASS: Delete is guarded so Project ideas cannot be deleted unless archived first.
53-
- PASS: Status dropdown uses New, Exploring, Refining, Ready, Project, and Archived.
54-
- PASS: Added compact Show checkbox dropdown beside the visible table description line, with default statuses New, Exploring, Refining, Ready, and Project selected and Archived unselected.
55-
- PASS: Show dropdown supports any checkbox combination plus Select All and Clear All.
56-
- PASS: Updated creator-facing copy to "Capture, compare, and shape game ideas." and "Scan, compare, and update early ideas."
57-
- PASS: Replaced creator-visible Tool Display Mode navigation error with safe copy that does not mention server/API/local server/port/implementation details.
58-
- PASS: Chevron renders to the left of the Idea text, inline, same size, same color, and on the same text line; the whole Idea cell remains the expansion target.
59-
- PASS: Notes count remains informational only.
60-
- PASS: Table-first structure, inline Add Idea/Add Note, row-level Save/Cancel, status dropdown edit mode, notes indentation, and single-open accordion behavior remain covered.
28+
## Changed Files
29+
- src/engine/audio/TextToSpeechEngine.js
30+
- toolbox/text-to-speech/index.html
31+
- toolbox/text-to-speech/text2speech.js
32+
- tests/playwright/tools/TextToSpeechFunctional.spec.mjs
33+
- docs_build/dev/reports/coverage_changed_js_guardrail.txt
34+
- docs_build/dev/reports/playwright_v8_coverage_report.txt
35+
- docs_build/dev/reports/PR_26171_061-text2speech-engine-audio-feature-parity.md
36+
- docs_build/dev/reports/PR_26171_061-instruction-compliance-checklist.md
37+
- docs_build/dev/reports/PR_26171_061-old-tts-feature-parity-checklist.md
38+
- docs_build/dev/reports/PR_26171_061-engine-audio-ownership-checklist.md
39+
- docs_build/dev/reports/PR_26171_061-validation.md
40+
- docs_build/dev/reports/PR_26171_061-manual-validation-notes.md
41+
- docs_build/dev/reports/codex_review.diff
42+
- docs_build/dev/reports/codex_changed_files.txt
6143

6244
## Validation
63-
- PASS: `node --check toolbox/idea-board/index.js`.
64-
- PASS: `node --check assets/theme-v2/js/tool-display-mode.js`.
65-
- PASS: `node --check src/shared/toolbox/tool-metadata-inventory.js`.
66-
- PASS: `node --check tests/playwright/tools/IdeaBoardTableNotes.spec.mjs`.
67-
- PASS: `node --check tests/playwright/tools/ToolboxRoutePages.spec.mjs`.
68-
- PASS: `npx playwright test tests/playwright/tools/IdeaBoardTableNotes.spec.mjs --project=playwright --workers=1 --reporter=line --timeout=90000`.
69-
- PASS: `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --project=playwright --workers=1 --reporter=line -g "Idea Board launches" --timeout=90000`.
70-
- PASS: `npm run test:workspace-v2` (workspace-contract lane, 5 passed).
45+
- PASS: `node --check src\engine\audio\TextToSpeechEngine.js`.
46+
- PASS: `node --check toolbox\text-to-speech\text2speech.js`.
47+
- PASS: `node --test tests\tools\Text2SpeechShell.test.mjs`.
48+
- PASS: `npx playwright test tests/playwright/tools/TextToSpeechFunctional.spec.mjs`.
49+
- PASS: `npm run test:workspace-v2` (legacy command name; user-facing language is Project Workspace).
7150
- PASS: `git diff --check`.
72-
- PASS: Post-conflict rerun completed after merging `origin/main` at `0a364f85516aea82e38eea2f498fde5980f9adf9`.
73-
- PASS: Playwright V8 coverage report produced because runtime JavaScript changed.
74-
- WARN: Coverage report marks `src/shared/toolbox/tool-metadata-inventory.js` as not collected by browser V8 coverage; advisory only per project instructions.
75-
- SKIPPED: Full samples smoke was not run per request.
51+
- PASS: Post-conflict validation rerun after merging `origin/main` into the PR branch.
7652

7753
## ZIP
78-
- Path: `tmp/PR_26171_041-idea-board-production-polish_delta.zip`.
79-
- Size: final size reported in the delivery summary after conflict-resolution ZIP refresh.
80-
- Contents:
81-
- assets/theme-v2/css/tables.css
82-
- assets/theme-v2/js/tool-display-mode.js
83-
- docs_build/dev/reports/codex_changed_files.txt
84-
- docs_build/dev/reports/codex_review.diff
85-
- docs_build/dev/reports/coverage_changed_js_guardrail.txt
86-
- docs_build/dev/reports/playwright_v8_coverage_report.txt
87-
- src/shared/toolbox/tool-metadata-inventory.js
88-
- tests/playwright/tools/IdeaBoardTableNotes.spec.mjs
89-
- tests/playwright/tools/ToolboxRoutePages.spec.mjs
90-
- toolbox/idea-board/index.html
91-
- toolbox/idea-board/index.js
54+
- Path: `tmp/PR_26171_061-text2speech-engine-audio-feature-parity_delta.zip`.

0 commit comments

Comments
 (0)