Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add narrator announcement when removing all applications button is invoked #3605

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public static class StringResourceKey
public static readonly string PathWithColon = nameof(PathWithColon);
public static readonly string RemoveApplication = nameof(RemoveApplication);
public static readonly string RemovedApplication = nameof(RemovedApplication);
public static readonly string RemovedAllApplications = nameof(RemovedAllApplications);
public static readonly string ResultCountPlural = nameof(ResultCountPlural);
public static readonly string ResultCountSingular = nameof(ResultCountSingular);
public static readonly string RestorePackagesTitle = nameof(RestorePackagesTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@
<value>Removed {0}</value>
<comment>{Locked="{0}"}Text announced when a button for removing an application is invoked. {0} is replaced by the application name.</comment>
</data>
<data name="RemovedAllApplications" xml:space="preserve">
<value>Removed all applications</value>
<comment>Text announced when a button for removing all applications is invoked.</comment>
</data>
<data name="ResultCountPlural" xml:space="preserve">
<value>{0} Results found for "{1}"</value>
<comment>{Locked="{0}", "{1}"} Label for a search result counter. {0} is replaced by the number of result items. {1} is replaced with the search term.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DevHome.Common.Extensions;
using DevHome.Common.Services;
using DevHome.SetupFlow.Services;
using Microsoft.Extensions.Hosting;
using Serilog;
Expand All @@ -18,6 +19,7 @@ namespace DevHome.SetupFlow.ViewModels;
public partial class AppManagementViewModel : SetupPageViewModelBase
{
private readonly ILogger _log = Log.ForContext("SourceContext", nameof(AppManagementViewModel));
private readonly IScreenReaderService _screenReaderService;
private readonly ShimmerSearchViewModel _shimmerSearchViewModel;
private readonly SearchViewModel _searchViewModel;
private readonly PackageCatalogListViewModel _packageCatalogListViewModel;
Expand Down Expand Up @@ -45,11 +47,13 @@ public partial class AppManagementViewModel : SetupPageViewModelBase

public AppManagementViewModel(
ISetupFlowStringResource stringResource,
IScreenReaderService screenReaderService,
SetupFlowOrchestrator orchestrator,
IHost host,
PackageProvider packageProvider)
: base(stringResource, orchestrator)
{
_screenReaderService = screenReaderService;
_packageProvider = packageProvider;
_searchViewModel = host.GetService<SearchViewModel>();
_shimmerSearchViewModel = host.GetService<ShimmerSearchViewModel>();
Expand Down Expand Up @@ -107,6 +111,8 @@ private void RemoveAllPackages()
{
package.IsSelected = false;
}

_screenReaderService.Announce(StringResource.GetLocalized(StringResourceKey.RemovedAllApplications));
}

[RelayCommand]
Expand Down
Loading