Skip to content

Commit 0b9e2b2

Browse files
author
DavidQ
committed
Remove Text to Speech V2 queue mode and fix direct launch layout - PR_26130_026-text-to-speech-v2-queue-removal-and-layout-fix
1 parent a32dbf0 commit 0b9e2b2

20 files changed

Lines changed: 175 additions & 360 deletions
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# PR_26130_026-text-to-speech-v2-queue-removal-and-layout-fix
2+
3+
## Summary
4+
5+
Updated Text to Speech V2 and direct Workspace Manager V2/tool references for Queue Mode removal, canonical `text2speech-V2` launch paths, textarea sizing, status Clear behavior, and Speech Options internal scrolling.
6+
7+
## Changes
8+
9+
- Removed `queueMode` from Text to Speech V2 schema, defaults, sample JSON, UI controls, control hydration, engine runtime metadata, import/copy/export payloads, and positive Playwright expectations.
10+
- Kept `queueMode` only in negative Playwright coverage to prove payloads containing the field fail schema validation.
11+
- Removed the misspelled `text2speach-V2` redirect page, redirect script, alias schema file, alias sample JSON, tool registry alias, and Workspace Manager migration code.
12+
- Updated Text to Speech V2 to use direct canonical `text2speech-V2` references for registry, workspace launch, sample launch, schema validation, and tests.
13+
- Changed browser speech playback so Speak enqueues through `speechSynthesis.speak()` without a Queue Mode field or mode log; Stop remains the explicit queue clear action.
14+
- Made `textarea#text2speech-V2SpeechText` fill `div#text2speech-V2TextContent.accordion-v2__content`, resize with accordion height, and keep manual resize disabled.
15+
- Added internal vertical scrolling for Speech Options and preserved internal scrolling for Summary/Named Sentences.
16+
- Stopped Clear button click propagation so Clear no longer toggles the Status accordion.
17+
18+
## Schema And Migration Notes
19+
20+
- `tools/schemas/tools/text2speech-V2.schema.json` remains a root array schema with `minItems: 1`.
21+
- Each named speech item now requires: `id`, `name`, `text`, `gender`, `language`, `voice`, `voiceAge`, `volume`, `rate`, `pitch`, `characterPreset`, and `ssmlLikePreset`.
22+
- `queueMode` is no longer allowed by `additionalProperties: false`.
23+
- No `queueMode` import migration path is included in this PR. Existing payloads containing `queueMode` are rejected before render/import/save with an actionable schema validation message.
24+
- The deleted `text2speach-V2` route/schema/sample are no longer redirect aliases. Legacy URL checks return 404 in Playwright, while canonical `text2speech-V2` launch paths continue to work.
25+
26+
## Validation
27+
28+
- `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs` passed.
29+
- `node --check tests/runtime/SampleStandaloneToolDataFlow.test.mjs` passed.
30+
- `node --check` passed for changed Text to Speech V2/runtime JS files.
31+
- `git diff --check` passed.
32+
- `npm run test:workspace-v2` passed: 35 tests.
33+
- Playwright V8 coverage report was produced at `docs/dev/reports/playwright_v8_coverage_report.txt`.
34+
- Coverage guardrail was produced at `docs/dev/reports/coverage_changed_js_guardrail.txt` with no changed-runtime-JS warnings.
35+
36+
## Playwright Coverage
37+
38+
- Queue Mode is absent from UI/schema/sample/exported JSON.
39+
- Payloads containing `queueMode` fail schema validation.
40+
- Text to Speech V2 direct launch works from tools index, workspace launch, and sample 1903 wiring.
41+
- Legacy `text2speach-V2` path/schema/sample references no longer redirect or load.
42+
- Text to Speak textarea fills its accordion content and has resize disabled.
43+
- Clear does not toggle the Status accordion.
44+
- Speech Options scrolls internally.
45+
- Workspace Manager V2 keeps Text to Speech V2 available after repo and game selection.
46+
47+
## Full Samples Smoke Test
48+
49+
Skipped. This PR is limited to Text to Speech V2 direct behavior and Workspace Manager V2 launch references, and `npm run test:workspace-v2` covers the requested behavior. The full samples smoke test remains out of scope because it is broad and long-running.
50+
51+
## Manual Validation
52+
53+
1. Open `/tools/text2speech-V2/index.html?samplePresetPath=/samples/phase-19/1903/sample.1903.text2speech-V2.json`.
54+
2. Confirm Queue Mode is not visible and Output Summary contains only the named speech item array.
55+
3. Confirm Import JSON rejects an item containing `queueMode`.
56+
4. Confirm the Text to Speak textarea expands with the accordion and has no manual resize handle.
57+
5. Confirm clicking Clear empties Status without collapsing the Status accordion.
58+
6. Confirm `/tools/text2speach-V2/index.html` no longer redirects to the canonical tool.

samples/phase-19/1903/sample.1903.text2speach-V2.json

Lines changed: 0 additions & 47 deletions
This file was deleted.

