Enhance copy confirmation in Ask.razor and update package

Updated the copy confirmation feature in `Ask.razor` by replacing the `isCopied` variable with `showCopyConfirmation`, improving user feedback with a longer display duration for the checkmark icon.

Also, updated the `Microsoft.SemanticKernel` package version from `1.52.1` to `1.53.1` for potential bug fixes and improvements.
This commit is contained in:
Marco Minerva
2025-05-22 09:36:09 +02:00
parent e4a0a53e53
commit db0ec7cec6
2 changed files with 6 additions and 6 deletions
@@ -60,7 +60,7 @@
<div class="text-end bg-transparent">
<Tooltip Title="@toolTipText" Color="TooltipColor.Dark" Placement="TooltipPlacement.Bottom">
<Button Type="ButtonType.Button" Outline="false" @onclick="@(async () => await CopyToClipboardAsync(message.Text))">
@if (isCopied)
@if (showCopyConfirmation)
{
<Icon Name="IconName.Check" Class="text-success" />
}
@@ -117,7 +117,7 @@
private Guid conversationId = Guid.NewGuid();
private bool isAsking = false;
private bool isCopied = false;
private bool showCopyConfirmation = false;
private string toolTipText = "Copy to Clipboard";
protected override async Task OnAfterRenderAsync(bool firstRender)
@@ -219,14 +219,14 @@
await JSRuntime.InvokeVoidAsync("navigator.clipboard.writeText", text);
isCopied = true;
showCopyConfirmation = true;
toolTipText = "Copied!";
StateHasChanged();
await Task.Delay(1500); // Shows the checkmark for 1.5 seconds
await Task.Delay(3000); // Shows the checkmark for 3 seconds
toolTipText = "Copy to Clipboard";
isCopied = false;
showCopyConfirmation = false;
StateHasChanged();
}
@@ -24,7 +24,7 @@
<PackageReference Include="Microsoft.ML.Tokenizers" Version="1.0.2" />
<PackageReference Include="Microsoft.ML.Tokenizers.Data.Cl100kBase" Version="1.0.2" />
<PackageReference Include="Microsoft.ML.Tokenizers.Data.O200kBase" Version="1.0.2" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.52.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.53.1" />
<PackageReference Include="MimeMapping" Version="3.1.0" />
<PackageReference Include="MinimalHelpers.FluentValidation" Version="1.1.3" />
<PackageReference Include="MinimalHelpers.Routing.Analyzers" Version="1.1.3" />