Skip to content

Commit 0a67c01

Browse files
authored
Merge pull request microsoft#257371 from microsoft/osortega/chat-sessions-view
Chat sessions view
2 parents cfc04dc + 0f7b9aa commit 0a67c01

File tree

7 files changed

+757
-7
lines changed

7 files changed

+757
-7
lines changed

src/vs/workbench/api/browser/mainThreadChatSessions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ export class MainThreadChatSessions extends Disposable implements MainThreadChat
2323
super();
2424
}
2525

26-
$registerChatSessionItemProvider(handle: number, chatSessionType: string): void {
26+
$registerChatSessionItemProvider(handle: number, chatSessionType: string, label: string): void {
2727
// Register the provider handle - this tracks that a provider exists
2828
const provider: IChatSessionItemProvider = {
29+
label,
2930
chatSessionType,
3031
provideChatSessionItems: (token) => this._provideChatSessionItems(handle, token)
3132
};

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3111,7 +3111,7 @@ export interface MainThreadChatStatusShape {
31113111
}
31123112

31133113
export interface MainThreadChatSessionsShape extends IDisposable {
3114-
$registerChatSessionItemProvider(handle: number, chatSessionType: string): void;
3114+
$registerChatSessionItemProvider(handle: number, chatSessionType: string, label: string): void;
31153115
$unregisterChatSessionItemProvider(handle: number): void;
31163116
}
31173117

src/vs/workbench/api/common/extHostChatSessions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export class ExtHostChatSessions extends Disposable implements ExtHostChatSessio
1717

1818
private readonly _proxy: Proxied<MainThreadChatSessionsShape>;
1919
private readonly _statusProviders = new Map<number, { provider: vscode.ChatSessionItemProvider; disposable: DisposableStore }>();
20-
private _nextHandle = 0;
20+
// Starting at 1, 0 is reserved for local chat session item provider
21+
private _nextHandle = 1;
2122
private _sessionMap: Map<string, vscode.ChatSessionItem> = new Map();
2223

2324
constructor(
@@ -51,7 +52,7 @@ export class ExtHostChatSessions extends Disposable implements ExtHostChatSessio
5152
const disposables = new DisposableStore();
5253

5354
this._statusProviders.set(handle, { provider, disposable: disposables });
54-
this._proxy.$registerChatSessionItemProvider(handle, chatSessionType);
55+
this._proxy.$registerChatSessionItemProvider(handle, chatSessionType, provider.label);
5556

5657
return {
5758
dispose: () => {

src/vs/workbench/contrib/chat/browser/chat.contribution.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ import { ChatCompatibilityNotifier, ChatExtensionPointHandler } from './chatPart
9494
import { ChatPasteProvidersFeature } from './chatPasteProviders.js';
9595
import { QuickChatService } from './chatQuick.js';
9696
import { ChatResponseAccessibleView } from './chatResponseAccessibleView.js';
97+
// import './chatSessions.js';
9798
import { ChatSetupContribution } from './chatSetup.js';
9899
import { ChatStatusBarEntry } from './chatStatus.js';
99100
import { ChatVariablesService } from './chatVariables.js';
@@ -116,6 +117,7 @@ import { registerLanguageModelActions } from './actions/chatLanguageModelActions
116117
import { PromptUrlHandler } from './promptSyntax/promptUrlHandler.js';
117118
import { ChatTaskServiceImpl, IChatTasksService } from '../common/chatTasksService.js';
118119
import { ChatOutputRendererService, IChatOutputRendererService } from './chatOutputItemRenderer.js';
120+
import { ChatSessionsView } from './chatSessions.js';
119121

120122
// Register configuration
121123
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
@@ -364,7 +366,7 @@ configurationRegistry.registerConfiguration({
364366
},
365367
[ChatConfiguration.AgentSessionsViewLocation]: {
366368
type: 'string',
367-
enum: ['disabled', 'showChatsMenu'],
369+
enum: ['disabled', 'showChatsMenu', 'view'],
368370
description: nls.localize('chat.sessionsViewLocation.description', "Controls where to show the agent sessions menu."),
369371
default: 'disabled',
370372
tags: ['experimental'],
@@ -758,6 +760,7 @@ registerWorkbenchContribution2(ChatTransferContribution.ID, ChatTransferContribu
758760
registerWorkbenchContribution2(ChatContextContributions.ID, ChatContextContributions, WorkbenchPhase.AfterRestored);
759761
registerWorkbenchContribution2(ChatResponseResourceFileSystemProvider.ID, ChatResponseResourceFileSystemProvider, WorkbenchPhase.AfterRestored);
760762
registerWorkbenchContribution2(PromptUrlHandler.ID, PromptUrlHandler, WorkbenchPhase.BlockRestore);
763+
registerWorkbenchContribution2(ChatSessionsView.ID, ChatSessionsView, WorkbenchPhase.AfterRestored);
761764

762765
registerChatActions();
763766
registerChatCopyActions();

0 commit comments

Comments
 (0)