samples/phase-19/1903/sample.1903.text2speech-V2.json

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"volume": 1,
1111
"rate": 1,
1212
"pitch": 1,
13-
"queueMode": "replace",
1413
"characterPreset": "narrator",
1514
"ssmlLikePreset": "normal"
1615
},
@@ -25,23 +24,35 @@
2524
"volume": 1,
2625
"rate": 1.2,
2726
"pitch": 1.4,
28-
"queueMode": "append",
2927
"characterPreset": "dramatic",
3028
"ssmlLikePreset": "normal"
3129
},
3230
{
3331
"id": "alert-warning",
3432
"name": "Alert warning",
3533
"text": "Warning. Incoming hazard detected. Please confirm the next action.",
36-
"gender": "female-preferred",
37-
"language": "en-US",
38-
"voice": "mock-microsoft-zira",
39-
"voiceAge": "adult",
40-
"volume": 0.9,
41-
"rate": 1.3,
34+
"characterPreset": "alert",
35+
"gender": "any",
36+
"language": "ja-JP",
4237
"pitch": 0.9,
43-
"queueMode": "replace",
38+
"rate": 1.3,
39+
"ssmlLikePreset": "normal",
40+
"voice": "Google 日本語",
41+
"voiceAge": "adult",
42+
"volume": 0.9
43+
},
44+
{
45+
"id": "alert-warning-2",
46+
"name": "Alert warning 2",
47+
"text": "Warning. Incoming hazard detected. Please confirm the next action.",
4448
"characterPreset": "alert",
45-
"ssmlLikePreset": "normal"
49+
"gender": "any",
50+
"language": "zh-CN",
51+
"pitch": 0.9,
52+
"rate": 1.3,
53+
"ssmlLikePreset": "normal",
54+
"voice": "Google 普通话(中国大陆)",
55+
"voiceAge": "adult",
56+
"volume": 0.9
4657
}
47-
]
58+
]

src/engine/audio/TextToSpeechDefaults.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ const TEXT_TO_SPEECH_VOICE_AGE_PRESET_DEFAULTS = Object.freeze({
3333
teen: Object.freeze({ pitchOffset: 0.2, rateMultiplier: 1.08 })
3434
});
3535

36-
const TEXT_TO_SPEECH_QUEUE_MODE_OPTIONS = Object.freeze([
37-
Object.freeze({ label: "Append to queue", value: "append" }),
38-
Object.freeze({ label: "Replace current speech", value: "replace" })
39-
]);
40-
4136
const TEXT_TO_SPEECH_CHARACTER_PRESET_OPTIONS = Object.freeze([
4237
Object.freeze({ label: "Manual", value: "manual" }),
4338
Object.freeze({ label: "Alert", value: "alert" }),
@@ -87,7 +82,6 @@ const TEXT_TO_SPEECH_QUEUE_ITEM_REQUIRED_FIELDS = Object.freeze([
8782
"volume",
8883
"rate",
8984
"pitch",
90-
"queueMode",
9185
"characterPreset",
9286
"ssmlLikePreset"
9387
]);
@@ -97,7 +91,6 @@ const TEXT_TO_SPEECH_DEFAULT_OPTIONS = Object.freeze({
9791
gender: "any",
9892
language: "en-US",
9993
pitch: TEXT_TO_SPEECH_CHARACTER_PRESET_DEFAULTS.manual.pitch,
100-
queueMode: "replace",
10194
rate: TEXT_TO_SPEECH_CHARACTER_PRESET_DEFAULTS.manual.rate,
10295
ssmlLikePreset: TEXT_TO_SPEECH_CHARACTER_PRESET_DEFAULTS.manual.ssmlLikePreset,
10396
voice: "",
@@ -119,7 +112,6 @@ export {
119112
TEXT_TO_SPEECH_GENDER_FILTER_OPTIONS,
120113
TEXT_TO_SPEECH_LANGUAGE_OPTIONS,
121114
TEXT_TO_SPEECH_QUEUE_ITEM_REQUIRED_FIELDS,
122-
TEXT_TO_SPEECH_QUEUE_MODE_OPTIONS,
123115
TEXT_TO_SPEECH_RANGE_DEFAULTS,
124116
TEXT_TO_SPEECH_SCHEMA_ID,
125117
TEXT_TO_SPEECH_SSML_LIKE_PRESET_DEFAULTS,

src/engine/audio/TextToSpeechEngine.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ class TextToSpeechEngine {
151151
gender = TEXT_TO_SPEECH_DEFAULTS.gender,
152152
language = TEXT_TO_SPEECH_DEFAULTS.language,
153153
pitch = TEXT_TO_SPEECH_DEFAULTS.pitch,
154-
queueMode = TEXT_TO_SPEECH_DEFAULTS.queueMode,
155154
rate = TEXT_TO_SPEECH_DEFAULTS.rate,
156155
speechItemId = "",
157156
speechItemName = "",
@@ -166,15 +165,6 @@ class TextToSpeechEngine {
166165
return firstUtterance;
167166
}
168167

169-
if (queueMode !== "append" && queueMode !== "replace") {
170-
return { message: `Unsupported ${TEXT_TO_SPEECH_DISPLAY_NAME} queueMode: ${queueMode}.`, ok: false };
171-
}
172-
173-
if (queueMode === "replace") {
174-
this.speechSynthesis.cancel();
175-
this.queuedSpeechItems.clear();
176-
}
177-
178168
this.queueSequence += 1;
179169
const selectedSpeechItemId = String(speechItemId || speechItemName || `speech-item-${Date.now().toString(36)}`);
180170
const queuedSpeechItemId = `${selectedSpeechItemId || "speech-item"}::${this.queueSequence}`;
@@ -184,7 +174,6 @@ class TextToSpeechEngine {
184174
language: firstUtterance.utterance.lang,
185175
name: queuedSpeechItemName,
186176
pitch: firstUtterance.utterance.pitch,
187-
queueMode,
188177
rate: firstUtterance.utterance.rate,
189178
speechItemId: selectedSpeechItemId,
190179
status: "queued",
@@ -214,7 +203,6 @@ class TextToSpeechEngine {
214203
ok: true,
215204
pitch: firstUtterance.utterance.pitch,
216205
queuedSpeechItems: this.queuedSpeechItemList(),
217-
queueMode,
218206
rate: firstUtterance.utterance.rate,
219207
speechItemId: selectedSpeechItemId,
220208
speechItemName: queuedSpeechItemName,

0 commit comments

Comments
 (0)