Skip to content

Commit 4b37d27

Browse files
author
DavidQ
committed
Fix Text to Speech V2 fullscreen scrolling and workspace tile enablement - PR_26130_024-text-to-speech-v2-fullscreen-scroll-and-workspace-tile
1 parent 5021008 commit 4b37d27

7 files changed

Lines changed: 145 additions & 86 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PR_26130_024-text-to-speech-v2-fullscreen-scroll-and-workspace-tile
2+
3+
## Scope
4+
5+
- Updated Text to Speech V2 runtime gender filtering, fullscreen/internal scroll layout, and workspace empty-launch handling.
6+
- Updated Workspace Manager V2 tile hydration so Text to Speech V2 is enabled once Repo and Game are selected, without requiring a Text to Speech-specific payload.
7+
- Updated Workspace Manager V2 Playwright coverage for the requested Text to Speech V2 filters, layout scroll behavior, and tile availability.
8+
9+
## Changes
10+
11+
- Gender filtering now presents `Any`, `Male`, `Female`, and `Neutral`.
12+
- `Any` keeps all voices available.
13+
- `Male` filters to male-classified voices only.
14+
- `Female` filters to female-classified voices only.
15+
- `Neutral` filters to neutral/unknown voices only.
16+
- Neutral is treated as a runtime filter; persisted payload gender remains schema-compatible because this PR intentionally made no schema changes.
17+
- Text to Speech V2 workspace launches with no payload now render a safe empty state instead of failing before the tile can open.
18+
- Fullscreen right/center panels constrain Output Summary, Status, and Named Sentences content with internal scrolling.
19+
- Text to Speak accordion toggle coverage was added, and Speak/Pause/Resume/Stop controls are centered with bottom padding.
20+
21+
## Validation
22+
23+
- `npm run test:workspace-v2` passed: 33 tests passed.
24+
- `git diff --check` passed with line-ending normalization warnings only.
25+
- Full samples smoke test skipped because the BUILD explicitly requested not to run it; scope is limited to Workspace Manager V2 and Text to Speech V2.
26+
27+
## Reports
28+
29+
- Review diff: `docs/dev/reports/codex_review.diff`
30+
- Changed files: `docs/dev/reports/codex_changed_files.txt`
31+
- Delta ZIP: `tmp/PR_26130_024-text-to-speech-v2-fullscreen-scroll-and-workspace-tile_delta.zip`

