Add TeamClipboardMatcher utility and corresponding tests for fuzzy team name matching

This commit introduces the TeamClipboardMatcher class, which provides functionality to match team names from clipboard text using fuzzy matching techniques. The class includes methods for extracting team names and finding the best match based on a specified threshold. Additionally, comprehensive unit tests are added in TeamClipboardMatcher_Tests to validate various matching scenarios, including exact matches, fuzzy matches, and handling of different clipboard formats. This enhancement improves the application's ability to efficiently match teams from user input.
This commit is contained in:
2026-01-20 22:49:09 -05:00
parent 455be30821
commit 48861eb6a6
4 changed files with 597 additions and 24 deletions
@@ -0,0 +1,54 @@
@namespace WebApp.Components.Shared.Components
<MudPaper Elevation="0" Class="pa-1" Style="border: 1px solid var(--mud-palette-lines-default); border-radius: var(--mud-default-borderradius);">
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
<MudTooltip Text="@AddTooltip">
<MudIconButton Icon="@Icons.Material.Filled.Add"
Variant="Variant.Outlined"
Color="Color.Primary"
OnClick="HandleAdd"
Size="Size.Small" />
</MudTooltip>
<MudText Typo="Typo.body2" Style="flex: 1; text-align: center;">@Label</MudText>
<MudTooltip Text="@RemoveTooltip">
<MudIconButton Icon="@Icons.Material.Filled.Remove"
Variant="Variant.Outlined"
Color="Color.Error"
OnClick="HandleRemove"
Size="Size.Small" />
</MudTooltip>
</MudStack>
</MudPaper>
@code {
[Parameter]
public required string Label { get; set; }
[Parameter]
public EventCallback OnAdd { get; set; }
[Parameter]
public EventCallback OnRemove { get; set; }
[Parameter]
public string? AddTooltip { get; set; }
[Parameter]
public string? RemoveTooltip { get; set; }
private async Task HandleAdd()
{
if (OnAdd.HasDelegate)
{
await OnAdd.InvokeAsync();
}
}
private async Task HandleRemove()
{
if (OnRemove.HasDelegate)
{
await OnRemove.InvokeAsync();
}
}
}