Skip to content

[codex] PR_26171_067 tts profile emotion table foundation#21

Merged
ToolboxAid merged 1 commit into
mainfrom
pr/26171-067-tts-profile-emotion-table-foundation
Jun 20, 2026
Merged

[codex] PR_26171_067 tts profile emotion table foundation#21
ToolboxAid merged 1 commit into
mainfrom
pr/26171-067-tts-profile-emotion-table-foundation

Conversation

@ToolboxAid

Copy link
Copy Markdown
Owner

Summary

  • Add TTS Studio parent TTS Profiles table with child Emotion Settings rows.
  • Support inline add/edit flows and usage-aware disabled delete actions.
  • Expose a Message Studio compatible TTS profile contract while keeping tool ownership separate.

Validation

  • node --check toolbox\text-to-speech\text2speech.js
  • node --check tests\playwright\tools\TextToSpeechFunctional.spec.mjs
  • node --check tests\tools\Text2SpeechShell.test.mjs
  • HTML inline style/script/event scan for toolbox/text-to-speech/index.html
  • node --test tests/tools/Text2SpeechShell.test.mjs
  • npx playwright test tests/playwright/tools/TextToSpeechFunctional.spec.mjs --project=playwright --workers=1 --reporter=list
  • npx playwright test tests/playwright/tools/MessagesTool.spec.mjs --project=playwright --workers=1 --reporter=list
  • npm run test:workspace-v2

@ToolboxAid ToolboxAid merged commit 83fa8ad into main Jun 20, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbedbf392f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +838 to +840
if (state.profiles.some((candidate) => candidate.id !== profile.id && candidate.name.toLowerCase() === profile.name.toLowerCase())) {
errors.push("Profile Name must be unique.");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent duplicate profile ids

When adding a profile whose display name normalizes to an existing slug but is not an exact case-insensitive name match (for example Man/Profile 1 alongside Man Profile 1), createTextToSpeechProfile gives both rows the same id while this validation still passes. Because edit/select/delete are keyed by profile.id, those duplicate rows become ambiguous and delete will remove every matching id, so the UI can corrupt more than the intended profile.

Useful? React with 👍 / 👎.

Comment on lines +1203 to +1207
function ensureDefaultProfiles() {
if (state.profiles.length) {
return;
}
state.profiles = createDefaultTextToSpeechProfiles(state.voiceOptions);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Rebind default profiles after voices load

In browsers where speechSynthesis.getVoices() is initially empty and voices arrive via voiceschanged, this early return leaves the default profiles permanently seeded with blank voice values and Default browser voice names. The callback later only re-renders rows, so the Message Studio profile options never pick up the available browser voices even though createDefaultTextToSpeechProfiles(state.voiceOptions) is designed to bind them.

Useful? React with 👍 / 👎.

return createTextToSpeechProfileEmotion({
active: editorChecked(row, "[data-tts-emotion-active]"),
emotion: editorValue(row, "[data-tts-emotion-name]"),
id: key === NEW_ROW_KEY ? "" : key,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate emotion ids when the emotion changes

When editing an existing emotion row to a different emotion, this preserves the old row id while changing emotion.emotion. After that, adding a new setting for the original emotion is accepted by the uniqueness check, leaving two rows with the same id; because edit/delete actions are keyed by that id, a later delete can remove more than the intended emotion setting.

Useful? React with 👍 / 👎.

Comment on lines +281 to +285
.filter((profile) => profile?.active !== false)
.map((profile) => ({
active: true,
emotionSettings: Array.isArray(profile.emotions)
? profile.emotions.filter((emotion) => emotion.active !== false).map((emotion) => ({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep in-use profiles and emotions visible to Message Studio

When a row with messageStudioUsageCount or messagePartsUsageCount is edited and its Active checkbox is cleared, deletion is still blocked but this export removes the referenced profile or emotion from messageStudioOptions. For example, deactivating the default balanced profile or its neutral emotion makes existing Message Studio/Message Parts references lose their option without actually deleting the row.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants