|
| 1 | +# PR_26130_012-text2speach-v2-pitch-age-labels |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +Add the requested `text2speach-V2` Pitch helper scale and lock Voice Age simulation behavior to visible Rate/Pitch slider updates without claiming true gender conversion. |
| 6 | + |
| 7 | +## Scope |
| 8 | + |
| 9 | +Changed only the `text2speach-V2` UI, existing speech defaults/schema hooks, targeted Workspace Manager V2 Playwright coverage, and required reports. |
| 10 | + |
| 11 | +No `start_of_day` files were changed. |
| 12 | + |
| 13 | +## Implementation Summary |
| 14 | + |
| 15 | +- Added a centered helper scale directly under the Pitch slider: |
| 16 | + |
| 17 | +```text |
| 18 | +Male < Neutral > Female |
| 19 | +``` |
| 20 | + |
| 21 | +- Kept the helper visual-only. It labels the pitch direction and does not claim true gender conversion. |
| 22 | +- Renamed Voice Age option/value `elder` to `elderly` across defaults, schema, labels, and Playwright expectations. |
| 23 | +- Kept Voice Age simulation behavior in the existing preset-derived slider path: |
| 24 | + - `child`: higher pitch, slightly faster rate |
| 25 | + - `teen`: slightly higher pitch, normal/slightly faster rate |
| 26 | + - `adult`: neutral pitch and rate |
| 27 | + - `elderly`: lower pitch, slower rate |
| 28 | +- Preserved manual Rate and Pitch slider authority: once the user edits those sliders, later Voice Age changes do not overwrite those manual values. |
| 29 | + |
| 30 | +## Playwright Impact |
| 31 | + |
| 32 | +Playwright impacted: Yes. |
| 33 | + |
| 34 | +Coverage added/updated for: |
| 35 | + |
| 36 | +- Pitch helper scale text `Male < Neutral > Female` |
| 37 | +- helper scale placement immediately below the Pitch slider |
| 38 | +- helper scale centered alignment |
| 39 | +- Voice Age enum/options using `elderly` |
| 40 | +- Child, Teen, Adult, Elderly, and Any Voice Age slider updates |
| 41 | +- existing manual Rate/Pitch override behavior after Voice Age changes |
| 42 | + |
| 43 | +Expected pass behavior: the Pitch helper appears centered under the Pitch slider, Voice Age selections visibly update Rate/Pitch when sliders are not manually overridden, and manual Rate/Pitch edits remain authoritative. |
| 44 | + |
| 45 | +Expected fail behavior: tests fail if the helper text is missing/misplaced/not centered, if `elderly` is not present in the schema/UI options, if Voice Age no longer updates sliders, or if manual Rate/Pitch edits are overwritten. |
| 46 | + |
| 47 | +## Validation |
| 48 | + |
| 49 | +Passed: |
| 50 | + |
| 51 | +```text |
| 52 | +npm run test:workspace-v2 |
| 53 | +``` |
| 54 | + |
| 55 | +Result: |
| 56 | + |
| 57 | +```text |
| 58 | +28 passed |
| 59 | +``` |
| 60 | + |
| 61 | +Additional checks passed: |
| 62 | + |
| 63 | +```text |
| 64 | +node --check src/engine/audio/TextToSpeechDefaults.js |
| 65 | +node --check tools/text2speach-V2/js/controls/SpeechOptionsControl.js |
| 66 | +node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs |
| 67 | +node -e "JSON.parse(require('fs').readFileSync('tools/schemas/tools/text2speach-V2.schema.json','utf8')); console.log('schema json ok')" |
| 68 | +rg -n -P "<script(?![^>]*\bsrc=)|<style|\son[a-zA-Z]+=" tools/text2speach-V2/index.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 | +The workspace-v2 Playwright run also regenerated advisory V8 coverage reports: |
| 75 | + |
| 76 | +- `docs/dev/reports/playwright_v8_coverage_report.txt` |
| 77 | +- `docs/dev/reports/coverage_changed_js_guardrail.txt` |
| 78 | + |
| 79 | +Changed runtime JavaScript coverage from the guardrail: |
| 80 | + |
| 81 | +- `(98%) tools/text2speach-V2/js/controls/SpeechOptionsControl.js - executed lines 478/478; executed functions 46/47` |
| 82 | +- `(100%) src/engine/audio/TextToSpeechDefaults.js - executed lines 162/162; executed functions 1/1` |
| 83 | + |
| 84 | +## Full Samples Smoke Test |
| 85 | + |
| 86 | +Skipped. The full samples smoke test is intentionally out of scope because this PR is limited to `text2speach-V2` Pitch helper labeling, Voice Age simulation labels/defaults, schema enum alignment, and targeted Workspace Manager V2 Playwright coverage. |
| 87 | + |
| 88 | +## ZIP Artifact |
| 89 | + |
| 90 | +Repo-structured delta ZIP: |
| 91 | + |
| 92 | +```text |
| 93 | +tmp/PR_26130_012-text2speach-v2-pitch-age-labels_delta.zip |
| 94 | +``` |
| 95 | + |
| 96 | +## Manual Validation Steps |
| 97 | + |
| 98 | +1. Open `tools/text2speach-V2/index.html`. |
| 99 | +2. Confirm the Pitch slider shows the centered helper scale `Male < Neutral > Female` directly below the slider. |
| 100 | +3. Select Voice Age `Child`, `Teen`, `Adult`, and `Elderly`; Rate and Pitch should update visibly when those sliders have not been manually edited. |
| 101 | +4. Manually change Rate and Pitch, then select another Voice Age; the manual Rate and Pitch values should remain. |
| 102 | +5. Confirm the UI does not describe the Pitch helper as true gender conversion. |
| 103 | + |
| 104 | +Expected outcome: Pitch direction is visually explained, Voice Age simulation affects default Rate/Pitch only while allowed, and manual slider edits win. |
| 105 | + |
| 106 | +## Changed Files |
| 107 | + |
| 108 | +- `src/engine/audio/TextToSpeechDefaults.js` |
| 109 | +- `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` |
| 110 | +- `tools/schemas/tools/text2speach-V2.schema.json` |
| 111 | +- `tools/text2speach-V2/index.html` |
| 112 | +- `tools/text2speach-V2/js/controls/SpeechOptionsControl.js` |
| 113 | +- `tools/text2speach-V2/styles/text2speach-V2.css` |
| 114 | +- `docs/dev/reports/PR_26130_012-text2speach-v2-pitch-age-labels.md` |
| 115 | +- `docs/dev/reports/playwright_v8_coverage_report.txt` |
| 116 | +- `docs/dev/reports/coverage_changed_js_guardrail.txt` |
0 commit comments