src/engine/audio/TextToSpeechDefaults.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ const TEXT_TO_SPEECH_LANGUAGE_OPTIONS = Object.freeze([
1212

1313
const TEXT_TO_SPEECH_GENDER_FILTER_OPTIONS = Object.freeze([
1414
Object.freeze({ label: "Any", value: "any" }),
15-
Object.freeze({ label: "Male Preferred", value: "male-preferred" }),
16-
Object.freeze({ label: "Female Preferred", value: "female-preferred" })
15+
Object.freeze({ label: "Male", value: "male-preferred" }),
16+
Object.freeze({ label: "Female", value: "female-preferred" }),
17+
Object.freeze({ label: "Neutral", value: "neutral" })
1718
]);
1819

1920
const TEXT_TO_SPEECH_AGE_FILTER_OPTIONS = Object.freeze([

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 79 additions & 74 deletions
Large diffs are not rendered by default.

tools/text2speach-V2/js/TextToSpeechToolApp.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,12 @@ export class TextToSpeechToolApp {
381381
if (!isPlainObject(toolState)) {
382382
return { ok: false, message: `${WORKSPACE_TOOL_STATE_KEY} must contain the normalized workspace toolState object before render.` };
383383
}
384-
if (!Object.prototype.hasOwnProperty.call(toolState, "data")) {
385-
return { ok: false, message: `${WORKSPACE_TOOL_STATE_KEY}.data must contain the ${TEXT_TO_SPEECH_DISPLAY_NAME} payload before render.` };
384+
if (!Object.prototype.hasOwnProperty.call(toolState, "data") || toolState.data === null) {
385+
return {
386+
empty: true,
387+
ok: true,
388+
message: `${TEXT_TO_SPEECH_DISPLAY_NAME} empty workspace launch: no workspace payload is loaded from ${WORKSPACE_TOOL_STATE_KEY}. Use Import JSON in standalone mode or add Text to Speech V2 named speech items before saving.`
389+
};
386390
}
387391
return {
388392
dirtyState: `isDirty=${toolState.dirty?.isDirty === true}; reason=${toolState.dirty?.reason || "clean"}`,

tools/text2speach-V2/js/controls/SpeechOptionsControl.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,13 @@ function voiceGender(option) {
7070

7171
function genderFilterLabel(value) {
7272
if (value === "male-preferred") {
73-
return "Male Preferred";
73+
return "Male";
7474
}
7575
if (value === "female-preferred") {
76-
return "Female Preferred";
76+
return "Female";
77+
}
78+
if (value === "neutral") {
79+
return "Neutral";
7780
}
7881
return "Any";
7982
}
@@ -83,14 +86,21 @@ function voicesForGender(voiceOptions, genderFilter) {
8386
return voiceOptions;
8487
}
8588
if (genderFilter === "male-preferred") {
86-
return voiceOptions.filter((option) => ["male", "neutral", "unknown"].includes(voiceGender(option)));
89+
return voiceOptions.filter((option) => voiceGender(option) === "male");
8790
}
8891
if (genderFilter === "female-preferred") {
89-
return voiceOptions.filter((option) => ["female", "neutral", "unknown"].includes(voiceGender(option)));
92+
return voiceOptions.filter((option) => voiceGender(option) === "female");
93+
}
94+
if (genderFilter === "neutral") {
95+
return voiceOptions.filter((option) => ["neutral", "unknown"].includes(voiceGender(option)));
9096
}
9197
return voiceOptions;
9298
}
9399

100+
function payloadGenderValue(value) {
101+
return value === "neutral" ? "any" : value;
102+
}
103+
94104
function voiceDetailsText({ filterLabel, filteredVoiceCount, matchingVoiceOptions, voiceCount }) {
95105
if (voiceCount === 0) {
96106
return "No SpeechSynthesis voices loaded.";
@@ -462,7 +472,7 @@ export class SpeechOptionsControl {
462472
value() {
463473
return {
464474
characterPreset: this.characterPresetSelect.value,
465-
gender: this.genderFilterSelect.value,
475+
gender: payloadGenderValue(this.genderFilterSelect.value),
466476
language: this.languageSelect.value,
467477
pitch: numberValue(this.pitchSlider),
468478
queueMode: this.queueModeSelect.value,

tools/text2speach-V2/styles/text2speach-V2.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@
151151
}
152152

153153
#text2speach-V2TextContent .text2speach-V2__speech-actions {
154+
justify-content: center;
154155
margin: 0;
156+
padding-bottom: 12px;
155157
}
156158

157159
.text2speach-V2__accordion--fill {
@@ -245,6 +247,9 @@
245247
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
246248
gap: 10px;
247249
min-height: 0;
250+
}
251+
252+
#text2speach-V2QueueContent {
248253
overflow: auto;
249254
}
250255

@@ -289,6 +294,7 @@
289294
}
290295

291296
.text2speach-V2__summary {
297+
max-height: 260px;
292298
min-height: 210px;
293299
margin: 0;
294300
padding: 10px;
@@ -466,8 +472,8 @@ html:fullscreen body.tools-platform-surface[data-tool-id="text2speach-V2"] .text
466472

467473
body.tools-platform-surface.tools-platform-fullscreen-active[data-tool-id="text2speach-V2"] .text2speach-V2__summary-accordion,
468474
html:fullscreen body.tools-platform-surface[data-tool-id="text2speach-V2"] .text2speach-V2__summary-accordion {
469-
flex: 0 1 45%;
470-
max-height: 45%;
475+
flex: 0 1 34%;
476+
max-height: 34%;
471477
min-height: 0;
472478
}
473479

@@ -490,6 +496,7 @@ body.tools-platform-surface.tools-platform-fullscreen-active[data-tool-id="text2
490496
body.tools-platform-surface.tools-platform-fullscreen-active[data-tool-id="text2speach-V2"] #text2speach-V2StatusLog,
491497
html:fullscreen body.tools-platform-surface[data-tool-id="text2speach-V2"] .text2speach-V2__summary,
492498
html:fullscreen body.tools-platform-surface[data-tool-id="text2speach-V2"] #text2speach-V2StatusLog {
499+
max-height: none;
493500
height: 100%;
494501
min-height: 0;
495502
overflow: auto;

tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const TOOL_PAYLOAD_SCHEMA_REFS = Object.freeze({
1818
});
1919
const SELECTED_GAME_PURPOSE_TOOL_IDS = Object.freeze(new Set([
2020
"preview-generator-v2",
21-
"session-inspector-v2"
21+
"session-inspector-v2",
22+
TEXT2SPEACH_V2_TOOL_KEY
2223
]));
2324
const WORKSPACE_LAUNCHABLE_TOOLS = Object.freeze([
2425
Object.freeze({

0 commit comments

Comments
 (0)