mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 03:13:37 +00:00
Clarified the two ways of copying a chat
This commit is contained in:
parent
d3ee7dbbec
commit
5d83e50c72
@ -82,7 +82,7 @@ else
|
||||
</MudTooltip>
|
||||
|
||||
<MudTooltip Text="@T("Copy chat")" Placement="@WORKSPACE_ITEM_TOOLTIP_PLACEMENT">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.ContentCopy" Size="Size.Medium" Color="Color.Inherit" Disabled="@this.IsChatTreeItemBusy(treeItem)" OnClick="@(() => this.CopyChatAsync(treeItem.Path))"/>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.ContentCopy" Size="Size.Medium" Color="Color.Inherit" Disabled="@this.IsChatTreeItemBusy(treeItem)" OnClick="@(() => this.CopyChatFromTreeAsync(treeItem.Path))"/>
|
||||
</MudTooltip>
|
||||
|
||||
<MudTooltip Text="@T("Rename")" Placement="@WORKSPACE_ITEM_TOOLTIP_PLACEMENT">
|
||||
|
||||
@ -799,7 +799,17 @@ public partial class Workspaces : MSGComponentBase
|
||||
await this.LoadTreeItemsAsync(startPrefetch: false);
|
||||
}
|
||||
|
||||
private async Task CopyChatAsync(string? chatPath)
|
||||
/// <summary>
|
||||
/// Copies the chat behind the copy button of a tree item and opens the copy.
|
||||
/// </summary>
|
||||
/// <param name="chatPath">The directory of the chat to copy.</param>
|
||||
/// <remarks>
|
||||
/// The copy itself is done by CopyChatAsync, which the chat toolbar uses as well. What this
|
||||
/// handler adds is what only the tree needs: it finds the chat by its directory, and because it
|
||||
/// opens the copy afterward, it asks first when the chat open right now has unsaved changes.
|
||||
/// The chat toolbar asks nothing, since it copies the chat on the screen and keeps working in it.
|
||||
/// </remarks>
|
||||
private async Task CopyChatFromTreeAsync(string? chatPath)
|
||||
{
|
||||
var chat = await this.LoadChatAsync(chatPath, false);
|
||||
if (chat is null)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user