@codingame/monaco-vscode-katex-common 26.2.2 → 27.0.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/platform/actionWidget/browser/actionWidgetDropdown.d.ts +10 -4
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +35 -11
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +3 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +15 -4
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +548 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +168 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +67 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +42 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +63 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +77 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +381 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +38 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +109 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +28 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +226 -123
- 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/chatAttachmentsContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +7 -10
- 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 +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +22 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +11 -3
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -3
- 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 +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +51 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -7
- 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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +20 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +36 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +166 -45
- 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.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +16 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +98 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +1 -0
- 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.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +241 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +29 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +252 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +39 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +36 -23
- 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.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +42 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +48 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +351 -422
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +14 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +102 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +69 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/codeBlockPart.css +48 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +47 -23
- 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/chatInputOutputMarkdownProgressPart.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +61 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +41 -2
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +2 -1
- 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 +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +310 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +441 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +392 -86
- 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 +52 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +271 -187
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +668 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +57 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +78 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +86 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +393 -134
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +36 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +20 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +141 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +18 -13
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +108 -27
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +20 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +74 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +11 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +68 -27
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +125 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +8 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +54 -45
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +172 -112
- 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/browser/media/inlineChat.css +0 -42
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +27 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +83 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -33
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +1 -548
- 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
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +0 -187
- /package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocolApps.js +0 -0
|
@@ -3,12 +3,12 @@ import { IChatPullRequestContent } from "@codingame/monaco-vscode-api/vscode/vs/
|
|
|
3
3
|
import { IChatRendererContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel";
|
|
4
4
|
import { ChatTreeItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
5
5
|
import { IChatContentPart } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts";
|
|
6
|
-
import {
|
|
6
|
+
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
7
7
|
export declare class ChatPullRequestContentPart extends Disposable implements IChatContentPart {
|
|
8
8
|
private readonly pullRequestContent;
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly commandService;
|
|
10
10
|
readonly domNode: HTMLElement;
|
|
11
|
-
constructor(pullRequestContent: IChatPullRequestContent,
|
|
11
|
+
constructor(pullRequestContent: IChatPullRequestContent, commandService: ICommandService);
|
|
12
12
|
hasSameContent(other: IChatRendererContent, followingContent: IChatRendererContent[], element: ChatTreeItem): boolean;
|
|
13
13
|
addDisposable(disposable: IDisposable): void;
|
|
14
14
|
}
|
|
@@ -6,14 +6,14 @@ import { $, append, addDisposableListener } from '@codingame/monaco-vscode-api/v
|
|
|
6
6
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
7
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
8
8
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
9
|
-
import {
|
|
9
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
10
10
|
|
|
11
11
|
registerCss(chatPullRequestContent);
|
|
12
12
|
let ChatPullRequestContentPart = class ChatPullRequestContentPart extends Disposable {
|
|
13
|
-
constructor(pullRequestContent,
|
|
13
|
+
constructor(pullRequestContent, commandService) {
|
|
14
14
|
super();
|
|
15
15
|
this.pullRequestContent = pullRequestContent;
|
|
16
|
-
this.
|
|
16
|
+
this.commandService = commandService;
|
|
17
17
|
this.domNode = $(".chat-pull-request-content-part");
|
|
18
18
|
const container = append(this.domNode, $(".container"));
|
|
19
19
|
const contentContainer = append(container, $(".content-container"));
|
|
@@ -22,11 +22,16 @@ let ChatPullRequestContentPart = class ChatPullRequestContentPart extends Dispos
|
|
|
22
22
|
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.gitPullRequest));
|
|
23
23
|
const titleLink = append(titleContainer, $("a.title"));
|
|
24
24
|
titleLink.textContent = `${this.pullRequestContent.title} - ${this.pullRequestContent.author}`;
|
|
25
|
-
|
|
25
|
+
if (this.pullRequestContent.uri) {
|
|
26
|
+
titleLink.href = this.pullRequestContent.uri?.toString();
|
|
27
|
+
}
|
|
26
28
|
this._register(addDisposableListener(titleLink, "click", e => {
|
|
27
29
|
e.preventDefault();
|
|
28
30
|
e.stopPropagation();
|
|
29
|
-
this.
|
|
31
|
+
this.commandService.executeCommand(
|
|
32
|
+
this.pullRequestContent.command.id,
|
|
33
|
+
...(this.pullRequestContent.command.arguments ?? [])
|
|
34
|
+
);
|
|
30
35
|
}));
|
|
31
36
|
}
|
|
32
37
|
hasSameContent(other, followingContent, element) {
|
|
@@ -36,6 +41,6 @@ let ChatPullRequestContentPart = class ChatPullRequestContentPart extends Dispos
|
|
|
36
41
|
this._register(disposable);
|
|
37
42
|
}
|
|
38
43
|
};
|
|
39
|
-
ChatPullRequestContentPart = ( __decorate([( __param(1,
|
|
44
|
+
ChatPullRequestContentPart = ( __decorate([( __param(1, ICommandService))], ChatPullRequestContentPart));
|
|
40
45
|
|
|
41
46
|
export { ChatPullRequestContentPart };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
2
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service";
|
|
4
|
+
import { IMarkdownRendererService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service";
|
|
3
5
|
import { IChatQuestionCarousel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
4
6
|
import { IChatContentPart, IChatContentPartRenderContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts";
|
|
5
7
|
import { IChatRendererContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel";
|
|
6
8
|
import { ChatTreeItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
7
9
|
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
10
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
11
|
+
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
8
12
|
export interface IChatQuestionCarouselOptions {
|
|
9
13
|
onSubmit: (answers: Map<string, unknown> | undefined) => void;
|
|
10
14
|
shouldAutoFocus?: boolean;
|
|
@@ -12,7 +16,11 @@ export interface IChatQuestionCarouselOptions {
|
|
|
12
16
|
export declare class ChatQuestionCarouselPart extends Disposable implements IChatContentPart {
|
|
13
17
|
readonly carousel: IChatQuestionCarousel;
|
|
14
18
|
private readonly _options;
|
|
19
|
+
private readonly _markdownRendererService;
|
|
15
20
|
private readonly _hoverService;
|
|
21
|
+
private readonly _accessibilityService;
|
|
22
|
+
private readonly _contextKeyService;
|
|
23
|
+
private readonly _keybindingService;
|
|
16
24
|
readonly domNode: HTMLElement;
|
|
17
25
|
private readonly _onDidChangeHeight;
|
|
18
26
|
readonly onDidChangeHeight: Event<void>;
|
|
@@ -33,12 +41,14 @@ export declare class ChatQuestionCarouselPart extends Disposable implements ICha
|
|
|
33
41
|
private readonly _multiSelectCheckboxes;
|
|
34
42
|
private readonly _freeformTextareas;
|
|
35
43
|
private readonly _inputBoxes;
|
|
44
|
+
private readonly _questionRenderStore;
|
|
36
45
|
/**
|
|
37
46
|
* Disposable store for interactive UI components (header, nav buttons, etc.)
|
|
38
47
|
* that should be disposed when transitioning to summary view.
|
|
39
48
|
*/
|
|
40
49
|
private readonly _interactiveUIStore;
|
|
41
|
-
|
|
50
|
+
private readonly _inChatQuestionCarouselContextKey;
|
|
51
|
+
constructor(carousel: IChatQuestionCarousel, context: IChatContentPartRenderContext, _options: IChatQuestionCarouselOptions, _markdownRendererService: IMarkdownRendererService, _hoverService: IHoverService, _accessibilityService: IAccessibilityService, _contextKeyService: IContextKeyService, _keybindingService: IKeybindingService);
|
|
42
52
|
/**
|
|
43
53
|
* Saves the current question's answer to the answers map.
|
|
44
54
|
*/
|
|
@@ -53,6 +63,10 @@ export declare class ChatQuestionCarouselPart extends Disposable implements ICha
|
|
|
53
63
|
* Either advances to the next question or submits.
|
|
54
64
|
*/
|
|
55
65
|
private handleNext;
|
|
66
|
+
/**
|
|
67
|
+
* Focuses the container element and announces the question for screen reader users.
|
|
68
|
+
*/
|
|
69
|
+
private _focusContainerAndAnnounce;
|
|
56
70
|
/**
|
|
57
71
|
* Hides the carousel UI and shows a summary of answers.
|
|
58
72
|
*/
|
|
@@ -80,7 +94,27 @@ export declare class ChatQuestionCarouselPart extends Disposable implements ICha
|
|
|
80
94
|
* Gets the default answer for a specific question.
|
|
81
95
|
*/
|
|
82
96
|
private getDefaultAnswerForQuestion;
|
|
97
|
+
/**
|
|
98
|
+
* Returns whether auto-focus should be enabled.
|
|
99
|
+
* Disabled when screen reader mode is active or when explicitly disabled via options.
|
|
100
|
+
*/
|
|
101
|
+
private _shouldAutoFocus;
|
|
102
|
+
/**
|
|
103
|
+
* Updates the aria-label of the carousel container based on the current question.
|
|
104
|
+
*/
|
|
105
|
+
private _updateAriaLabel;
|
|
106
|
+
/**
|
|
107
|
+
* Focuses the carousel container element.
|
|
108
|
+
*/
|
|
109
|
+
focus(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Returns whether the carousel container has focus.
|
|
112
|
+
*/
|
|
113
|
+
hasFocus(): boolean;
|
|
114
|
+
navigateToPreviousQuestion(): boolean;
|
|
115
|
+
navigateToNextQuestion(): boolean;
|
|
83
116
|
private renderCurrentQuestion;
|
|
117
|
+
private getLabelWithKeybinding;
|
|
84
118
|
private renderInput;
|
|
85
119
|
/**
|
|
86
120
|
* Sets up auto-resize behavior for a textarea element.
|
|
@@ -103,6 +137,7 @@ export declare class ChatQuestionCarouselPart extends Disposable implements ICha
|
|
|
103
137
|
* Formats an answer for display in the summary.
|
|
104
138
|
*/
|
|
105
139
|
private formatAnswerForSummary;
|
|
140
|
+
private getQuestionText;
|
|
106
141
|
hasSameContent(other: IChatRendererContent, _followingContent: IChatRendererContent[], element: ChatTreeItem): boolean;
|
|
107
142
|
addDisposable(disposable: {
|
|
108
143
|
dispose(): void;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
3
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
-
import { $, addDisposableListener, EventType, clearNode, runAtThisOrScheduleAtNextAnimationFrame, getWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
+
import { $, trackFocus, addDisposableListener, EventType, clearNode, isAncestorOfActiveElement, runAtThisOrScheduleAtNextAnimationFrame, getWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
|
+
import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
5
6
|
import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
|
|
6
7
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
8
|
+
import { isMarkdownString, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
7
9
|
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
8
10
|
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
9
11
|
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
10
12
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
13
|
+
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
14
|
+
import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service';
|
|
11
15
|
import { defaultButtonStyles, defaultInputBoxStyles, defaultCheckboxStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
12
16
|
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
13
17
|
import { InputBox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/inputbox/inputBox';
|
|
@@ -16,15 +20,33 @@ import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
16
20
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
17
21
|
import { HoverPosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
18
22
|
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
23
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
24
|
+
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
25
|
+
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
19
26
|
import * as chatQuestionCarousel from './media/chatQuestionCarousel.css';
|
|
20
27
|
|
|
21
28
|
registerCss(chatQuestionCarousel);
|
|
29
|
+
const PREVIOUS_QUESTION_ACTION_ID = "workbench.action.chat.previousQuestion";
|
|
30
|
+
const NEXT_QUESTION_ACTION_ID = "workbench.action.chat.nextQuestion";
|
|
22
31
|
let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable {
|
|
23
|
-
constructor(
|
|
32
|
+
constructor(
|
|
33
|
+
carousel,
|
|
34
|
+
context,
|
|
35
|
+
_options,
|
|
36
|
+
_markdownRendererService,
|
|
37
|
+
_hoverService,
|
|
38
|
+
_accessibilityService,
|
|
39
|
+
_contextKeyService,
|
|
40
|
+
_keybindingService
|
|
41
|
+
) {
|
|
24
42
|
super();
|
|
25
43
|
this.carousel = carousel;
|
|
26
44
|
this._options = _options;
|
|
45
|
+
this._markdownRendererService = _markdownRendererService;
|
|
27
46
|
this._hoverService = _hoverService;
|
|
47
|
+
this._accessibilityService = _accessibilityService;
|
|
48
|
+
this._contextKeyService = _contextKeyService;
|
|
49
|
+
this._keybindingService = _keybindingService;
|
|
28
50
|
this._onDidChangeHeight = this._register(( new Emitter()));
|
|
29
51
|
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
30
52
|
this._currentIndex = 0;
|
|
@@ -36,8 +58,24 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
36
58
|
this._multiSelectCheckboxes = ( new Map());
|
|
37
59
|
this._freeformTextareas = ( new Map());
|
|
38
60
|
this._inputBoxes = this._register(( new DisposableStore()));
|
|
61
|
+
this._questionRenderStore = this._register(( new MutableDisposable()));
|
|
39
62
|
this._interactiveUIStore = this._register(( new MutableDisposable()));
|
|
40
63
|
this.domNode = $(".chat-question-carousel-container");
|
|
64
|
+
this._inChatQuestionCarouselContextKey = ChatContextKeys.inChatQuestionCarousel.bindTo(this._contextKeyService);
|
|
65
|
+
const focusTracker = this._register(trackFocus(this.domNode));
|
|
66
|
+
this._register(
|
|
67
|
+
focusTracker.onDidFocus(() => this._inChatQuestionCarouselContextKey.set(true))
|
|
68
|
+
);
|
|
69
|
+
this._register(
|
|
70
|
+
focusTracker.onDidBlur(() => this._inChatQuestionCarouselContextKey.set(false))
|
|
71
|
+
);
|
|
72
|
+
this._register({
|
|
73
|
+
dispose: () => this._inChatQuestionCarouselContextKey.reset()
|
|
74
|
+
});
|
|
75
|
+
this.domNode.tabIndex = 0;
|
|
76
|
+
this.domNode.setAttribute("role", "region");
|
|
77
|
+
this.domNode.setAttribute("aria-roledescription", ( localize(6452, "chat question")));
|
|
78
|
+
this._updateAriaLabel();
|
|
41
79
|
if (carousel.data) {
|
|
42
80
|
for (const [key, value] of Object.entries(carousel.data)) {
|
|
43
81
|
this._answers.set(key, value);
|
|
@@ -56,7 +94,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
56
94
|
this.domNode.append(this._questionContainer);
|
|
57
95
|
if (carousel.allowSkip) {
|
|
58
96
|
this._closeButtonContainer = $(".chat-question-close-container");
|
|
59
|
-
const skipAllTitle = ( localize(
|
|
97
|
+
const skipAllTitle = ( localize(6453, "Skip all questions"));
|
|
60
98
|
const skipAllButton = interactiveStore.add(( new Button(this._closeButtonContainer, {
|
|
61
99
|
...defaultButtonStyles,
|
|
62
100
|
secondary: true,
|
|
@@ -75,9 +113,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
75
113
|
this._footerRow.appendChild(this._stepIndicator);
|
|
76
114
|
this._navigationButtons = $(".chat-question-carousel-nav");
|
|
77
115
|
this._navigationButtons.setAttribute("role", "navigation");
|
|
78
|
-
this._navigationButtons.setAttribute("aria-label", ( localize(
|
|
116
|
+
this._navigationButtons.setAttribute("aria-label", ( localize(6454, "Question navigation")));
|
|
79
117
|
const arrowsContainer = $(".chat-question-nav-arrows");
|
|
80
|
-
const previousLabel = ( localize(
|
|
118
|
+
const previousLabel = ( localize(6455, "Previous"));
|
|
119
|
+
const previousLabelWithKeybinding = this.getLabelWithKeybinding(previousLabel, PREVIOUS_QUESTION_ACTION_ID);
|
|
81
120
|
const prevButton = interactiveStore.add(( new Button(arrowsContainer, {
|
|
82
121
|
...defaultButtonStyles,
|
|
83
122
|
secondary: true,
|
|
@@ -85,9 +124,9 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
85
124
|
})));
|
|
86
125
|
prevButton.element.classList.add("chat-question-nav-arrow", "chat-question-nav-prev");
|
|
87
126
|
prevButton.label = `$(${Codicon.chevronLeft.id})`;
|
|
88
|
-
prevButton.element.setAttribute("aria-label",
|
|
127
|
+
prevButton.element.setAttribute("aria-label", previousLabelWithKeybinding);
|
|
89
128
|
interactiveStore.add(this._hoverService.setupDelayedHover(prevButton.element, {
|
|
90
|
-
content:
|
|
129
|
+
content: previousLabelWithKeybinding
|
|
91
130
|
}));
|
|
92
131
|
this._prevButton = prevButton;
|
|
93
132
|
const nextButton = interactiveStore.add(( new Button(arrowsContainer, {
|
|
@@ -139,19 +178,36 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
139
178
|
if (newIndex >= 0 && newIndex < this.carousel.questions.length) {
|
|
140
179
|
this.saveCurrentAnswer();
|
|
141
180
|
this._currentIndex = newIndex;
|
|
142
|
-
this.renderCurrentQuestion();
|
|
181
|
+
this.renderCurrentQuestion(true);
|
|
143
182
|
}
|
|
144
183
|
}
|
|
145
184
|
handleNext() {
|
|
146
185
|
this.saveCurrentAnswer();
|
|
147
186
|
if (this._currentIndex < this.carousel.questions.length - 1) {
|
|
148
187
|
this._currentIndex++;
|
|
149
|
-
this.renderCurrentQuestion();
|
|
188
|
+
this.renderCurrentQuestion(true);
|
|
150
189
|
} else {
|
|
151
190
|
this._options.onSubmit(this._answers);
|
|
152
191
|
this.hideAndShowSummary();
|
|
153
192
|
}
|
|
154
193
|
}
|
|
194
|
+
_focusContainerAndAnnounce() {
|
|
195
|
+
this.domNode.focus();
|
|
196
|
+
const question = this.carousel.questions[this._currentIndex];
|
|
197
|
+
if (question) {
|
|
198
|
+
const questionText = question.message ?? question.title;
|
|
199
|
+
const messageContent = this.getQuestionText(questionText);
|
|
200
|
+
const questionCount = this.carousel.questions.length;
|
|
201
|
+
const alertMessage = questionCount === 1 ? messageContent : ( localize(
|
|
202
|
+
6456,
|
|
203
|
+
"Question {0} of {1}: {2}",
|
|
204
|
+
this._currentIndex + 1,
|
|
205
|
+
questionCount,
|
|
206
|
+
messageContent
|
|
207
|
+
));
|
|
208
|
+
this._accessibilityService.alert(alertMessage);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
155
211
|
hideAndShowSummary() {
|
|
156
212
|
this._isSkipped = true;
|
|
157
213
|
this.domNode.classList.add("chat-question-carousel-used");
|
|
@@ -162,6 +218,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
162
218
|
}
|
|
163
219
|
clearInteractiveResources() {
|
|
164
220
|
this._interactiveUIStore.clear();
|
|
221
|
+
this._questionRenderStore.clear();
|
|
165
222
|
this._inputBoxes.clear();
|
|
166
223
|
this._textInputBoxes.clear();
|
|
167
224
|
this._singleSelectItems.clear();
|
|
@@ -239,10 +296,59 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
239
296
|
return question.defaultValue;
|
|
240
297
|
}
|
|
241
298
|
}
|
|
242
|
-
|
|
299
|
+
_shouldAutoFocus() {
|
|
300
|
+
if (this._options.shouldAutoFocus === false) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
return !this._accessibilityService.isScreenReaderOptimized();
|
|
304
|
+
}
|
|
305
|
+
_updateAriaLabel() {
|
|
306
|
+
const question = this.carousel.questions[this._currentIndex];
|
|
307
|
+
if (!question) {
|
|
308
|
+
this.domNode.setAttribute("aria-label", ( localize(6457, "Chat question")));
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const questionText = question.message ?? question.title;
|
|
312
|
+
const messageContent = this.getQuestionText(questionText);
|
|
313
|
+
const questionCount = this.carousel.questions.length;
|
|
314
|
+
if (questionCount === 1) {
|
|
315
|
+
this.domNode.setAttribute("aria-label", ( localize(6458, "Chat question: {0}", messageContent)));
|
|
316
|
+
} else {
|
|
317
|
+
this.domNode.setAttribute("aria-label", ( localize(
|
|
318
|
+
6459,
|
|
319
|
+
"Chat question {0} of {1}: {2}",
|
|
320
|
+
this._currentIndex + 1,
|
|
321
|
+
questionCount,
|
|
322
|
+
messageContent
|
|
323
|
+
)));
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
focus() {
|
|
327
|
+
this.domNode.focus();
|
|
328
|
+
}
|
|
329
|
+
hasFocus() {
|
|
330
|
+
return isAncestorOfActiveElement(this.domNode);
|
|
331
|
+
}
|
|
332
|
+
navigateToPreviousQuestion() {
|
|
333
|
+
if (this._currentIndex <= 0) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
this.navigate(-1);
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
navigateToNextQuestion() {
|
|
340
|
+
if (this._currentIndex >= this.carousel.questions.length - 1) {
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
this.navigate(1);
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
346
|
+
renderCurrentQuestion(focusContainerForScreenReader = false) {
|
|
243
347
|
if (!this._questionContainer || !this._prevButton || !this._nextButton) {
|
|
244
348
|
return;
|
|
245
349
|
}
|
|
350
|
+
const questionRenderStore = ( new DisposableStore());
|
|
351
|
+
this._questionRenderStore.value = questionRenderStore;
|
|
246
352
|
this._inputBoxes.clear();
|
|
247
353
|
this._textInputBoxes.clear();
|
|
248
354
|
this._singleSelectItems.clear();
|
|
@@ -257,18 +363,24 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
257
363
|
const questionText = question.message ?? question.title;
|
|
258
364
|
if (questionText) {
|
|
259
365
|
const title = $(".chat-question-title");
|
|
260
|
-
const messageContent =
|
|
366
|
+
const messageContent = this.getQuestionText(questionText);
|
|
261
367
|
title.setAttribute("aria-label", messageContent);
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
title.appendChild(mainTitle);
|
|
267
|
-
const subtitle = $("span.chat-question-title-subtitle");
|
|
268
|
-
subtitle.textContent = " " + parenMatch[2];
|
|
269
|
-
title.appendChild(subtitle);
|
|
368
|
+
if (question.message !== undefined) {
|
|
369
|
+
const messageMd = isMarkdownString(questionText) ? MarkdownString.lift(questionText) : ( new MarkdownString(questionText));
|
|
370
|
+
const renderedTitle = questionRenderStore.add(this._markdownRendererService.render(messageMd));
|
|
371
|
+
title.appendChild(renderedTitle.element);
|
|
270
372
|
} else {
|
|
271
|
-
|
|
373
|
+
const parenMatch = messageContent.match(/^(.+?)\s*(\([^)]+\))\s*$/);
|
|
374
|
+
if (parenMatch) {
|
|
375
|
+
const mainTitle = $("span.chat-question-title-main");
|
|
376
|
+
mainTitle.textContent = parenMatch[1];
|
|
377
|
+
title.appendChild(mainTitle);
|
|
378
|
+
const subtitle = $("span.chat-question-title-subtitle");
|
|
379
|
+
subtitle.textContent = " " + parenMatch[2];
|
|
380
|
+
title.appendChild(subtitle);
|
|
381
|
+
} else {
|
|
382
|
+
title.textContent = messageContent;
|
|
383
|
+
}
|
|
272
384
|
}
|
|
273
385
|
headerRow.appendChild(title);
|
|
274
386
|
}
|
|
@@ -287,8 +399,9 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
287
399
|
this._prevButton.enabled = this._currentIndex > 0;
|
|
288
400
|
this._prevButton.element.style.display = isSingleQuestion ? "none" : "";
|
|
289
401
|
const isLastQuestion = this._currentIndex === this.carousel.questions.length - 1;
|
|
290
|
-
const submitLabel = ( localize(
|
|
291
|
-
const nextLabel = ( localize(
|
|
402
|
+
const submitLabel = ( localize(6460, "Submit"));
|
|
403
|
+
const nextLabel = ( localize(6461, "Next"));
|
|
404
|
+
const nextLabelWithKeybinding = this.getLabelWithKeybinding(nextLabel, NEXT_QUESTION_ACTION_ID);
|
|
292
405
|
if (isLastQuestion) {
|
|
293
406
|
this._nextButton.label = submitLabel;
|
|
294
407
|
this._nextButton.element.setAttribute("aria-label", submitLabel);
|
|
@@ -298,14 +411,22 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
298
411
|
});
|
|
299
412
|
} else {
|
|
300
413
|
this._nextButton.label = `$(${Codicon.chevronRight.id})`;
|
|
301
|
-
this._nextButton.element.setAttribute("aria-label",
|
|
414
|
+
this._nextButton.element.setAttribute("aria-label", nextLabelWithKeybinding);
|
|
302
415
|
this._nextButton.element.classList.remove("chat-question-nav-submit");
|
|
303
416
|
this._nextButtonHover.value = this._hoverService.setupDelayedHover(this._nextButton.element, {
|
|
304
|
-
content:
|
|
417
|
+
content: nextLabelWithKeybinding
|
|
305
418
|
});
|
|
306
419
|
}
|
|
420
|
+
this._updateAriaLabel();
|
|
421
|
+
if (focusContainerForScreenReader && this._accessibilityService.isScreenReaderOptimized()) {
|
|
422
|
+
this._focusContainerAndAnnounce();
|
|
423
|
+
}
|
|
307
424
|
this._onDidChangeHeight.fire();
|
|
308
425
|
}
|
|
426
|
+
getLabelWithKeybinding(label, actionId) {
|
|
427
|
+
const keybindingLabel = this._keybindingService.lookupKeybinding(actionId, this._contextKeyService)?.getLabel();
|
|
428
|
+
return keybindingLabel ? ( localize(6462, "{0} ({1})", label, keybindingLabel)) : label;
|
|
429
|
+
}
|
|
309
430
|
renderInput(container, question) {
|
|
310
431
|
switch (question.type) {
|
|
311
432
|
case "text":
|
|
@@ -330,7 +451,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
330
451
|
}
|
|
331
452
|
renderTextInput(container, question) {
|
|
332
453
|
const inputBox = this._inputBoxes.add(( new InputBox(container, undefined, {
|
|
333
|
-
placeholder: ( localize(
|
|
454
|
+
placeholder: ( localize(6463, "Enter your answer")),
|
|
334
455
|
inputBoxStyles: defaultInputBoxStyles
|
|
335
456
|
})));
|
|
336
457
|
const previousAnswer = this._answers.get(question.id);
|
|
@@ -340,7 +461,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
340
461
|
inputBox.value = String(question.defaultValue);
|
|
341
462
|
}
|
|
342
463
|
this._textInputBoxes.set(question.id, inputBox);
|
|
343
|
-
if (this.
|
|
464
|
+
if (this._shouldAutoFocus()) {
|
|
344
465
|
this._inputBoxes.add(
|
|
345
466
|
runAtThisOrScheduleAtNextAnimationFrame(getWindow(inputBox.element), () => inputBox.focus())
|
|
346
467
|
);
|
|
@@ -393,7 +514,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
393
514
|
const listItem = $(".chat-question-list-item");
|
|
394
515
|
listItem.setAttribute("role", "option");
|
|
395
516
|
listItem.setAttribute("aria-selected", String(isSelected));
|
|
396
|
-
listItem.setAttribute("aria-label", ( localize(
|
|
517
|
+
listItem.setAttribute("aria-label", ( localize(6464, "Option {0}: {1}", index + 1, option.label)));
|
|
397
518
|
listItem.id = `option-${question.id}-${index}`;
|
|
398
519
|
listItem.tabIndex = -1;
|
|
399
520
|
const number = $(".chat-question-list-number");
|
|
@@ -455,7 +576,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
455
576
|
freeformNumber.textContent = `${options.length + 1}`;
|
|
456
577
|
freeformContainer.appendChild(freeformNumber);
|
|
457
578
|
const freeformTextarea = $("textarea.chat-question-freeform-textarea");
|
|
458
|
-
freeformTextarea.placeholder = ( localize(
|
|
579
|
+
freeformTextarea.placeholder = ( localize(6465, "Enter custom answer"));
|
|
459
580
|
freeformTextarea.rows = 1;
|
|
460
581
|
if (previousFreeform !== undefined) {
|
|
461
582
|
freeformTextarea.value = previousFreeform;
|
|
@@ -508,7 +629,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
508
629
|
runAtThisOrScheduleAtNextAnimationFrame(getWindow(freeformTextarea), () => autoResize())
|
|
509
630
|
);
|
|
510
631
|
}
|
|
511
|
-
if (this.
|
|
632
|
+
if (this._shouldAutoFocus()) {
|
|
512
633
|
if (previousFreeform) {
|
|
513
634
|
this._inputBoxes.add(
|
|
514
635
|
runAtThisOrScheduleAtNextAnimationFrame(getWindow(freeformTextarea), () => {
|
|
@@ -558,7 +679,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
558
679
|
const listItem = $(".chat-question-list-item.multi-select");
|
|
559
680
|
listItem.setAttribute("role", "option");
|
|
560
681
|
listItem.setAttribute("aria-selected", String(isChecked));
|
|
561
|
-
listItem.setAttribute("aria-label", ( localize(
|
|
682
|
+
listItem.setAttribute("aria-label", ( localize(6464, "Option {0}: {1}", index + 1, option.label)));
|
|
562
683
|
listItem.id = `option-${question.id}-${index}`;
|
|
563
684
|
listItem.tabIndex = -1;
|
|
564
685
|
const number = $(".chat-question-list-number");
|
|
@@ -616,7 +737,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
616
737
|
freeformNumber.textContent = `${options.length + 1}`;
|
|
617
738
|
freeformContainer.appendChild(freeformNumber);
|
|
618
739
|
const freeformTextarea = $("textarea.chat-question-freeform-textarea");
|
|
619
|
-
freeformTextarea.placeholder = ( localize(
|
|
740
|
+
freeformTextarea.placeholder = ( localize(6465, "Enter custom answer"));
|
|
620
741
|
freeformTextarea.rows = 1;
|
|
621
742
|
if (previousFreeform !== undefined) {
|
|
622
743
|
freeformTextarea.value = previousFreeform;
|
|
@@ -663,7 +784,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
663
784
|
runAtThisOrScheduleAtNextAnimationFrame(getWindow(freeformTextarea), () => autoResize())
|
|
664
785
|
);
|
|
665
786
|
}
|
|
666
|
-
if (this.
|
|
787
|
+
if (this._shouldAutoFocus()) {
|
|
667
788
|
if (previousFreeform) {
|
|
668
789
|
this._inputBoxes.add(
|
|
669
790
|
runAtThisOrScheduleAtNextAnimationFrame(getWindow(freeformTextarea), () => {
|
|
@@ -735,15 +856,9 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
735
856
|
}
|
|
736
857
|
const freeformTextarea = this._freeformTextareas.get(question.id);
|
|
737
858
|
const freeformValue = freeformTextarea?.value !== "" ? freeformTextarea?.value : undefined;
|
|
738
|
-
|
|
739
|
-
if (selectedValues.length === 0 && !freeformValue && question.defaultValue !== undefined) {
|
|
740
|
-
const defaultIds = Array.isArray(question.defaultValue) ? question.defaultValue : [question.defaultValue];
|
|
741
|
-
const defaultValues = question.options?.filter(opt => defaultIds.includes(opt.id)).map(opt => opt.value);
|
|
742
|
-
finalSelectedValues = defaultValues?.filter(v => v !== undefined) || [];
|
|
743
|
-
}
|
|
744
|
-
if (freeformValue || finalSelectedValues.length > 0) {
|
|
859
|
+
if (freeformValue || selectedValues.length > 0) {
|
|
745
860
|
return {
|
|
746
|
-
selectedValues
|
|
861
|
+
selectedValues,
|
|
747
862
|
freeformValue
|
|
748
863
|
};
|
|
749
864
|
}
|
|
@@ -756,13 +871,15 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
756
871
|
renderSkippedMessage() {
|
|
757
872
|
const skippedContainer = $(".chat-question-carousel-summary");
|
|
758
873
|
const skippedMessage = $(".chat-question-summary-skipped");
|
|
759
|
-
skippedMessage.textContent = ( localize(
|
|
874
|
+
skippedMessage.textContent = ( localize(6466, "Skipped"));
|
|
760
875
|
skippedContainer.appendChild(skippedMessage);
|
|
761
876
|
this.domNode.appendChild(skippedContainer);
|
|
762
877
|
}
|
|
763
878
|
renderSummary() {
|
|
764
879
|
if (this._answers.size === 0) {
|
|
765
|
-
this.
|
|
880
|
+
if (this.carousel.isUsed) {
|
|
881
|
+
this.renderSkippedMessage();
|
|
882
|
+
}
|
|
766
883
|
return;
|
|
767
884
|
}
|
|
768
885
|
const summaryContainer = $(".chat-question-carousel-summary");
|
|
@@ -831,10 +948,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
831
948
|
if (freeformValue) {
|
|
832
949
|
labels.push(freeformValue);
|
|
833
950
|
}
|
|
834
|
-
return labels.join(( localize(
|
|
951
|
+
return labels.join(( localize(6467, ", ")));
|
|
835
952
|
}
|
|
836
953
|
if (Array.isArray(answer)) {
|
|
837
|
-
return ( answer.map(v => question.options?.find(opt => opt.value === v)?.label ?? String(v))).join(( localize(
|
|
954
|
+
return ( answer.map(v => question.options?.find(opt => opt.value === v)?.label ?? String(v))).join(( localize(6467, ", ")));
|
|
838
955
|
}
|
|
839
956
|
return String(answer);
|
|
840
957
|
}
|
|
@@ -842,6 +959,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
842
959
|
return String(answer);
|
|
843
960
|
}
|
|
844
961
|
}
|
|
962
|
+
getQuestionText(questionText) {
|
|
963
|
+
const md = typeof questionText === "string" ? ( new MarkdownString(questionText)) : questionText;
|
|
964
|
+
return renderAsPlaintext(md);
|
|
965
|
+
}
|
|
845
966
|
hasSameContent(other, _followingContent, element) {
|
|
846
967
|
if (!this._isSkipped && !this.carousel.isUsed && isResponseVM(element) && element.isComplete) {
|
|
847
968
|
return false;
|
|
@@ -852,6 +973,6 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
852
973
|
this._register(disposable);
|
|
853
974
|
}
|
|
854
975
|
};
|
|
855
|
-
ChatQuestionCarouselPart = ( __decorate([( __param(3, IHoverService))], ChatQuestionCarouselPart));
|
|
976
|
+
ChatQuestionCarouselPart = ( __decorate([( __param(3, IMarkdownRendererService)), ( __param(4, IHoverService)), ( __param(5, IAccessibilityService)), ( __param(6, IContextKeyService)), ( __param(7, IKeybindingService))], ChatQuestionCarouselPart));
|
|
856
977
|
|
|
857
978
|
export { ChatQuestionCarouselPart };
|
|
@@ -53,10 +53,10 @@ let ChatQuotaExceededPart = class ChatQuotaExceededPart extends Disposable {
|
|
|
53
53
|
switch (chatEntitlementService.entitlement) {
|
|
54
54
|
case ChatEntitlement.Pro:
|
|
55
55
|
case ChatEntitlement.ProPlus:
|
|
56
|
-
primaryButtonLabel = ( localize(
|
|
56
|
+
primaryButtonLabel = ( localize(6468, "Manage Paid Premium Requests"));
|
|
57
57
|
break;
|
|
58
58
|
case ChatEntitlement.Free:
|
|
59
|
-
primaryButtonLabel = ( localize(
|
|
59
|
+
primaryButtonLabel = ( localize(6469, "Upgrade to GitHub Copilot Pro"));
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
let hasAddedWaitWarning = false;
|
|
@@ -65,7 +65,7 @@ let ChatQuotaExceededPart = class ChatQuotaExceededPart extends Disposable {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
hasAddedWaitWarning = true;
|
|
68
|
-
append(messageContainer, $(".chat-quota-wait-warning", undefined, ( localize(
|
|
68
|
+
append(messageContainer, $(".chat-quota-wait-warning", undefined, ( localize(6470, "Changes may take a few minutes to take effect."))));
|
|
69
69
|
};
|
|
70
70
|
let hasAddedRetryButton = false;
|
|
71
71
|
const addRetryButtonIfNeeded = () => {
|
|
@@ -78,7 +78,7 @@ let ChatQuotaExceededPart = class ChatQuotaExceededPart extends Disposable {
|
|
|
78
78
|
buttonForeground: asCssVariable(textLinkForeground)
|
|
79
79
|
})));
|
|
80
80
|
retryButton.element.classList.add("chat-quota-error-secondary-button");
|
|
81
|
-
retryButton.label = ( localize(
|
|
81
|
+
retryButton.label = ( localize(6471, "Click to Retry"));
|
|
82
82
|
this._register(retryButton.onDidClick(() => {
|
|
83
83
|
const widget = chatWidgetService.getWidgetBySessionResource(element.sessionResource);
|
|
84
84
|
if (!widget) {
|
|
@@ -18,6 +18,7 @@ import { ChatCollapsibleContentPart } from "./chatCollapsibleContentPart.js";
|
|
|
18
18
|
import { IDisposableReference } from "./chatCollections.js";
|
|
19
19
|
import { IChatContentPartRenderContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts";
|
|
20
20
|
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
21
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
21
22
|
export interface IChatReferenceListItem extends IChatContentReference {
|
|
22
23
|
title?: string;
|
|
23
24
|
description?: string;
|
|
@@ -32,7 +33,7 @@ export declare class ChatCollapsibleListContentPart extends ChatCollapsibleConte
|
|
|
32
33
|
private readonly menuService;
|
|
33
34
|
private readonly instantiationService;
|
|
34
35
|
private readonly contextMenuService;
|
|
35
|
-
constructor(data: ReadonlyArray<IChatCollapsibleListItem>, labelOverride: IMarkdownString | string | undefined, context: IChatContentPartRenderContext, contentReferencesListPool: CollapsibleListPool, hoverMessage: IMarkdownString | undefined, openerService: IOpenerService, menuService: IMenuService, instantiationService: IInstantiationService, contextMenuService: IContextMenuService, hoverService: IHoverService);
|
|
36
|
+
constructor(data: ReadonlyArray<IChatCollapsibleListItem>, labelOverride: IMarkdownString | string | undefined, context: IChatContentPartRenderContext, contentReferencesListPool: CollapsibleListPool, hoverMessage: IMarkdownString | undefined, openerService: IOpenerService, menuService: IMenuService, instantiationService: IInstantiationService, contextMenuService: IContextMenuService, hoverService: IHoverService, configurationService: IConfigurationService);
|
|
36
37
|
protected initContent(): HTMLElement;
|
|
37
38
|
hasSameContent(other: IChatRendererContent, followingContent: IChatRendererContent[], element: ChatTreeItem): boolean;
|
|
38
39
|
}
|
|
@@ -41,7 +42,7 @@ export interface IChatUsedReferencesListOptions {
|
|
|
41
42
|
}
|
|
42
43
|
export declare class ChatUsedReferencesListContentPart extends ChatCollapsibleListContentPart {
|
|
43
44
|
private readonly options;
|
|
44
|
-
constructor(data: ReadonlyArray<IChatCollapsibleListItem>, labelOverride: IMarkdownString | string | undefined, context: IChatContentPartRenderContext, contentReferencesListPool: CollapsibleListPool, options: IChatUsedReferencesListOptions, openerService: IOpenerService, menuService: IMenuService, instantiationService: IInstantiationService, contextMenuService: IContextMenuService, hoverService: IHoverService);
|
|
45
|
+
constructor(data: ReadonlyArray<IChatCollapsibleListItem>, labelOverride: IMarkdownString | string | undefined, context: IChatContentPartRenderContext, contentReferencesListPool: CollapsibleListPool, options: IChatUsedReferencesListOptions, openerService: IOpenerService, menuService: IMenuService, instantiationService: IInstantiationService, contextMenuService: IContextMenuService, hoverService: IHoverService, configurationService: IConfigurationService);
|
|
45
46
|
protected isExpanded(): boolean;
|
|
46
47
|
protected setExpanded(value: boolean): void;
|
|
47
48
|
}
|