diff --git a/src/ui/Features/Translate/TranslateSettingsWindow.cs b/src/ui/Features/Translate/TranslateSettingsWindow.cs index df9b4f86f9..47df1d6cb2 100644 --- a/src/ui/Features/Translate/TranslateSettingsWindow.cs +++ b/src/ui/Features/Translate/TranslateSettingsWindow.cs @@ -81,6 +81,7 @@ public TranslateSettingsWindow(TranslateSettingsViewModel vm) TextWrapping = Avalonia.Media.TextWrapping.Wrap, }.BindIsVisible(vm, nameof(vm.PromptIsVisible)) .BindText(vm, nameof(vm.PromptText)); + promptTextBox.WithLabeledBy(labelPrompt); var buttonOk = UiUtil.MakeButtonOk(vm.OkCommand); var buttonCancel = UiUtil.MakeButtonCancel(vm.CancelCommand); diff --git a/src/ui/Features/Video/TextToSpeech/VoiceManager/VoiceManagerWindow.cs b/src/ui/Features/Video/TextToSpeech/VoiceManager/VoiceManagerWindow.cs index e0371eeb79..4b0fb39aa7 100644 --- a/src/ui/Features/Video/TextToSpeech/VoiceManager/VoiceManagerWindow.cs +++ b/src/ui/Features/Video/TextToSpeech/VoiceManager/VoiceManagerWindow.cs @@ -504,6 +504,7 @@ private Control MakeDetailsPane(VoiceManagerViewModel vm) HorizontalAlignment = HorizontalAlignment.Stretch, [!TextBox.TextProperty] = new Binding(nameof(vm.Transcript)) { Mode = BindingMode.TwoWay }, }; + transcriptBox.WithLabeledBy(transcriptHeader); var transcriptPanel = new StackPanel { diff --git a/tests/UI/Logic/AccessibleNamesTests.cs b/tests/UI/Logic/AccessibleNamesTests.cs index 387887d73f..c6ebcf5f15 100644 --- a/tests/UI/Logic/AccessibleNamesTests.cs +++ b/tests/UI/Logic/AccessibleNamesTests.cs @@ -21,7 +21,9 @@ namespace UITests.Logic; /// by the window or derived from its visible label by /// (#12087: "I hear a value followed by combo box, but no label telling me which setting /// I am changing"). This opens every tool window that takes a single DI-resolvable view -/// model and lists the inputs that still have no name. +/// model and lists the inputs that still have no name. Hidden inputs are included because +/// AccessibleLabels.Apply runs once when the window loads; controls that become visible later +/// do not get a second inference pass. /// public class AccessibleNamesTests { @@ -80,7 +82,7 @@ public void EveryInputInEveryWindow_HasAnAccessibleName() { foreach (var control in window.GetLogicalDescendants().OfType()) { - if (!AccessibleLabels.IsInput(control) || control.TemplatedParent != null || !control.IsEffectivelyVisible) + if (!AccessibleLabels.IsInput(control) || control.TemplatedParent != null) { continue; }