Skip to content

Commit 0958948

Browse files
authored
Merge pull request microsoft#256878 from microsoft/osortega/chat-session-contribution-fixes
Couple of fixes for the chat session contribution
2 parents a753922 + cb048a7 commit 0958948

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class ExtHostChatSessions extends Disposable implements IExtHostChatSessi
2626
private readonly _proxy: Proxied<MainThreadChatSessionsShape>;
2727
private readonly _statusProviders = new Map<number, { provider: vscode.ChatSessionsProvider; disposable: DisposableStore }>();
2828
private _nextHandle = 0;
29-
private _sessionMap: Map<string, vscode.ChatSessionContent & Record<string, unknown>> = new Map();
29+
private _sessionMap: Map<string, vscode.ChatSessionContent> = new Map();
3030

3131
constructor(
3232
commands: ExtHostCommands,
@@ -78,17 +78,22 @@ export class ExtHostChatSessions extends Disposable implements IExtHostChatSessi
7878
return [];
7979
}
8080

81-
const session = await entry.provider.provideChatSessions(token);
82-
for (const sessionContent of session) {
81+
const sessions = await entry.provider.provideChatSessions(token);
82+
const response: vscode.ChatSessionContent[] = [];
83+
for (const sessionContent of sessions) {
8384
if (sessionContent.uri) {
8485
this._sessionMap.set(
8586
this.uriToId(sessionContent.uri),
86-
sessionContent as vscode.ChatSessionContent & Record<string, unknown>
87+
sessionContent
8788
);
89+
response.push({
90+
uri: sessionContent.uri,
91+
label: sessionContent.label,
92+
iconPath: sessionContent.iconPath
93+
});
8894
}
8995
}
90-
91-
return session;
96+
return response;
9297
}
9398

9499
private uriToId(uri: URI): string {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,9 @@ export function registerChatActions() {
576576
const menuActions = getContextMenuActions(actions, 'navigation');
577577
ckey.reset();
578578

579-
const buttons = menuActions.primary.map(action => ({
579+
// Use primary actions if available, otherwise fall back to secondary actions
580+
const actionsToUse = menuActions.primary.length > 0 ? menuActions.primary : menuActions.secondary;
581+
const buttons = actionsToUse.map(action => ({
580582
id: action.id,
581583
tooltip: action.tooltip,
582584
iconClass: action.class || ThemeIcon.asClassName(Codicon.symbolClass),

0 commit comments

Comments
 (0)