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

[File Explorer Source Control Integration] Accessibility bug fixes #3906

Merged
merged 2 commits into from
Oct 3, 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
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.Linq;
using System.Threading.Tasks;
using DevHome.Common.Extensions;
Expand All @@ -21,13 +20,22 @@ public class RepositoryInformation

public string SourceControlProviderPackageDisplayName { get; }

public RepositoryInformation(string rootpath, string classId)
public string RepositoryPathMapping { get; }

public int Position { get; }

public int Size { get; }

public RepositoryInformation(string rootpath, string classId, int position, int size)
{
RepositoryRootPath = rootpath;
SourceControlProviderCLSID = classId;
var extension = GetExtension(classId);
SourceControlProviderDisplayName = GetExtensionDisplayName(extension);
SourceControlProviderPackageDisplayName = GetExtensionPackageDisplayName(extension);
RepositoryPathMapping = string.Concat(RepositoryRootPath, " ", SourceControlProviderDisplayName);
Position = position;
Size = size;
}

private IExtensionWrapper? GetExtension(string classId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
Expand Down Expand Up @@ -70,9 +71,10 @@ public void RefreshTrackedRepositories()
{
TrackedRepositories.Clear();
var repoCollection = RepoTracker.GetAllTrackedRepositories();
foreach (KeyValuePair<string, string> data in repoCollection)
for (int position = 0; position < repoCollection.Count; position++)
{
TrackedRepositories.Add(new RepositoryInformation(data.Key, data.Value));
var data = repoCollection.ElementAt(position);
TrackedRepositories.Add(new RepositoryInformation(data.Key, data.Value, position + 1, repoCollection.Count));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
x:Uid="AddRepositoriesCard"
Grid.Column="1">
<Button
x:Uid="AddFolderButton"
x:Uid="AddFolderButton"
Style="{ThemeResource AccentButtonStyle}"
Command="{x:Bind ViewModel.AddFolderClickCommand}" />
</ctControls:SettingsCard>
Expand All @@ -40,15 +40,20 @@
Orientation="Horizontal">
<DropDownButton
Content="{Binding SourceControlProviderDisplayName}"
ToolTipService.ToolTip="{Binding SourceControlProviderPackageDisplayName}">
AutomationProperties.Name="{Binding RepositoryPathMapping}"
ToolTipService.ToolTip="{Binding SourceControlProviderPackageDisplayName}"
AutomationProperties.PositionInSet="{Binding Position}"
AutomationProperties.SizeOfSet="{Binding Size}">
<DropDownButton.Flyout>
<MenuFlyout
Opening="SourceControlProviderMenuFlyout_Opening"
Placement="Bottom">
</MenuFlyout>
</DropDownButton.Flyout>
</DropDownButton>
<Button
<Button
AutomationProperties.PositionInSet="{Binding Position}"
AutomationProperties.SizeOfSet="{Binding Size}"
x:Uid="MoreOptionsButton"
Content="&#xe712;"
Height="36"
Expand Down
Loading