Skip to content

Commit 424b484

Browse files
calebedenCopilot
andcommitted
Preserve chat TTS fallback readiness
Keep chat TTS readiness gated on the Permissions capability only so existing Windows speech fallback can handle missing configured provider setup. Update Permissions warning copy to describe provider setup without implying all read aloud is blocked. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 657586c commit 424b484

9 files changed

Lines changed: 24 additions & 79 deletions

File tree

src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -942,22 +942,11 @@ private static bool IsTtsReadyForChat()
942942

943943
private async Task ShowTtsUnavailableDialogAsync()
944944
{
945-
var settings = CurrentApp.Settings;
946-
if (settings?.NodeTtsEnabled != true)
947-
{
948-
await ShowVoiceSettingsDialogAsync(
949-
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffTitle"),
950-
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffMessage"),
951-
LocalizationHelper.GetString("ChatVoiceDialog_OpenPermissionsSettings"),
952-
NavigateToPermissionsSettings);
953-
return;
954-
}
955-
956945
await ShowVoiceSettingsDialogAsync(
957-
LocalizationHelper.GetString("ChatVoiceDialog_TtsSetupRequiredTitle"),
958-
LocalizationHelper.GetString("ChatVoiceDialog_TtsSetupRequiredMessage"),
959-
LocalizationHelper.GetString("ChatVoiceDialog_OpenVoiceSettings"),
960-
NavigateToVoiceSettings);
946+
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffTitle"),
947+
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffMessage"),
948+
LocalizationHelper.GetString("ChatVoiceDialog_OpenPermissionsSettings"),
949+
NavigateToPermissionsSettings);
961950
}
962951

963952
private static bool ShouldStartSpeakerMuted(SettingsManager? settings)

