Skip to content

[.NET 9] Add a11y fixes to DeveloperBalance App #611

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

Merged
merged 12 commits into from
Jul 4, 2025

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Jun 13, 2025

Apply a11y fixes to DeveloperBalance App to the .NET 9 samples.

@jsuarezruiz jsuarezruiz requested review from jfversluis, Copilot and tj-devel709 and removed request for Copilot June 13, 2025 10:09
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Apply a11y improvements and .NET 9 updates across the DeveloperBalance sample, including replacing legacy layouts with CollectionView, enhancing screen-reader semantics, and refining ViewModel navigation and repository logic.

  • Swap ScrollView/BindableLayout for CollectionView and add semantic properties for accessibility
  • Introduce null-safe navigation signatures and SelectedProject/SelectedTags properties in page models
  • Add Windows-specific tab stops, segment descriptions, and repository association checks

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
nuget.config New NuGet package source
Platforms/MacCatalyst/Info.plist Added app category key
Pages/ProjectListPage.xaml.cs Bound AppearingBehavior’s context
Pages/ProjectListPage.xaml Swapped to CollectionView and updated semantics
Pages/ProjectDetailPage.xaml.cs Added selection-changed handler
Pages/ProjectDetailPage.xaml Replaced tag templates with multi-select view
Pages/MainPage.xaml Replaced horizontal ScrollView with CollectionView
Pages/Controls/TaskView.xaml Adjusted layout, added automation properties
Pages/Controls/ProjectCardView.xaml Switched to FlexLayout for tags
Pages/Controls/CategoryChart.xaml.cs Enabled tab stop on Windows
Pages/Controls/CategoryChart.xaml Hidden shimmer from accessibility tree
PageModels/ProjectListPageModel.cs Added SelectedProject property, updated command
PageModels/ProjectDetailPageModel.cs Tracked SelectedTags, refactored ToggleTag logic
PageModels/MainPageModel.cs Added SelectedProject, updated navigation command
MauiProgram.cs Appended keyboard focus mapping for Windows
DeveloperBalance.csproj Bumped MauiVersion, package IDs and versions
Data/TagRepository.cs Prevent duplicate tag–project associations
AppShell.xaml.cs Added semantic description for theme selector
AppShell.xaml Added descriptions for light/dark mode segments
Comments suppressed due to low confidence (4)

PageModels/ProjectListPageModel.cs:31

  • The command method signature returns a nullable Task and checks project is null, but project is non-nullable. Change the return type to Task, remove the null check, and call Shell.Current.GoToAsync(...) directly.
Task? NavigateToProject(Project project)

PageModels/MainPageModel.cs:155

  • This method signature makes the Task nullable and guards against a null project, but project is non-nullable. Refactor to return Task, drop the null check, and call Shell.Current.GoToAsync(...) directly.
private Task? NavigateToProject(Project project)

Data/TagRepository.cs:231

  • Inside IsAssociated, calling SaveItemAsync(item) duplicates the initial tag save and incurs extra database overhead. Remove this call and assume the tag exists before checking the association.
await SaveItemAsync(item);

Pages/ProjectDetailPage.xaml:61

  • Removing the SemanticProperties.Hint on the icon grid loses the guidance for screen-reader users. Consider reintroducing a concise hint so that assistive technologies convey actionable context.
SemanticProperties.Hint="Icon representing the type of task . Tap to select"

@@ -10,6 +10,9 @@ public AppShell()
InitializeComponent();
var currentTheme = Application.Current!.RequestedTheme;
ThemeSegmentedControl.SelectedIndex = currentTheme == AppTheme.Light ? 0 : 1;
#if ANDROID || WINDOWS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why only on Android and Windows?

@@ -21,17 +21,18 @@
<Nullable>enable</Nullable>
<!-- https://github.com/CommunityToolkit/Maui/issues/2205 -->
<NoWarn>XC0103</NoWarn>
<MauiVersion>9.0.60</MauiVersion>
Copy link
Member

Choose a reason for hiding this comment

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

Can we just remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing it we are going to use 9.1.1 and requires to downgrade the Toolkit, but we use something from the latest versions.

Copy link
Member

Choose a reason for hiding this comment

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

aw yea :-(

Well, we will hopefully be releasing 9.0.81 here soon into workloads

BindingContext = model;
}

private async void CollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e)
Copy link
Member

Choose a reason for hiding this comment

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

Can this all be moved to a RelayCommand in the ViewModel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, moved to the ViewModel.

#if WINDOWS
if (chart is Microsoft.Maui.Platform.ContentPanel contentPanel)
{
contentPanel.IsTabStop = true;
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this to a mapper?

Is this an issue that's been highlighted to SF? Should they make this control a tabstop by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, move to a Mapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tj-devel709 Is this an issue that's been highlighted to SF? Should they make this control a tabstop by default?
I can follow the conversation with Sf about it.

@PureWeen PureWeen merged commit 64a0159 into main Jul 4, 2025
3 checks passed
@PureWeen PureWeen deleted the dev/TJ/DevBalanceMerge branch July 4, 2025 21:11
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.

4 participants