mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-14 06:33:47 +00:00
Clarified the two ways of copying a chat
This commit is contained in:
2 files changed
+12
-2
No files matched your search
@@ -82,7 +82,7 @@ else
|
|||||||
</MudTooltip>
|
</MudTooltip>
|
||||||
|
|
||||||
<MudTooltip Text="@T("Copy chat")" Placement="@WORKSPACE_ITEM_TOOLTIP_PLACEMENT">
|
<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>
|
||||||
|
|
||||||
<MudTooltip Text="@T("Rename")" Placement="@WORKSPACE_ITEM_TOOLTIP_PLACEMENT">
|
<MudTooltip Text="@T("Rename")" Placement="@WORKSPACE_ITEM_TOOLTIP_PLACEMENT">
|
||||||
|
|||||||
@@ -799,7 +799,17 @@ public partial class Workspaces : MSGComponentBase
|
|||||||
await this.LoadTreeItemsAsync(startPrefetch: false);
|
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);
|
var chat = await this.LoadChatAsync(chatPath, false);
|
||||||
if (chat is null)
|
if (chat is null)
|
||||||
|
|||||||
Reference in new issue
Block a user