src/OpenClaw.Tray.WinUI/Services/SpeechSetupReadiness.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ public static class SpeechSetupReadiness
77
{
88
public static bool IsChatTtsPlaybackReady(SettingsManager? settings)
99
{
10-
return settings?.NodeTtsEnabled == true &&
11-
!IsConfiguredTtsProviderSetupRequired(settings);
10+
return settings?.NodeTtsEnabled == true;
1211
}
1312

1413
public static bool IsAutomaticChatTtsEnabled(SettingsManager? settings)

src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,10 +2466,10 @@ Use one of these options:
24662466
<value>Download a speech model before speech-to-text can work.</value>
24672467
</data>
24682468
<data name="PermissionsPage_VoiceSettingsHelp_VoiceSetup" xml:space="preserve">
2469-
<value>Select or download a voice before text-to-speech can work.</value>
2469+
<value>Your selected TTS provider still needs voice setup; chat read aloud can fall back to Windows speech.</value>
24702470
</data>
24712471
<data name="PermissionsPage_VoiceSettingsHelp_Both" xml:space="preserve">
2472-
<value>Download a speech model and select or download a voice before speech-to-text and text-to-speech can work.</value>
2472+
<value>Download a speech model for voice input. Your selected TTS provider also needs voice setup, though chat read aloud can fall back to Windows speech.</value>
24732473
</data>
24742474
<data name="VoiceSettingsPage_PageTitle.Text" xml:space="preserve">
24752475
<value>Voice &amp; Audio</value>
@@ -2735,12 +2735,6 @@ Use one of these options:
27352735
<data name="ChatVoiceDialog_OutputOffMessage" xml:space="preserve">
27362736
<value>Text-to-speech is disabled. Enable the capability in Permissions before using read aloud in chat.</value>
27372737
</data>
2738-
<data name="ChatVoiceDialog_TtsSetupRequiredTitle" xml:space="preserve">
2739-
<value>Voice Setup Required</value>
2740-
</data>
2741-
<data name="ChatVoiceDialog_TtsSetupRequiredMessage" xml:space="preserve">
2742-
<value>Text-to-speech is on, but read aloud will not work until a voice or provider is configured.</value>
2743-
</data>
27442738
<data name="ChatVoiceDialog_OpenVoiceSettings" xml:space="preserve">
27452739
<value>Open Voice &amp; Audio Settings</value>
27462740
</data>

src/OpenClaw.Tray.WinUI/Strings/fr-fr/Resources.resw

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,10 +2419,10 @@ Utilisez l'une de ces options :
24192419
<value>Téléchargez un modèle de reconnaissance vocale avant que la reconnaissance vocale puisse fonctionner.</value>
24202420
</data>
24212421
<data name="PermissionsPage_VoiceSettingsHelp_VoiceSetup" xml:space="preserve">
2422-
<value>Sélectionnez ou téléchargez une voix avant que la synthèse vocale puisse fonctionner.</value>
2422+
<value>Le fournisseur TTS sélectionné nécessite encore une configuration vocale ; la lecture à voix haute du chat peut utiliser la synthèse vocale Windows en secours.</value>
24232423
</data>
24242424
<data name="PermissionsPage_VoiceSettingsHelp_Both" xml:space="preserve">
2425-
<value>Téléchargez un modèle de reconnaissance vocale et sélectionnez ou téléchargez une voix avant que la reconnaissance vocale et la synthèse vocale puissent fonctionner.</value>
2425+
<value>Téléchargez un modèle de reconnaissance vocale pour la saisie vocale. Le fournisseur TTS sélectionné nécessite aussi une configuration vocale, même si la lecture à voix haute du chat peut utiliser la synthèse vocale Windows en secours.</value>
24262426
</data>
24272427
<data name="VoiceSettingsPage_PageTitle.Text" xml:space="preserve">
24282428
<value>Voix et audio</value>
@@ -2688,12 +2688,6 @@ Utilisez l'une de ces options :
26882688
<data name="ChatVoiceDialog_OutputOffMessage" xml:space="preserve">
26892689
<value>La synthèse vocale est désactivée. Activez la capacité dans Autorisations avant d'utiliser la lecture à voix haute dans le chat.</value>
26902690
</data>
2691-
<data name="ChatVoiceDialog_TtsSetupRequiredTitle" xml:space="preserve">
2692-
<value>Configuration vocale requise</value>
2693-
</data>
2694-
<data name="ChatVoiceDialog_TtsSetupRequiredMessage" xml:space="preserve">
2695-
<value>La synthèse vocale est activée, mais la lecture à voix haute ne fonctionnera pas tant qu'une voix ou un fournisseur n'aura pas été configuré.</value>
2696-
</data>
26972691
<data name="ChatVoiceDialog_OpenVoiceSettings" xml:space="preserve">
26982692
<value>Ouvrir les paramètres Voix et audio</value>
26992693
</data>

src/OpenClaw.Tray.WinUI/Strings/nl-nl/Resources.resw

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,10 +2420,10 @@ Gebruik een van deze opties:
24202420
<value>Download een spraakmodel voordat spraak-naar-tekst kan werken.</value>
24212421
</data>
24222422
<data name="PermissionsPage_VoiceSettingsHelp_VoiceSetup" xml:space="preserve">
2423-
<value>Selecteer of download een stem voordat tekst-naar-spraak kan werken.</value>
2423+
<value>De geselecteerde TTS-provider heeft nog spraakconfiguratie nodig; hardop voorlezen in chat kan terugvallen op Windows-spraak.</value>
24242424
</data>
24252425
<data name="PermissionsPage_VoiceSettingsHelp_Both" xml:space="preserve">
2426-
<value>Download een spraakmodel en selecteer of download een stem voordat spraak-naar-tekst en tekst-naar-spraak kunnen werken.</value>
2426+
<value>Download een spraakmodel voor spraakinvoer. De geselecteerde TTS-provider heeft ook spraakconfiguratie nodig, hoewel hardop voorlezen in chat kan terugvallen op Windows-spraak.</value>
24272427
</data>
24282428
<data name="VoiceSettingsPage_PageTitle.Text" xml:space="preserve">
24292429
<value>Spraak en audio</value>
@@ -2689,12 +2689,6 @@ Gebruik een van deze opties:
26892689
<data name="ChatVoiceDialog_OutputOffMessage" xml:space="preserve">
26902690
<value>Tekst-naar-spraak is uitgeschakeld. Schakel de mogelijkheid in Machtigingen in voordat u hardop voorlezen in chat gebruikt.</value>
26912691
</data>
2692-
<data name="ChatVoiceDialog_TtsSetupRequiredTitle" xml:space="preserve">
2693-
<value>Spraakconfiguratie vereist</value>
2694-
</data>
2695-
<data name="ChatVoiceDialog_TtsSetupRequiredMessage" xml:space="preserve">
2696-
<value>Tekst-naar-spraak is ingeschakeld, maar hardop voorlezen werkt pas nadat een stem of provider is geconfigureerd.</value>
2697-
</data>
26982692
<data name="ChatVoiceDialog_OpenVoiceSettings" xml:space="preserve">
26992693
<value>Spraak- en audio-instellingen openen</value>
27002694
</data>

src/OpenClaw.Tray.WinUI/Strings/zh-cn/Resources.resw

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,10 +2419,10 @@
24192419
<value>请先下载语音模型,语音转文本才能正常工作。</value>
24202420
</data>
24212421
<data name="PermissionsPage_VoiceSettingsHelp_VoiceSetup" xml:space="preserve">
2422-
<value>请先选择或下载语音,文本转语音才能正常工作。</value>
2422+
<value>所选 TTS 提供程序仍需要语音设置;聊天朗读可以回退到 Windows 语音。</value>
24232423
</data>
24242424
<data name="PermissionsPage_VoiceSettingsHelp_Both" xml:space="preserve">
2425-
<value>请先下载语音模型并选择或下载语音,语音转文本和文本转语音才能正常工作。</value>
2425+
<value>请为语音输入下载语音模型。所选 TTS 提供程序也需要语音设置,但聊天朗读可以回退到 Windows 语音。</value>
24262426
</data>
24272427
<data name="VoiceSettingsPage_PageTitle.Text" xml:space="preserve">
24282428
<value>语音和音频</value>
@@ -2688,12 +2688,6 @@
26882688
<data name="ChatVoiceDialog_OutputOffMessage" xml:space="preserve">
26892689
<value>文字转语音已禁用。请先在“权限”中启用该功能,然后再在聊天中使用朗读。</value>
26902690
</data>
2691-
<data name="ChatVoiceDialog_TtsSetupRequiredTitle" xml:space="preserve">
2692-
<value>需要语音设置</value>
2693-
</data>
2694-
<data name="ChatVoiceDialog_TtsSetupRequiredMessage" xml:space="preserve">
2695-
<value>文字转语音已开启,但需要先配置语音或提供程序后,朗读才会工作。</value>
2696-
</data>
26972691
<data name="ChatVoiceDialog_OpenVoiceSettings" xml:space="preserve">
26982692
<value>打开语音和音频设置</value>
26992693
</data>

src/OpenClaw.Tray.WinUI/Strings/zh-tw/Resources.resw

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,10 +2419,10 @@
24192419
<value>請先下載語音模型,語音轉文字才能正常運作。</value>
24202420
</data>
24212421
<data name="PermissionsPage_VoiceSettingsHelp_VoiceSetup" xml:space="preserve">
2422-
<value>請先選取或下載語音,文字轉語音才能正常運作。</value>
2422+
<value>所選 TTS 提供者仍需要語音設定;聊天朗讀可以回退到 Windows 語音。</value>
24232423
</data>
24242424
<data name="PermissionsPage_VoiceSettingsHelp_Both" xml:space="preserve">
2425-
<value>請先下載語音模型並選取或下載語音,語音轉文字和文字轉語音才能正常運作。</value>
2425+
<value>請為語音輸入下載語音模型。所選 TTS 提供者也需要語音設定,但聊天朗讀可以回退到 Windows 語音。</value>
24262426
</data>
24272427
<data name="VoiceSettingsPage_PageTitle.Text" xml:space="preserve">
24282428
<value>語音與音訊</value>
@@ -2688,12 +2688,6 @@
26882688
<data name="ChatVoiceDialog_OutputOffMessage" xml:space="preserve">
26892689
<value>文字轉語音已停用。請先在「權限」中啟用此功能,然後再在聊天中使用朗讀。</value>
26902690
</data>
2691-
<data name="ChatVoiceDialog_TtsSetupRequiredTitle" xml:space="preserve">
2692-
<value>需要語音設定</value>
2693-
</data>
2694-
<data name="ChatVoiceDialog_TtsSetupRequiredMessage" xml:space="preserve">
2695-
<value>文字轉語音已開啟,但需要先設定語音或提供者後,朗讀才會運作。</value>
2696-
</data>
26972691
<data name="ChatVoiceDialog_OpenVoiceSettings" xml:space="preserve">
26982692
<value>開啟語音和音訊設定</value>
26992693
</data>

src/OpenClaw.Tray.WinUI/Windows/ChatWindow.xaml.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -618,21 +618,11 @@ private static bool IsTtsReadyForChat(SettingsManager? settings)
618618

619619
private async Task ShowTtsUnavailableDialogAsync()
620620
{
621-
if (App.Current is not App app || app.Settings?.NodeTtsEnabled != true)
622-
{
623-
await ShowVoiceSettingsDialogAsync(
624-
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffTitle"),
625-
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffMessage"),
626-
LocalizationHelper.GetString("ChatVoiceDialog_OpenPermissionsSettings"),
627-
() => (App.Current as App)?.ShowHub("permissions"));
628-
return;
629-
}
630-
631621
await ShowVoiceSettingsDialogAsync(
632-
LocalizationHelper.GetString("ChatVoiceDialog_TtsSetupRequiredTitle"),
633-
LocalizationHelper.GetString("ChatVoiceDialog_TtsSetupRequiredMessage"),
634-
LocalizationHelper.GetString("ChatVoiceDialog_OpenVoiceSettings"),
635-
() => app.ShowHub("voice"));
622+
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffTitle"),
623+
LocalizationHelper.GetString("ChatVoiceDialog_OutputOffMessage"),
624+
LocalizationHelper.GetString("ChatVoiceDialog_OpenPermissionsSettings"),
625+
() => (App.Current as App)?.ShowHub("permissions"));
636626
}
637627

