Fixed the workspace list not following a moved chat (#1048)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-11 13:42:15 +02:00
1 parent 5ee4dfa2b5
commit 1c13300988
9 files changed
+362 -41

No files matched your search

@@ -938,7 +938,24 @@ public partial class Workspaces : MSGComponentBase
await this.LoadTreeItemsAsync(startPrefetch: false);
}
private async Task MoveChatAsync(string? chatPath)
/// <summary>
/// Moves the given chat into another workspace and shows it there in the tree.
/// </summary>
/// <param name="chat">The chat to move. It gets the new workspace and the new paths of its attachments.</param>
/// <param name="targetWorkspaceId">The workspace to move the chat into.</param>
/// <remarks>
/// Neither asks for the target workspace nor follows the chat in the chat view: both depend on
/// where the move was asked for. Whoever moves a chat while this component exists goes through
/// here, though, since the tree draws what it has built before and would otherwise keep showing
/// the chat in its old place.
/// </remarks>
public async Task MoveChatAsync(ChatThread chat, Guid targetWorkspaceId)
{
await WorkspaceBehaviour.MoveChatAsync(chat, targetWorkspaceId);
await this.LoadTreeItemsAsync(startPrefetch: false);
}
private async Task MoveChatFromTreeAsync(string? chatPath)
{
var storedChat = await this.LoadChatAsync(chatPath, false);
if (storedChat is null)
@@ -969,11 +986,9 @@ public partial class Workspaces : MSGComponentBase
if (workspaceId == Guid.Empty)
return;
await WorkspaceBehaviour.MoveChatAsync(chat, workspaceId);
await this.MoveChatAsync(chat, workspaceId);
if (ReferenceEquals(chat, this.CurrentChatThread))
await this.CurrentChatThreadChanged.InvokeAsync(this.CurrentChatThread);
await this.LoadTreeItemsAsync(startPrefetch: false);
}
private async Task AddChatAsync(string workspacePath)