Skip to content

Commit 7d0d7ff

Browse files
authored
chat - ensure chat view opens when using context actions (microsoft#261632) (microsoft#261637)
1 parent 1319195 commit 7d0d7ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatContextActions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ async function withChatView(accessor: ServicesAccessor): Promise<IChatWidget | u
6363
const viewsService = accessor.get(IViewsService);
6464
const chatWidgetService = accessor.get(IChatWidgetService);
6565

66-
if (chatWidgetService.lastFocusedWidget) {
67-
return chatWidgetService.lastFocusedWidget;
66+
const lastFocusedWidget = chatWidgetService.lastFocusedWidget;
67+
if (!lastFocusedWidget || lastFocusedWidget.location === ChatAgentLocation.Panel) {
68+
return showChatView(viewsService); // only show chat view if we either have no chat view or its located in view container
6869
}
69-
return showChatView(viewsService);
70+
return lastFocusedWidget;
7071
}
7172

7273
abstract class AttachResourceAction extends Action2 {

0 commit comments

Comments
 (0)