638628
private static bool ShouldStartSpeakerMuted(SettingsManager? settings)

tests/OpenClaw.Tray.Tests/SpeechInputContractTests.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void ChatVoiceDialogs_RouteDisabledSttCapabilityToPermissions_AndMissingM
5151
}
5252

5353
[Fact]
54-
public void ChatVoiceDialogs_RouteDisabledTtsCapabilityToPermissions_AndMissingSetupToVoiceSettings()
54+
public void ChatVoiceDialogs_RouteDisabledTtsCapabilityToPermissions_AndPreserveFallbackForMissingSetup()
5555
{
5656
var chatPage = Read("src", "OpenClaw.Tray.WinUI", "Pages", "ChatPage.xaml.cs");
5757
var chatWindow = Read("src", "OpenClaw.Tray.WinUI", "Windows", "ChatWindow.xaml.cs");
@@ -69,10 +69,8 @@ public void ChatVoiceDialogs_RouteDisabledTtsCapabilityToPermissions_AndMissingS
6969
Assert.Contains("_functionalHost?.SetSpeakerMuted(true);\r\n await ShowTtsUnavailableDialogAsync();", chatPage);
7070
Assert.Contains("ChatVoiceDialog_OutputOffTitle", chatPage);
7171
Assert.Contains("ChatVoiceDialog_OutputOffMessage", chatPage);
72-
Assert.Contains("ChatVoiceDialog_TtsSetupRequiredTitle", chatPage);
73-
Assert.Contains("ChatVoiceDialog_TtsSetupRequiredMessage", chatPage);
7472
Assert.Contains("NavigateToPermissionsSettings", chatPage);
75-
Assert.Contains("NavigateToVoiceSettings", chatPage);
73+
Assert.DoesNotContain("ChatVoiceDialog_TtsSetupRequired", chatPage);
7674

7775
Assert.Contains("ReadChatTextAloudAsync", chatWindow);
7876
Assert.Contains("OnSpeakerMuteChangedAsync", chatWindow);
@@ -85,15 +83,14 @@ public void ChatVoiceDialogs_RouteDisabledTtsCapabilityToPermissions_AndMissingS
8583
Assert.Contains("_functionalHost?.SetSpeakerMuted(true);\r\n await ShowTtsUnavailableDialogAsync();", chatWindow);
8684
Assert.Contains("ChatVoiceDialog_OutputOffTitle", chatWindow);
8785
Assert.Contains("ChatVoiceDialog_OutputOffMessage", chatWindow);
88-
Assert.Contains("ChatVoiceDialog_TtsSetupRequiredTitle", chatWindow);
89-
Assert.Contains("ChatVoiceDialog_TtsSetupRequiredMessage", chatWindow);
9086
Assert.Contains("ShowHub(\"permissions\")", chatWindow);
91-
Assert.Contains("ShowHub(\"voice\")", chatWindow);
87+
Assert.DoesNotContain("ChatVoiceDialog_TtsSetupRequired", chatWindow);
9288

9389
Assert.Contains("SpeechSetupReadiness.IsConfiguredTtsProviderSetupRequired", permissionsPage);
9490
Assert.Contains("SpeechSetupReadiness.IsAutomaticChatTtsEnabled", Read("src", "OpenClaw.Tray.WinUI", "App.xaml.cs"));
9591
Assert.Contains("IsAutomaticChatTtsEnabled", Read("src", "OpenClaw.Tray.WinUI", "Services", "SpeechSetupReadiness.cs"));
92+
Assert.Contains("return settings?.NodeTtsEnabled == true;", Read("src", "OpenClaw.Tray.WinUI", "Services", "SpeechSetupReadiness.cs"));
9693
Assert.Contains("Text-to-speech is disabled. Enable the capability in Permissions", resources);
97-
Assert.Contains("Text-to-speech is on, but read aloud will not work until a voice or provider is configured.", resources);
94+
Assert.DoesNotContain("ChatVoiceDialog_TtsSetupRequired", resources);
9895
}
9996
}

0 commit comments

Comments
 (0)