@codingame/monaco-vscode-katex-common 26.1.1 → 26.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +45 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +31 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +47 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +96 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +83 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +26 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatDisabledClaudeHooksContent.css +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +15 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +206 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPendingDragAndDrop.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPendingDragAndDrop.js +148 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +108 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +14 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +59 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +13 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +90 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +14 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +32 -32
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
|
@@ -43,11 +43,11 @@ import { annotateSpecialMarkdownContent, hasCodeblockUriTag, extractSubAgentInvo
|
|
|
43
43
|
import { checkModeOption } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
|
|
44
44
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
45
45
|
import { chatSubcommandLeader } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
|
|
46
|
-
import { ChatAgentVoteDirection, IChatToolInvocation, isChatFollowup, ChatErrorLevel, ChatAgentVoteDownReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
46
|
+
import { ChatAgentVoteDirection, ChatRequestQueueKind, IChatToolInvocation, isChatFollowup, ChatErrorLevel, ChatAgentVoteDownReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
47
47
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
48
48
|
import { localChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
49
49
|
import { getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
50
|
-
import { isResponseVM, isRequestVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
50
|
+
import { isResponseVM, isPendingDividerVM, isRequestVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
51
51
|
import { getNWords } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatWordCounter';
|
|
52
52
|
import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
|
|
53
53
|
import { ChatAgentLocation, ChatConfiguration, CollapsedToolsDisplayMode, ThinkingDisplayMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
@@ -70,6 +70,7 @@ import { ChatQuestionCarouselPart } from './chatContentParts/chatQuestionCarouse
|
|
|
70
70
|
import { ChatExtensionsContentPart } from './chatContentParts/chatExtensionsContentPart.js';
|
|
71
71
|
import { codeblockHasClosingBackticks, ChatMarkdownContentPart } from './chatContentParts/chatMarkdownContentPart.js';
|
|
72
72
|
import { ChatMcpServersInteractionContentPart } from './chatContentParts/chatMcpServersInteractionContentPart.js';
|
|
73
|
+
import { ChatDisabledClaudeHooksContentPart } from './chatContentParts/chatDisabledClaudeHooksContentPart.js';
|
|
73
74
|
import { ChatMultiDiffContentPart } from './chatContentParts/chatMultiDiffContentPart.js';
|
|
74
75
|
import { ChatWorkingProgressContentPart, ChatProgressContentPart } from './chatContentParts/chatProgressContentPart.js';
|
|
75
76
|
import { ChatPullRequestContentPart } from './chatContentParts/chatPullRequestContentPart.js';
|
|
@@ -89,6 +90,8 @@ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/in
|
|
|
89
90
|
import { RunSubagentTool } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool';
|
|
90
91
|
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
91
92
|
import { IChatTipService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatTipService.service';
|
|
93
|
+
import { ChatHookContentPart } from './chatContentParts/chatHookContentPart.js';
|
|
94
|
+
import { HookType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookSchema';
|
|
92
95
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
93
96
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
94
97
|
|
|
@@ -197,6 +200,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
197
200
|
}
|
|
198
201
|
}));
|
|
199
202
|
}
|
|
203
|
+
set pendingDragController(controller) {
|
|
204
|
+
this._pendingDragController = controller;
|
|
205
|
+
}
|
|
200
206
|
updateOptions(options) {
|
|
201
207
|
this.rendererOptions = {
|
|
202
208
|
...this.rendererOptions,
|
|
@@ -398,7 +404,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
398
404
|
const codiconRestoreContainer = append(checkpointRestoreContainer, $(".codicon-container"));
|
|
399
405
|
append(codiconRestoreContainer, $("span.codicon.codicon-bookmark"));
|
|
400
406
|
const label = append(checkpointRestoreContainer, $("span.checkpoint-label-text"));
|
|
401
|
-
label.textContent = ( localize(
|
|
407
|
+
label.textContent = ( localize(6107, "Checkpoint Restored"));
|
|
402
408
|
const checkpointRestoreToolbar = templateDisposables.add(scopedInstantiationService.createInstance(
|
|
403
409
|
MenuWorkbenchToolBar,
|
|
404
410
|
checkpointRestoreContainer,
|
|
@@ -557,11 +563,16 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
557
563
|
}
|
|
558
564
|
templateData.currentElement = element;
|
|
559
565
|
this.templateDataByRequestId.set(element.id, templateData);
|
|
560
|
-
|
|
566
|
+
if (isPendingDividerVM(element)) {
|
|
567
|
+
this.renderPendingDivider(element, templateData);
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
const kind = isRequestVM(element) ? "request" : isResponseVM(element) ? "response" : isPendingDividerVM(element) ? "pendingDivider" : "welcome";
|
|
561
571
|
this.traceLayout("renderElement", `${kind}, index=${index}`);
|
|
562
572
|
ChatContextKeys.isResponse.bindTo(templateData.contextKeyService).set(isResponseVM(element));
|
|
563
573
|
ChatContextKeys.itemId.bindTo(templateData.contextKeyService).set(element.id);
|
|
564
574
|
ChatContextKeys.isRequest.bindTo(templateData.contextKeyService).set(isRequestVM(element));
|
|
575
|
+
ChatContextKeys.isPendingRequest.bindTo(templateData.contextKeyService).set(isRequestVM(element) && !!element.pendingKind);
|
|
565
576
|
ChatContextKeys.responseDetectedAgentCommand.bindTo(templateData.contextKeyService).set(isResponseVM(element) && element.agentOrSlashCommandDetected);
|
|
566
577
|
if (isResponseVM(element)) {
|
|
567
578
|
ChatContextKeys.responseSupportsIssueReporting.bindTo(templateData.contextKeyService).set(!!element.agent?.metadata.supportIssueReporting);
|
|
@@ -588,6 +599,11 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
588
599
|
templateData.rowContainer.classList.toggle("editing-session", location === ChatAgentLocation.Chat);
|
|
589
600
|
templateData.rowContainer.classList.toggle("interactive-request", isRequestVM(element));
|
|
590
601
|
templateData.rowContainer.classList.toggle("interactive-response", isResponseVM(element));
|
|
602
|
+
templateData.rowContainer.classList.remove("pending-item", "pending-divider", "pending-request");
|
|
603
|
+
templateData.dragHandle?.remove();
|
|
604
|
+
templateData.dragHandle = undefined;
|
|
605
|
+
delete templateData.rowContainer.dataset.pendingRequestId;
|
|
606
|
+
delete templateData.rowContainer.dataset.pendingKind;
|
|
591
607
|
const progressMessageAtBottomOfResponse = checkModeOption(
|
|
592
608
|
this.delegate.currentChatMode(),
|
|
593
609
|
this.rendererOptions.progressMessageAtBottomOfResponse
|
|
@@ -609,8 +625,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
609
625
|
}
|
|
610
626
|
templateData.checkpointToolbar.context = element;
|
|
611
627
|
const checkpointEnabled = this.configService.getValue(ChatConfiguration.CheckpointsEnabled) && (this.rendererOptions.restorable ?? true);
|
|
612
|
-
|
|
613
|
-
|
|
628
|
+
const isPendingRequest = isRequestVM(element) && !!element.pendingKind;
|
|
629
|
+
templateData.checkpointContainer.classList.toggle("hidden", isResponseVM(element) || isPendingRequest || !checkpointEnabled);
|
|
630
|
+
const shouldShowRestore = this.viewModel?.model.checkpoint && !this.viewModel?.editing && (index === this.delegate.getListLength() - 1) && !isPendingRequest;
|
|
614
631
|
templateData.checkpointRestoreContainer.classList.toggle("hidden", !(shouldShowRestore && checkpointEnabled));
|
|
615
632
|
const editing = element.id === this.viewModel?.editing?.id;
|
|
616
633
|
const isInput = this.configService.getValue("chat.editRequests") === "input";
|
|
@@ -672,14 +689,40 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
672
689
|
}
|
|
673
690
|
templateData.renderedPartsMounted = true;
|
|
674
691
|
}
|
|
692
|
+
renderPendingDivider(element, templateData) {
|
|
693
|
+
templateData.rowContainer.classList.add("pending-item");
|
|
694
|
+
templateData.rowContainer.classList.add("pending-divider");
|
|
695
|
+
templateData.rowContainer.classList.remove("interactive-request", "interactive-response", "pending-request");
|
|
696
|
+
templateData.avatarContainer.classList.add("hidden");
|
|
697
|
+
templateData.username.classList.add("hidden");
|
|
698
|
+
templateData.requestHover.classList.add("hidden");
|
|
699
|
+
templateData.checkpointContainer.classList.add("hidden");
|
|
700
|
+
templateData.checkpointRestoreContainer.classList.add("hidden");
|
|
701
|
+
templateData.footerToolbar.getElement().classList.add("hidden");
|
|
702
|
+
if (templateData.titleToolbar) {
|
|
703
|
+
templateData.titleToolbar.getElement().classList.add("hidden");
|
|
704
|
+
}
|
|
705
|
+
clearNode(templateData.value);
|
|
706
|
+
clearNode(templateData.detail);
|
|
707
|
+
const dividerContent = $$1(".pending-divider-content");
|
|
708
|
+
const label = append(dividerContent, $$1("span.pending-divider-label"));
|
|
709
|
+
if (element.dividerKind === ChatRequestQueueKind.Steering) {
|
|
710
|
+
label.textContent = ( localize(6108, "Steering"));
|
|
711
|
+
label.title = ( localize(6109, "Steering message will be sent after the next tool call happens"));
|
|
712
|
+
} else {
|
|
713
|
+
label.textContent = ( localize(6110, "Queued"));
|
|
714
|
+
label.title = ( localize(6111, "Queued messages will be sent after the current request completes"));
|
|
715
|
+
}
|
|
716
|
+
templateData.value.appendChild(dividerContent);
|
|
717
|
+
}
|
|
675
718
|
renderDetail(element, templateData) {
|
|
676
719
|
clearNode(templateData.detail);
|
|
677
720
|
if (element.agentOrSlashCommandDetected) {
|
|
678
721
|
const msg = element.slashCommand ? ( localize(
|
|
679
|
-
|
|
722
|
+
6112,
|
|
680
723
|
"used {0} [[(rerun without)]]",
|
|
681
724
|
`${chatSubcommandLeader}${element.slashCommand.name}`
|
|
682
|
-
)) : ( localize(
|
|
725
|
+
)) : ( localize(6113, "[[(rerun without)]]"));
|
|
683
726
|
reset(templateData.detail, renderFormattedText(msg, {
|
|
684
727
|
actionHandler: {
|
|
685
728
|
disposables: templateData.elementDisposables,
|
|
@@ -692,7 +735,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
692
735
|
this.delegate.currentChatMode(),
|
|
693
736
|
this.rendererOptions.progressMessageAtBottomOfResponse
|
|
694
737
|
)) {
|
|
695
|
-
templateData.detail.textContent = ( localize(
|
|
738
|
+
templateData.detail.textContent = ( localize(6114, "Working"));
|
|
696
739
|
}
|
|
697
740
|
}
|
|
698
741
|
renderConfirmationAction(element, templateData) {
|
|
@@ -701,13 +744,23 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
701
744
|
append(templateData.detail, $("span.codicon.codicon-check", {
|
|
702
745
|
"aria-hidden": "true"
|
|
703
746
|
}));
|
|
704
|
-
append(templateData.detail, $("span.confirmation-text", undefined, ( localize(
|
|
747
|
+
append(templateData.detail, $("span.confirmation-text", undefined, ( localize(6115, "Selected \"{0}\"", element.confirmation))));
|
|
705
748
|
templateData.header?.classList.remove("header-disabled");
|
|
706
749
|
templateData.header?.classList.add("partially-disabled");
|
|
707
750
|
}
|
|
708
751
|
}
|
|
709
752
|
renderAvatar(element, templateData) {
|
|
710
|
-
|
|
753
|
+
if (isPendingDividerVM(element)) {
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
let icon;
|
|
757
|
+
if (isResponseVM(element)) {
|
|
758
|
+
icon = this.getAgentIcon(element.agent?.metadata);
|
|
759
|
+
} else if (isRequestVM(element)) {
|
|
760
|
+
icon = element.avatarIcon ?? Codicon.account;
|
|
761
|
+
} else {
|
|
762
|
+
icon = Codicon.account;
|
|
763
|
+
}
|
|
711
764
|
if (icon instanceof URI) {
|
|
712
765
|
const avatarIcon = $$1("img.icon");
|
|
713
766
|
avatarIcon.src = ( FileAccess.uriToBrowserUri(icon).toString(true));
|
|
@@ -801,7 +854,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
801
854
|
}
|
|
802
855
|
if (!lastPart || lastPart.kind === "references" || ((lastPart.kind === "toolInvocation" || lastPart.kind === "toolInvocationSerialized") && (IChatToolInvocation.isComplete(lastPart) || lastPart.presentation === "hidden")) || ((lastPart.kind === "textEditGroup" || lastPart.kind === "notebookEditGroup") && lastPart.done && !( partsToRender.some(
|
|
803
856
|
part => part.kind === "toolInvocation" && !IChatToolInvocation.isComplete(part)
|
|
804
|
-
))) || (lastPart.kind === "progressTask" && lastPart.deferred.isSettled) || lastPart.kind === "mcpServersStarting") {
|
|
857
|
+
))) || (lastPart.kind === "progressTask" && lastPart.deferred.isSettled) || lastPart.kind === "mcpServersStarting" || lastPart.kind === "disabledClaudeHooks" || lastPart.kind === "hook") {
|
|
805
858
|
return true;
|
|
806
859
|
}
|
|
807
860
|
return false;
|
|
@@ -821,6 +874,23 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
821
874
|
}
|
|
822
875
|
renderChatRequest(element, index, templateData) {
|
|
823
876
|
templateData.rowContainer.classList.toggle("chat-response-loading", false);
|
|
877
|
+
templateData.rowContainer.classList.toggle("pending-request", !!element.pendingKind);
|
|
878
|
+
if (element.pendingKind && this._pendingDragController) {
|
|
879
|
+
templateData.rowContainer.dataset.pendingRequestId = element.id;
|
|
880
|
+
templateData.rowContainer.dataset.pendingKind = element.pendingKind;
|
|
881
|
+
const sameKindCount = (this.viewModel?.model.getPendingRequests() ?? []).filter(p => p.kind === element.pendingKind).length;
|
|
882
|
+
if (sameKindCount > 1) {
|
|
883
|
+
const handle = $$1(".chat-pending-drag-handle" + ThemeIcon.asCSSSelector(Codicon.gripper));
|
|
884
|
+
templateData.rowContainer.prepend(handle);
|
|
885
|
+
templateData.dragHandle = handle;
|
|
886
|
+
this._pendingDragController.attachDragHandle(
|
|
887
|
+
element,
|
|
888
|
+
handle,
|
|
889
|
+
templateData.rowContainer,
|
|
890
|
+
templateData.elementDisposables
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
824
894
|
if (element.id === this.viewModel?.editing?.id) {
|
|
825
895
|
this._onDidRerender.fire(templateData);
|
|
826
896
|
}
|
|
@@ -1012,7 +1082,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1012
1082
|
}
|
|
1013
1083
|
};
|
|
1014
1084
|
const lastThinking = this.getLastThinkingPart(renderedParts);
|
|
1015
|
-
if (lastThinking && (partToRender.kind === "toolInvocation" || partToRender.kind === "toolInvocationSerialized" || partToRender.kind === "markdownContent" || partToRender.kind === "textEditGroup") && this.shouldPinPart(partToRender, element)) {
|
|
1085
|
+
if (lastThinking && (partToRender.kind === "toolInvocation" || partToRender.kind === "toolInvocationSerialized" || partToRender.kind === "markdownContent" || partToRender.kind === "textEditGroup" || partToRender.kind === "hook") && this.shouldPinPart(partToRender, element)) {
|
|
1016
1086
|
const newPart = this.renderChatContentPart(partToRender, templateData, context);
|
|
1017
1087
|
if (newPart) {
|
|
1018
1088
|
renderedParts[contentIndex] = newPart;
|
|
@@ -1189,6 +1259,12 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1189
1259
|
if (part.kind === "undoStop") {
|
|
1190
1260
|
return true;
|
|
1191
1261
|
}
|
|
1262
|
+
if (part.kind === "hook") {
|
|
1263
|
+
if (part.subAgentInvocationId) {
|
|
1264
|
+
return false;
|
|
1265
|
+
}
|
|
1266
|
+
return part.hookType === HookType.PreToolUse || part.hookType === HookType.PostToolUse;
|
|
1267
|
+
}
|
|
1192
1268
|
if (collapsedToolsMode === CollapsedToolsDisplayMode.Off) {
|
|
1193
1269
|
return false;
|
|
1194
1270
|
}
|
|
@@ -1389,6 +1465,8 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1389
1465
|
content,
|
|
1390
1466
|
this.chatContentMarkdownRenderer
|
|
1391
1467
|
);
|
|
1468
|
+
} else if (content.kind === "hook") {
|
|
1469
|
+
return this.renderHookPart(content, context, templateData);
|
|
1392
1470
|
} else if (content.kind === "markdownContent") {
|
|
1393
1471
|
return this.renderMarkdown(content, templateData, context);
|
|
1394
1472
|
} else if (content.kind === "references") {
|
|
@@ -1413,6 +1491,8 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1413
1491
|
return this.renderChangesSummary(content, context, templateData);
|
|
1414
1492
|
} else if (content.kind === "mcpServersStarting") {
|
|
1415
1493
|
return this.renderMcpServersInteractionRequired(content, context, templateData);
|
|
1494
|
+
} else if (content.kind === "disabledClaudeHooks") {
|
|
1495
|
+
return this.renderDisabledClaudeHooks(content, context);
|
|
1416
1496
|
} else if (content.kind === "thinking") {
|
|
1417
1497
|
return this.renderThinkingPart(content, context, templateData);
|
|
1418
1498
|
} else if (content.kind === "workspaceEdit") {
|
|
@@ -1430,7 +1510,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1430
1510
|
"ChatListItemRenderer#renderChatContentPart: error rendering content",
|
|
1431
1511
|
toErrorMessage(err, true)
|
|
1432
1512
|
);
|
|
1433
|
-
const errorPart = this.instantiationService.createInstance(ChatErrorContentPart, ChatErrorLevel.Error, ( new MarkdownString(( localize(
|
|
1513
|
+
const errorPart = this.instantiationService.createInstance(ChatErrorContentPart, ChatErrorLevel.Error, ( new MarkdownString(( localize(6116, "Failed to render content")) + `: ${toErrorMessage(err, false)}`)), content, this.chatContentMarkdownRenderer);
|
|
1434
1514
|
return {
|
|
1435
1515
|
dispose: () => errorPart.dispose(),
|
|
1436
1516
|
domNode: errorPart.domNode,
|
|
@@ -1685,6 +1765,51 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1685
1765
|
const part = this.instantiationService.createInstance(ChatExtensionsContentPart, extensionsContent);
|
|
1686
1766
|
return part;
|
|
1687
1767
|
}
|
|
1768
|
+
renderHookPart(hookPart, context, templateData) {
|
|
1769
|
+
if (!(hookPart.stopReason || hookPart.systemMessage)) {
|
|
1770
|
+
return this.renderNoContent(other => other.kind === "hook" && other.hookType === hookPart.hookType);
|
|
1771
|
+
}
|
|
1772
|
+
if (hookPart.subAgentInvocationId) {
|
|
1773
|
+
const subagentPart = this.getSubagentPart(templateData.renderedParts, hookPart.subAgentInvocationId);
|
|
1774
|
+
if (subagentPart) {
|
|
1775
|
+
subagentPart.appendHookItem(() => {
|
|
1776
|
+
const part = this.instantiationService.createInstance(ChatHookContentPart, hookPart, context);
|
|
1777
|
+
return {
|
|
1778
|
+
domNode: part.domNode,
|
|
1779
|
+
disposable: part
|
|
1780
|
+
};
|
|
1781
|
+
}, hookPart);
|
|
1782
|
+
return this.renderNoContent(
|
|
1783
|
+
other => other.kind === "hook" && other.hookType === hookPart.hookType && other.subAgentInvocationId === hookPart.subAgentInvocationId
|
|
1784
|
+
);
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
const shouldPinToThinking = hookPart.hookType === HookType.PreToolUse || hookPart.hookType === HookType.PostToolUse;
|
|
1788
|
+
if (shouldPinToThinking) {
|
|
1789
|
+
const hookTitle = hookPart.stopReason ? (hookPart.toolDisplayName ? ( localize(6117, "Blocked {0}", hookPart.toolDisplayName)) : ( localize(6118, "Blocked by hook"))) : (hookPart.toolDisplayName ? ( localize(6119, "Used {0}, but received a warning", hookPart.toolDisplayName)) : ( localize(6120, "Tool call received a warning")));
|
|
1790
|
+
let thinkingPart = this.getLastThinkingPart(templateData.renderedParts);
|
|
1791
|
+
if (!thinkingPart) {
|
|
1792
|
+
const newThinking = this.renderThinkingPart({
|
|
1793
|
+
kind: "thinking"
|
|
1794
|
+
}, context, templateData);
|
|
1795
|
+
if (newThinking instanceof ChatThinkingContentPart) {
|
|
1796
|
+
thinkingPart = newThinking;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
if (thinkingPart) {
|
|
1800
|
+
thinkingPart.appendItem(() => {
|
|
1801
|
+
const part = this.instantiationService.createInstance(ChatHookContentPart, hookPart, context);
|
|
1802
|
+
return {
|
|
1803
|
+
domNode: part.domNode,
|
|
1804
|
+
disposable: part
|
|
1805
|
+
};
|
|
1806
|
+
}, hookTitle, undefined, templateData.value);
|
|
1807
|
+
return thinkingPart;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
const part = this.instantiationService.createInstance(ChatHookContentPart, hookPart, context);
|
|
1811
|
+
return part;
|
|
1812
|
+
}
|
|
1688
1813
|
renderPullRequestContent(pullRequestContent, context, templateData) {
|
|
1689
1814
|
const part = this.instantiationService.createInstance(ChatPullRequestContentPart, pullRequestContent);
|
|
1690
1815
|
return part;
|
|
@@ -1718,20 +1843,43 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1718
1843
|
this.finalizeCurrentThinkingPart(context, templateData);
|
|
1719
1844
|
const widget = isResponseVM(context.element) ? this.chatWidgetService.getWidgetBySessionResource(context.element.sessionResource) : undefined;
|
|
1720
1845
|
const shouldAutoFocus = widget ? widget.getInput() === "" : true;
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1846
|
+
const responseId = isResponseVM(context.element) ? context.element.requestId : undefined;
|
|
1847
|
+
const handleSubmit = async (answers, part) => {
|
|
1848
|
+
const answersRecord = answers ? Object.fromEntries(answers) : undefined;
|
|
1849
|
+
if (answersRecord) {
|
|
1850
|
+
carousel.data = answersRecord;
|
|
1851
|
+
}
|
|
1852
|
+
carousel.isUsed = true;
|
|
1853
|
+
if (isResponseVM(context.element) && carousel.resolveId) {
|
|
1854
|
+
this.chatService.notifyQuestionCarouselAnswer(context.element.requestId, carousel.resolveId, answersRecord);
|
|
1855
|
+
}
|
|
1856
|
+
this.removeCarouselFromTracking(context, part);
|
|
1857
|
+
widget?.input.clearQuestionCarousel();
|
|
1858
|
+
};
|
|
1859
|
+
const responseIsComplete = isResponseVM(context.element) && context.element.isComplete;
|
|
1860
|
+
const inputPartHasCarousel = widget?.input.questionCarousel !== undefined;
|
|
1861
|
+
if (carousel.isUsed || responseIsComplete) {
|
|
1862
|
+
if (responseIsComplete && inputPartHasCarousel && responseId) {
|
|
1863
|
+
widget?.input.clearQuestionCarousel(responseId);
|
|
1733
1864
|
}
|
|
1865
|
+
const part = this.instantiationService.createInstance(ChatQuestionCarouselPart, carousel, context, {
|
|
1866
|
+
shouldAutoFocus: false,
|
|
1867
|
+
onSubmit: async answers => handleSubmit(answers, part)
|
|
1868
|
+
});
|
|
1869
|
+
return part;
|
|
1870
|
+
}
|
|
1871
|
+
const isEditing = !!this.viewModel?.editing;
|
|
1872
|
+
const part = isEditing ? undefined : widget?.input.renderQuestionCarousel(carousel, context, {
|
|
1873
|
+
shouldAutoFocus,
|
|
1874
|
+
onSubmit: async answers => handleSubmit(answers, part)
|
|
1734
1875
|
});
|
|
1876
|
+
if (!part) {
|
|
1877
|
+
const fallbackPart = this.instantiationService.createInstance(ChatQuestionCarouselPart, carousel, context, {
|
|
1878
|
+
shouldAutoFocus,
|
|
1879
|
+
onSubmit: async answers => handleSubmit(answers, fallbackPart)
|
|
1880
|
+
});
|
|
1881
|
+
return fallbackPart;
|
|
1882
|
+
}
|
|
1735
1883
|
if (!carousel.isUsed && this.configService.getValue(ChatConfiguration.GlobalAutoApprove)) {
|
|
1736
1884
|
part.skip();
|
|
1737
1885
|
}
|
|
@@ -1741,12 +1889,26 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1741
1889
|
carousels = ( new Set());
|
|
1742
1890
|
this.pendingQuestionCarousels.set(context.element.sessionResource, carousels);
|
|
1743
1891
|
}
|
|
1744
|
-
carousels.
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1892
|
+
if (!( carousels.has(part))) {
|
|
1893
|
+
carousels.add(part);
|
|
1894
|
+
part.addDisposable({
|
|
1895
|
+
dispose: () => this.removeCarouselFromTracking(context, part)
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1748
1898
|
}
|
|
1749
|
-
return
|
|
1899
|
+
return this.renderNoContent((other, _followingContent, element) => {
|
|
1900
|
+
if (carousel.isUsed || (isResponseVM(element) && element.isComplete)) {
|
|
1901
|
+
return false;
|
|
1902
|
+
}
|
|
1903
|
+
if (other.kind === "questionCarousel") {
|
|
1904
|
+
const otherCarousel = other;
|
|
1905
|
+
if (carousel.resolveId && otherCarousel.resolveId) {
|
|
1906
|
+
return carousel.resolveId === otherCarousel.resolveId;
|
|
1907
|
+
}
|
|
1908
|
+
return other === carousel;
|
|
1909
|
+
}
|
|
1910
|
+
return false;
|
|
1911
|
+
});
|
|
1750
1912
|
}
|
|
1751
1913
|
removeCarouselFromTracking(context, part) {
|
|
1752
1914
|
if (isResponseVM(context.element)) {
|
|
@@ -1829,7 +1991,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1829
1991
|
})
|
|
1830
1992
|
);
|
|
1831
1993
|
markdownPart.addDisposable(
|
|
1832
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), markdownPart.domNode, ( localize(
|
|
1994
|
+
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), markdownPart.domNode, ( localize(6121, "Click to Edit")), {
|
|
1833
1995
|
trapFocus: true
|
|
1834
1996
|
})
|
|
1835
1997
|
);
|
|
@@ -1960,6 +2122,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1960
2122
|
renderMcpServersInteractionRequired(content, context, templateData) {
|
|
1961
2123
|
return this.instantiationService.createInstance(ChatMcpServersInteractionContentPart, content, context);
|
|
1962
2124
|
}
|
|
2125
|
+
renderDisabledClaudeHooks(content, context) {
|
|
2126
|
+
return this.instantiationService.createInstance(ChatDisabledClaudeHooksContentPart, context);
|
|
2127
|
+
}
|
|
1963
2128
|
disposeTemplate(templateData) {
|
|
1964
2129
|
this.clearRenderedParts(templateData);
|
|
1965
2130
|
templateData.templateDisposables.dispose();
|
|
@@ -1988,15 +2153,15 @@ class ChatListDelegate extends CachedListVirtualDelegate {
|
|
|
1988
2153
|
}
|
|
1989
2154
|
}
|
|
1990
2155
|
const voteDownDetailLabels = {
|
|
1991
|
-
[ChatAgentVoteDownReason.IncorrectCode]: ( localize(
|
|
1992
|
-
[ChatAgentVoteDownReason.DidNotFollowInstructions]: ( localize(
|
|
1993
|
-
[ChatAgentVoteDownReason.MissingContext]: ( localize(
|
|
1994
|
-
[ChatAgentVoteDownReason.OffensiveOrUnsafe]: ( localize(
|
|
1995
|
-
[ChatAgentVoteDownReason.PoorlyWrittenOrFormatted]: ( localize(
|
|
1996
|
-
[ChatAgentVoteDownReason.RefusedAValidRequest]: ( localize(
|
|
1997
|
-
[ChatAgentVoteDownReason.IncompleteCode]: ( localize(
|
|
1998
|
-
[ChatAgentVoteDownReason.WillReportIssue]: ( localize(
|
|
1999
|
-
[ChatAgentVoteDownReason.Other]: ( localize(
|
|
2156
|
+
[ChatAgentVoteDownReason.IncorrectCode]: ( localize(6122, "Suggested incorrect code")),
|
|
2157
|
+
[ChatAgentVoteDownReason.DidNotFollowInstructions]: ( localize(6123, "Didn't follow instructions")),
|
|
2158
|
+
[ChatAgentVoteDownReason.MissingContext]: ( localize(6124, "Missing context")),
|
|
2159
|
+
[ChatAgentVoteDownReason.OffensiveOrUnsafe]: ( localize(6125, "Offensive or unsafe")),
|
|
2160
|
+
[ChatAgentVoteDownReason.PoorlyWrittenOrFormatted]: ( localize(6126, "Poorly written or formatted")),
|
|
2161
|
+
[ChatAgentVoteDownReason.RefusedAValidRequest]: ( localize(6127, "Refused a valid request")),
|
|
2162
|
+
[ChatAgentVoteDownReason.IncompleteCode]: ( localize(6128, "Incomplete code")),
|
|
2163
|
+
[ChatAgentVoteDownReason.WillReportIssue]: ( localize(6129, "Report an issue")),
|
|
2164
|
+
[ChatAgentVoteDownReason.Other]: ( localize(6130, "Other"))
|
|
2000
2165
|
};
|
|
2001
2166
|
let ChatVoteDownButton = class ChatVoteDownButton extends DropdownMenuActionViewItem {
|
|
2002
2167
|
constructor(
|
|
@@ -34,6 +34,7 @@ import { ChatAccessibilityProvider } from '../accessibility/chatAccessibilityPro
|
|
|
34
34
|
import { IChatAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
35
35
|
import { ChatListDelegate, ChatListItemRenderer } from './chatListRenderer.js';
|
|
36
36
|
import { ChatEditorOptions } from './chatOptions.js';
|
|
37
|
+
import { ChatPendingDragController } from './chatPendingDragAndDrop.js';
|
|
37
38
|
|
|
38
39
|
let ChatListWidget = class ChatListWidget extends Disposable {
|
|
39
40
|
get onDidClickRequest() {
|
|
@@ -173,6 +174,9 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
173
174
|
this.chatService.resendRequest(request, sendOptions).catch(e => this.logService.error("FAILED to rerun request", e));
|
|
174
175
|
}
|
|
175
176
|
}));
|
|
177
|
+
this._renderer.pendingDragController = this._register(
|
|
178
|
+
scopedInstantiationService.createInstance(ChatPendingDragController, this._container, () => this._viewModel)
|
|
179
|
+
);
|
|
176
180
|
const styles = options.styles ?? {};
|
|
177
181
|
this._tree = this._register(scopedInstantiationService.createInstance(
|
|
178
182
|
WorkbenchObjectTree,
|
|
@@ -311,10 +315,12 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
311
315
|
this._tree.setChildren(null, treeItems, {
|
|
312
316
|
diffIdentityProvider: {
|
|
313
317
|
getId: element => {
|
|
318
|
+
const baseId = (isRequestVM(element) || isResponseVM(element)) ? element.dataId : element.id;
|
|
319
|
+
const disablement = (isRequestVM(element) || isResponseVM(element)) ? element.shouldBeRemovedOnSend : undefined;
|
|
314
320
|
return (
|
|
315
|
-
|
|
321
|
+
baseId +
|
|
316
322
|
`${isResponseVM(element) && element.renderData ? `_${this._visibleChangeCount}` : ""}` + (isResponseVM(element) ? `_${element.contentReferences.length}` : "") +
|
|
317
|
-
`_${
|
|
323
|
+
`_${disablement ? `${disablement.afterUndoStop || "1"}` : "0"}` +
|
|
318
324
|
`_${editing ? "1" : "0"}` +
|
|
319
325
|
`_${checkpoint ? "1" : "0"}` +
|
|
320
326
|
`_setting${this._settingChangeCounter}` + (isRequestVM(element) && element.contentReferences ? `_${element.contentReferences?.length}` : "")
|
|
@@ -467,7 +473,10 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
467
473
|
this._container.style.removeProperty("--chat-current-response-min-height");
|
|
468
474
|
} else {
|
|
469
475
|
const secondToLastItem = this._viewModel?.getItems().at(-2);
|
|
470
|
-
const secondToLastItemHeight = Math.min(
|
|
476
|
+
const secondToLastItemHeight = Math.min(
|
|
477
|
+
(isRequestVM(secondToLastItem) || isResponseVM(secondToLastItem)) ? secondToLastItem.currentRenderedHeight ?? 150 : 150,
|
|
478
|
+
150
|
|
479
|
+
);
|
|
471
480
|
const lastItemMinHeight = Math.max(contentHeight - (secondToLastItemHeight + 10), 0);
|
|
472
481
|
this._container.style.setProperty("--chat-current-response-min-height", lastItemMinHeight + "px");
|
|
473
482
|
if (lastItemMinHeight !== this._previousLastItemMinHeight) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Disposable, DisposableStore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
3
|
+
import { IChatRequestViewModel, IChatViewModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel";
|
|
4
|
+
/**
|
|
5
|
+
* Manages drag-and-drop reordering for pending (steering/queued) chat messages.
|
|
6
|
+
* Attaches drag handles to pending request rows and uses event delegation on
|
|
7
|
+
* the list container to handle drop targets, keeping logic isolated from the
|
|
8
|
+
* renderer itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ChatPendingDragController extends Disposable {
|
|
11
|
+
private readonly _getViewModel;
|
|
12
|
+
private readonly _chatService;
|
|
13
|
+
private _dragState;
|
|
14
|
+
private readonly _insertIndicator;
|
|
15
|
+
constructor(listContainer: HTMLElement, _getViewModel: () => IChatViewModel | undefined, _chatService: IChatService);
|
|
16
|
+
/**
|
|
17
|
+
* Called by the renderer to wire up a drag handle for a pending request row.
|
|
18
|
+
*/
|
|
19
|
+
attachDragHandle(element: IChatRequestViewModel, handleEl: HTMLElement, rowContainer: HTMLElement, disposables: DisposableStore): void;
|
|
20
|
+
private _onDragOver;
|
|
21
|
+
private _onDrop;
|
|
22
|
+
private _onDragEnd;
|
|
23
|
+
private _showIndicator;
|
|
24
|
+
private _hideIndicator;
|
|
25
|
+
private _findDropTarget;
|
|
26
|
+
private _reorder;
|
|
27
|
+
}
|