fix(setup): announce the "Remove my data" plan when it appears

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-03 17:24:28 +00:00
1 parent 39627b3f4a
commit e5ecc5080b
3 files changed
+15 -4

No files matched your search

+1
View File
@@ -245,6 +245,7 @@ internal sealed class SetupViewModel : LocalizedViewModel, INotifyDataErrorInfo
public bool HasLaunchOption => _engine?.LaunchTarget(SelectedComponents) is not null; public bool HasLaunchOption => _engine?.LaunchTarget(SelectedComponents) is not null;
public string InstallText => CanChangeLocation ? Loc.L("Setup.Action.Install") : Loc.L("Setup.Action.Update"); public string InstallText => CanChangeLocation ? Loc.L("Setup.Action.Install") : Loc.L("Setup.Action.Update");
/// <summary>What Install does, or why it is disabled: no program selected, or a folder it cannot use.</summary> /// <summary>What Install does, or why it is disabled: no program selected, or a folder it cannot use.</summary>
public string InstallToolTip => !Components.Any(c => c.IsSelected) ? Loc.L("Tooltips.Setup.NoComponent") public string InstallToolTip => !Components.Any(c => c.IsSelected) ? Loc.L("Tooltips.Setup.NoComponent")
: !IsDirectoryValid ? Loc.L("Tooltips.Setup.FolderInvalid") : !IsDirectoryValid ? Loc.L("Tooltips.Setup.FolderInvalid")
+1 -1
View File
@@ -102,7 +102,7 @@
<Border Grid.Row="2" Grid.Column="1" Style="{StaticResource Border.Card}" Padding="12,8" <Border Grid.Row="2" Grid.Column="1" Style="{StaticResource Border.Card}" Padding="12,8"
Visibility="{Binding IsDataPlanVisible, Converter={StaticResource BoolToVisibility}}"> Visibility="{Binding IsDataPlanVisible, Converter={StaticResource BoolToVisibility}}">
<StackPanel> <StackPanel>
<TextBlock Text="{Binding DataPlanText}" Style="{StaticResource Text.Section}" Foreground="{DynamicResource Brush.Warning}" Margin="0,0,0,6" <TextBlock x:Name="DataPlanHeading" Text="{Binding DataPlanText}" Style="{StaticResource Text.Section}" Foreground="{DynamicResource Brush.Warning}" Margin="0,0,0,6"
AutomationProperties.LiveSetting="Polite" /> AutomationProperties.LiveSetting="Polite" />
<ItemsControl ItemsSource="{Binding DataPlanRows}" Focusable="False"> <ItemsControl ItemsSource="{Binding DataPlanRows}" Focusable="False">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
+13 -3
View File
@@ -59,19 +59,29 @@ internal sealed partial class SetupWindow : TitanoWindow
e.Handled = true; e.Handled = true;
} }
/// <summary>A new stage collapses the focused button: the keyboard moves to the new default and the outcome is read out.</summary> /// <summary>
/// A new stage collapses the focused button: the keyboard moves to the new default and the outcome is read out.
/// The "Remove my data" plan is read out when it appears.
/// </summary>
private void OnModelChanged(object? sender, PropertyChangedEventArgs e) private void OnModelChanged(object? sender, PropertyChangedEventArgs e)
{ {
if (e.PropertyName == nameof(SetupViewModel.IsDataPlanVisible) && _model.IsDataPlanVisible)
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, () => Announce(DataPlanHeading));
if (_model.Stage == _shownStage) return; if (_model.Stage == _shownStage) return;
_shownStage = _model.Stage; _shownStage = _model.Stage;
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, () => Dispatcher.BeginInvoke(DispatcherPriority.Loaded, () =>
{ {
FocusDefault(); FocusDefault();
if (StageMessage() is { IsVisible: true } message) if (StageMessage() is { } message) Announce(message);
UIElementAutomationPeer.CreatePeerForElement(message)?.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
}); });
} }
/// <summary>Asks screen readers to read <paramref name="element"/> (it carries a live setting).</summary>
private static void Announce(UIElement element)
{
if (element.IsVisible) UIElementAutomationPeer.CreatePeerForElement(element)?.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
}
private TextBlock? StageMessage() => _model.Stage switch private TextBlock? StageMessage() => _model.Stage switch
{ {
SetupStage.Confirm => ConfirmMessage, SetupStage.Confirm => ConfirmMessage,