Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import { MultiDiffEditorItem } from '../../../multiDiffEditor/browser/multiDiffS
import { ChatContextKeys } from '../../common/chatContextKeys.js';
import { IEditSessionEntryDiff } from '../../common/chatEditingService.js';
import { IChatMultiDiffData, IChatMultiDiffInnerData } from '../../common/chatService.js';
import { getChatSessionType } from '../../common/chatUri.js';
import { IChatRendererContent } from '../../common/chatViewModel.js';
import { ChatTreeItem } from '../chat.js';
import { ChatEditorInput } from '../chatEditorInput.js';
import { IChatContentPart } from './chatContentParts.js';

const $ = dom.$;
Expand All @@ -57,12 +57,12 @@ export class ChatMultiDiffContentPart extends Disposable implements IChatContent

constructor(
private readonly content: IChatMultiDiffData,
_element: ChatTreeItem,
private readonly _element: ChatTreeItem,
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IEditorService private readonly editorService: IEditorService,
@IThemeService private readonly themeService: IThemeService,
@IMenuService private readonly menuService: IMenuService,
@IContextKeyService private readonly contextKeyService: IContextKeyService
@IContextKeyService private readonly contextKeyService: IContextKeyService,
) {
super();

Expand Down Expand Up @@ -143,19 +143,17 @@ export class ChatMultiDiffContentPart extends Disposable implements IChatContent
}));
const setupActionBar = () => {
actionBar.clear();

const resource = this._element.sessionResource;
let marshalledUri: unknown | undefined = undefined;
let contextKeyService: IContextKeyService = this.contextKeyService;
if (this.editorService.activeEditor instanceof ChatEditorInput) {
contextKeyService = this.contextKeyService.createOverlay([
[ChatContextKeys.agentSessionType.key, this.editorService.activeEditor.getSessionType()]
]);

marshalledUri = {
...this.editorService.activeEditor.resource,
$mid: MarshalledId.Uri
};
}

contextKeyService = this.contextKeyService.createOverlay([
[ChatContextKeys.agentSessionType.key, getChatSessionType(resource)]
]);
marshalledUri = {
...resource,
$mid: MarshalledId.Uri
};

const actions = this.menuService.getMenuActions(
MenuId.ChatMultiDiffContext,
Expand Down