@codingame/monaco-vscode-katex-common 27.0.0 → 28.0.1
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.js +2 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +30 -2
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +17 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +90 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +106 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +63 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +13 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +28 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +133 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +55 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +38 -37
- 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/chatEditing/media/chatEditingEditorOverlay.css +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +1 -1
- 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 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +72 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +1 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.d.ts +1 -1
- 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.d.ts +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.d.ts +1 -1
- 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.d.ts +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/chatCollapsibleMarkdownContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.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.d.ts +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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.d.ts +59 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +1 -1
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +3 -3
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownTableScrolling.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownTableScrolling.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +1 -1
- 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.d.ts +1 -1
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +26 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +290 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +1 -1
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +6 -6
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +1 -1
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +22 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +12 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +1 -1
- 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.d.ts +3 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +6 -260
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +1 -1
- 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.d.ts +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/chatConfirmationWidget.css +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +129 -117
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +1 -1
- 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.d.ts +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/chatInputOutputMarkdownProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +56 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +20 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +1 -1
- 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.d.ts +43 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +42 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +1 -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.d.ts +1 -1
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +1 -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 +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +61 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +7 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +1 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +81 -191
- 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 +31 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +334 -181
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +51 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +104 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +127 -0
- 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 +16 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +213 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +10 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +174 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +2 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +12 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +36 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +19 -4
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +22 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +24 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
- 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/browser/media/inlineChat.css +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +38 -46
- 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
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +6 -10
|
@@ -1,13 +1,14 @@
|
|
|
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 { $, trackFocus, addDisposableListener, EventType, clearNode, isAncestorOfActiveElement, runAtThisOrScheduleAtNextAnimationFrame,
|
|
4
|
+
import { $, trackFocus, addDisposableListener, EventType, clearNode, isHTMLElement, getWindow, isAncestorOfActiveElement, runAtThisOrScheduleAtNextAnimationFrame, DisposableResizeObserver } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
5
|
import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
6
6
|
import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
|
|
7
7
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
8
8
|
import { isMarkdownString, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
9
9
|
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
10
|
-
import { Disposable,
|
|
10
|
+
import { Disposable, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
|
+
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
11
12
|
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
12
13
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
13
14
|
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
@@ -15,7 +16,9 @@ import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs
|
|
|
15
16
|
import { defaultButtonStyles, defaultInputBoxStyles, defaultCheckboxStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
16
17
|
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
17
18
|
import { InputBox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/inputbox/inputBox';
|
|
19
|
+
import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
18
20
|
import { Checkbox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
|
|
21
|
+
import { ChatQuestionCarouselData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatQuestionCarouselData';
|
|
19
22
|
import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
20
23
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
21
24
|
import { HoverPosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
@@ -23,6 +26,7 @@ import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/h
|
|
|
23
26
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
24
27
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
25
28
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
29
|
+
import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
|
|
26
30
|
import * as chatQuestionCarousel from './media/chatQuestionCarousel.css';
|
|
27
31
|
|
|
28
32
|
registerCss(chatQuestionCarousel);
|
|
@@ -51,7 +55,6 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
51
55
|
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
52
56
|
this._currentIndex = 0;
|
|
53
57
|
this._answers = ( new Map());
|
|
54
|
-
this._nextButtonHover = this._register(( new MutableDisposable()));
|
|
55
58
|
this._isSkipped = false;
|
|
56
59
|
this._textInputBoxes = ( new Map());
|
|
57
60
|
this._singleSelectItems = ( new Map());
|
|
@@ -74,8 +77,18 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
74
77
|
});
|
|
75
78
|
this.domNode.tabIndex = 0;
|
|
76
79
|
this.domNode.setAttribute("role", "region");
|
|
77
|
-
this.domNode.setAttribute("aria-roledescription", ( localize(
|
|
80
|
+
this.domNode.setAttribute("aria-roledescription", ( localize(6542, "chat question")));
|
|
78
81
|
this._updateAriaLabel();
|
|
82
|
+
if (carousel instanceof ChatQuestionCarouselData) {
|
|
83
|
+
if (typeof carousel.draftCurrentIndex === "number") {
|
|
84
|
+
this._currentIndex = Math.max(0, Math.min(carousel.draftCurrentIndex, carousel.questions.length - 1));
|
|
85
|
+
}
|
|
86
|
+
if (carousel.draftAnswers) {
|
|
87
|
+
for (const [key, value] of Object.entries(carousel.draftAnswers)) {
|
|
88
|
+
this._answers.set(key, value);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
79
92
|
if (carousel.data) {
|
|
80
93
|
for (const [key, value] of Object.entries(carousel.data)) {
|
|
81
94
|
this._answers.set(key, value);
|
|
@@ -94,54 +107,20 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
94
107
|
this.domNode.append(this._questionContainer);
|
|
95
108
|
if (carousel.allowSkip) {
|
|
96
109
|
this._closeButtonContainer = $(".chat-question-close-container");
|
|
97
|
-
const skipAllTitle = ( localize(
|
|
110
|
+
const skipAllTitle = ( localize(6543, "Skip all questions"));
|
|
98
111
|
const skipAllButton = interactiveStore.add(( new Button(this._closeButtonContainer, {
|
|
99
112
|
...defaultButtonStyles,
|
|
100
113
|
secondary: true,
|
|
101
114
|
supportIcons: true
|
|
102
115
|
})));
|
|
103
116
|
skipAllButton.label = `$(${Codicon.close.id})`;
|
|
104
|
-
skipAllButton.element.classList.add("chat-question-
|
|
117
|
+
skipAllButton.element.classList.add("chat-question-close");
|
|
105
118
|
skipAllButton.element.setAttribute("aria-label", skipAllTitle);
|
|
106
119
|
interactiveStore.add(this._hoverService.setupDelayedHover(skipAllButton.element, {
|
|
107
120
|
content: skipAllTitle
|
|
108
121
|
}));
|
|
109
122
|
this._skipAllButton = skipAllButton;
|
|
110
123
|
}
|
|
111
|
-
this._footerRow = $(".chat-question-footer-row");
|
|
112
|
-
this._stepIndicator = $(".chat-question-step-indicator");
|
|
113
|
-
this._footerRow.appendChild(this._stepIndicator);
|
|
114
|
-
this._navigationButtons = $(".chat-question-carousel-nav");
|
|
115
|
-
this._navigationButtons.setAttribute("role", "navigation");
|
|
116
|
-
this._navigationButtons.setAttribute("aria-label", ( localize(6454, "Question navigation")));
|
|
117
|
-
const arrowsContainer = $(".chat-question-nav-arrows");
|
|
118
|
-
const previousLabel = ( localize(6455, "Previous"));
|
|
119
|
-
const previousLabelWithKeybinding = this.getLabelWithKeybinding(previousLabel, PREVIOUS_QUESTION_ACTION_ID);
|
|
120
|
-
const prevButton = interactiveStore.add(( new Button(arrowsContainer, {
|
|
121
|
-
...defaultButtonStyles,
|
|
122
|
-
secondary: true,
|
|
123
|
-
supportIcons: true
|
|
124
|
-
})));
|
|
125
|
-
prevButton.element.classList.add("chat-question-nav-arrow", "chat-question-nav-prev");
|
|
126
|
-
prevButton.label = `$(${Codicon.chevronLeft.id})`;
|
|
127
|
-
prevButton.element.setAttribute("aria-label", previousLabelWithKeybinding);
|
|
128
|
-
interactiveStore.add(this._hoverService.setupDelayedHover(prevButton.element, {
|
|
129
|
-
content: previousLabelWithKeybinding
|
|
130
|
-
}));
|
|
131
|
-
this._prevButton = prevButton;
|
|
132
|
-
const nextButton = interactiveStore.add(( new Button(arrowsContainer, {
|
|
133
|
-
...defaultButtonStyles,
|
|
134
|
-
secondary: true,
|
|
135
|
-
supportIcons: true
|
|
136
|
-
})));
|
|
137
|
-
nextButton.element.classList.add("chat-question-nav-arrow", "chat-question-nav-next");
|
|
138
|
-
nextButton.label = `$(${Codicon.chevronRight.id})`;
|
|
139
|
-
this._nextButton = nextButton;
|
|
140
|
-
this._navigationButtons.appendChild(arrowsContainer);
|
|
141
|
-
this._footerRow.appendChild(this._navigationButtons);
|
|
142
|
-
this.domNode.append(this._footerRow);
|
|
143
|
-
interactiveStore.add(prevButton.onDidClick(() => this.navigate(-1)));
|
|
144
|
-
interactiveStore.add(nextButton.onDidClick(() => this.handleNext()));
|
|
145
124
|
if (this._skipAllButton) {
|
|
146
125
|
interactiveStore.add(this._skipAllButton.onDidClick(() => this.ignore()));
|
|
147
126
|
}
|
|
@@ -151,6 +130,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
151
130
|
e.preventDefault();
|
|
152
131
|
e.stopPropagation();
|
|
153
132
|
this.ignore();
|
|
133
|
+
} else if (event.keyCode === KeyCode.Enter && (event.metaKey || event.ctrlKey)) {
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
e.stopPropagation();
|
|
136
|
+
this.submit();
|
|
154
137
|
} else if (event.keyCode === KeyCode.Enter && !event.shiftKey) {
|
|
155
138
|
const target = e.target;
|
|
156
139
|
const isTextInput = target.tagName === "INPUT" && target.type === "text";
|
|
@@ -158,7 +141,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
158
141
|
if (isTextInput || isFreeformTextarea) {
|
|
159
142
|
e.preventDefault();
|
|
160
143
|
e.stopPropagation();
|
|
161
|
-
this.
|
|
144
|
+
this.handleNextOrSubmit();
|
|
162
145
|
}
|
|
163
146
|
} else if ((event.ctrlKey || event.metaKey) && (event.keyCode === KeyCode.Backspace || event.keyCode === KeyCode.Delete)) {
|
|
164
147
|
e.stopPropagation();
|
|
@@ -171,26 +154,44 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
171
154
|
const answer = this.getCurrentAnswer();
|
|
172
155
|
if (answer !== undefined) {
|
|
173
156
|
this._answers.set(currentQuestion.id, answer);
|
|
157
|
+
} else {
|
|
158
|
+
this._answers.delete(currentQuestion.id);
|
|
174
159
|
}
|
|
160
|
+
this.persistDraftState();
|
|
161
|
+
}
|
|
162
|
+
persistDraftState() {
|
|
163
|
+
if (this.carousel.isUsed || !(this.carousel instanceof ChatQuestionCarouselData)) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
this.carousel.draftAnswers = Object.fromEntries(this._answers.entries());
|
|
167
|
+
this.carousel.draftCurrentIndex = this._currentIndex;
|
|
175
168
|
}
|
|
176
169
|
navigate(delta) {
|
|
177
170
|
const newIndex = this._currentIndex + delta;
|
|
178
171
|
if (newIndex >= 0 && newIndex < this.carousel.questions.length) {
|
|
179
172
|
this.saveCurrentAnswer();
|
|
180
173
|
this._currentIndex = newIndex;
|
|
174
|
+
this.persistDraftState();
|
|
181
175
|
this.renderCurrentQuestion(true);
|
|
176
|
+
this.domNode.focus();
|
|
182
177
|
}
|
|
183
178
|
}
|
|
184
|
-
|
|
179
|
+
handleNextOrSubmit() {
|
|
185
180
|
this.saveCurrentAnswer();
|
|
186
181
|
if (this._currentIndex < this.carousel.questions.length - 1) {
|
|
187
182
|
this._currentIndex++;
|
|
183
|
+
this.persistDraftState();
|
|
188
184
|
this.renderCurrentQuestion(true);
|
|
189
185
|
} else {
|
|
190
186
|
this._options.onSubmit(this._answers);
|
|
191
187
|
this.hideAndShowSummary();
|
|
192
188
|
}
|
|
193
189
|
}
|
|
190
|
+
submit() {
|
|
191
|
+
this.saveCurrentAnswer();
|
|
192
|
+
this._options.onSubmit(this._answers);
|
|
193
|
+
this.hideAndShowSummary();
|
|
194
|
+
}
|
|
194
195
|
_focusContainerAndAnnounce() {
|
|
195
196
|
this.domNode.focus();
|
|
196
197
|
const question = this.carousel.questions[this._currentIndex];
|
|
@@ -199,7 +200,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
199
200
|
const messageContent = this.getQuestionText(questionText);
|
|
200
201
|
const questionCount = this.carousel.questions.length;
|
|
201
202
|
const alertMessage = questionCount === 1 ? messageContent : ( localize(
|
|
202
|
-
|
|
203
|
+
6544,
|
|
203
204
|
"Question {0} of {1}: {2}",
|
|
204
205
|
this._currentIndex + 1,
|
|
205
206
|
questionCount,
|
|
@@ -226,12 +227,49 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
226
227
|
this._freeformTextareas.clear();
|
|
227
228
|
this._prevButton = undefined;
|
|
228
229
|
this._nextButton = undefined;
|
|
230
|
+
this._submitButton = undefined;
|
|
229
231
|
this._skipAllButton = undefined;
|
|
230
232
|
this._questionContainer = undefined;
|
|
231
|
-
this._navigationButtons = undefined;
|
|
232
233
|
this._closeButtonContainer = undefined;
|
|
233
234
|
this._footerRow = undefined;
|
|
234
235
|
this._stepIndicator = undefined;
|
|
236
|
+
this._submitHint = undefined;
|
|
237
|
+
this._inputScrollable = undefined;
|
|
238
|
+
}
|
|
239
|
+
layoutInputScrollable(inputScrollable) {
|
|
240
|
+
if (!this._questionContainer) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const scrollableNode = inputScrollable.getDomNode();
|
|
244
|
+
const scrollableContent = scrollableNode.firstElementChild;
|
|
245
|
+
if (!isHTMLElement(scrollableContent)) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (scrollableNode.style.height !== "" || scrollableNode.style.maxHeight !== "") {
|
|
249
|
+
scrollableNode.style.height = "";
|
|
250
|
+
scrollableNode.style.maxHeight = "";
|
|
251
|
+
}
|
|
252
|
+
if (scrollableContent.style.height !== "" || scrollableContent.style.maxHeight !== "") {
|
|
253
|
+
scrollableContent.style.height = "";
|
|
254
|
+
scrollableContent.style.maxHeight = "";
|
|
255
|
+
}
|
|
256
|
+
const maxContainerHeight = this._questionContainer.clientHeight;
|
|
257
|
+
const computedStyle = getWindow(this._questionContainer).getComputedStyle(this._questionContainer);
|
|
258
|
+
const contentVerticalPadding = Number.parseFloat(computedStyle.paddingTop || "0") + Number.parseFloat(computedStyle.paddingBottom || "0");
|
|
259
|
+
const nonScrollableContentHeight = Array.from(this._questionContainer.children).filter(child => child !== scrollableNode).reduce((sum, child) => sum + child.offsetHeight, 0);
|
|
260
|
+
const availableScrollableHeight = Math.floor(maxContainerHeight - contentVerticalPadding - nonScrollableContentHeight);
|
|
261
|
+
const contentScrollableHeight = scrollableContent.scrollHeight;
|
|
262
|
+
const constrainedScrollableHeight = Math.max(0, Math.min(availableScrollableHeight, contentScrollableHeight));
|
|
263
|
+
const constrainedScrollableHeightPx = `${constrainedScrollableHeight}px`;
|
|
264
|
+
if (scrollableNode.style.height !== constrainedScrollableHeightPx || scrollableNode.style.maxHeight !== constrainedScrollableHeightPx) {
|
|
265
|
+
scrollableNode.style.height = constrainedScrollableHeightPx;
|
|
266
|
+
scrollableNode.style.maxHeight = constrainedScrollableHeightPx;
|
|
267
|
+
}
|
|
268
|
+
if (scrollableContent.style.height !== constrainedScrollableHeightPx || scrollableContent.style.maxHeight !== constrainedScrollableHeightPx) {
|
|
269
|
+
scrollableContent.style.height = constrainedScrollableHeightPx;
|
|
270
|
+
scrollableContent.style.maxHeight = constrainedScrollableHeightPx;
|
|
271
|
+
}
|
|
272
|
+
inputScrollable.scanDomNode();
|
|
235
273
|
}
|
|
236
274
|
skip() {
|
|
237
275
|
if (this._isSkipped || !this.carousel.allowSkip) {
|
|
@@ -305,17 +343,17 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
305
343
|
_updateAriaLabel() {
|
|
306
344
|
const question = this.carousel.questions[this._currentIndex];
|
|
307
345
|
if (!question) {
|
|
308
|
-
this.domNode.setAttribute("aria-label", ( localize(
|
|
346
|
+
this.domNode.setAttribute("aria-label", ( localize(6545, "Chat question")));
|
|
309
347
|
return;
|
|
310
348
|
}
|
|
311
349
|
const questionText = question.message ?? question.title;
|
|
312
350
|
const messageContent = this.getQuestionText(questionText);
|
|
313
351
|
const questionCount = this.carousel.questions.length;
|
|
314
352
|
if (questionCount === 1) {
|
|
315
|
-
this.domNode.setAttribute("aria-label", ( localize(
|
|
353
|
+
this.domNode.setAttribute("aria-label", ( localize(6546, "Chat question: {0}", messageContent)));
|
|
316
354
|
} else {
|
|
317
355
|
this.domNode.setAttribute("aria-label", ( localize(
|
|
318
|
-
|
|
356
|
+
6547,
|
|
319
357
|
"Chat question {0} of {1}: {2}",
|
|
320
358
|
this._currentIndex + 1,
|
|
321
359
|
questionCount,
|
|
@@ -344,11 +382,12 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
344
382
|
return true;
|
|
345
383
|
}
|
|
346
384
|
renderCurrentQuestion(focusContainerForScreenReader = false) {
|
|
347
|
-
if (!this._questionContainer
|
|
385
|
+
if (!this._questionContainer) {
|
|
348
386
|
return;
|
|
349
387
|
}
|
|
350
388
|
const questionRenderStore = ( new DisposableStore());
|
|
351
389
|
this._questionRenderStore.value = questionRenderStore;
|
|
390
|
+
this._inputScrollable = undefined;
|
|
352
391
|
this._inputBoxes.clear();
|
|
353
392
|
this._textInputBoxes.clear();
|
|
354
393
|
this._singleSelectItems.clear();
|
|
@@ -360,72 +399,180 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
360
399
|
return;
|
|
361
400
|
}
|
|
362
401
|
const headerRow = $(".chat-question-header-row");
|
|
402
|
+
const titleRow = $(".chat-question-title-row");
|
|
363
403
|
const questionText = question.message ?? question.title;
|
|
364
404
|
if (questionText) {
|
|
365
405
|
const title = $(".chat-question-title");
|
|
366
406
|
const messageContent = this.getQuestionText(questionText);
|
|
367
407
|
title.setAttribute("aria-label", messageContent);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
} else {
|
|
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
|
-
}
|
|
384
|
-
}
|
|
385
|
-
headerRow.appendChild(title);
|
|
408
|
+
const messageMd = isMarkdownString(questionText) ? MarkdownString.lift(questionText) : ( new MarkdownString(questionText));
|
|
409
|
+
const renderedTitle = questionRenderStore.add(this._markdownRendererService.render(messageMd));
|
|
410
|
+
title.appendChild(renderedTitle.element);
|
|
411
|
+
titleRow.appendChild(title);
|
|
386
412
|
}
|
|
413
|
+
headerRow.appendChild(titleRow);
|
|
387
414
|
if (this._closeButtonContainer) {
|
|
388
|
-
|
|
415
|
+
titleRow.appendChild(this._closeButtonContainer);
|
|
389
416
|
}
|
|
390
417
|
this._questionContainer.appendChild(headerRow);
|
|
391
|
-
const isSingleQuestion = this.carousel.questions.length === 1;
|
|
392
|
-
if (this._stepIndicator) {
|
|
393
|
-
this._stepIndicator.textContent = `${this._currentIndex + 1}/${this.carousel.questions.length}`;
|
|
394
|
-
this._stepIndicator.style.display = isSingleQuestion ? "none" : "";
|
|
395
|
-
}
|
|
396
418
|
const inputContainer = $(".chat-question-input-container");
|
|
397
419
|
this.renderInput(inputContainer, question);
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
this.
|
|
410
|
-
content: submitLabel
|
|
411
|
-
});
|
|
420
|
+
const inputScrollable = questionRenderStore.add(( new DomScrollableElement(inputContainer, {
|
|
421
|
+
vertical: ScrollbarVisibility.Visible,
|
|
422
|
+
horizontal: ScrollbarVisibility.Hidden,
|
|
423
|
+
consumeMouseWheelIfScrollbarIsNeeded: true
|
|
424
|
+
})));
|
|
425
|
+
this._inputScrollable = inputScrollable;
|
|
426
|
+
const inputScrollableNode = inputScrollable.getDomNode();
|
|
427
|
+
inputScrollableNode.classList.add("chat-question-input-scrollable");
|
|
428
|
+
this._questionContainer.appendChild(inputScrollableNode);
|
|
429
|
+
const isSingleQuestion = this.carousel.questions.length === 1;
|
|
430
|
+
if (!isSingleQuestion) {
|
|
431
|
+
this.renderFooter();
|
|
412
432
|
} else {
|
|
413
|
-
this.
|
|
414
|
-
this._nextButton.element.setAttribute("aria-label", nextLabelWithKeybinding);
|
|
415
|
-
this._nextButton.element.classList.remove("chat-question-nav-submit");
|
|
416
|
-
this._nextButtonHover.value = this._hoverService.setupDelayedHover(this._nextButton.element, {
|
|
417
|
-
content: nextLabelWithKeybinding
|
|
418
|
-
});
|
|
433
|
+
this.renderSingleQuestionFooter();
|
|
419
434
|
}
|
|
435
|
+
let relayoutScheduled = false;
|
|
436
|
+
const relayoutScheduler = questionRenderStore.add(( new MutableDisposable()));
|
|
437
|
+
const scheduleLayoutInputScrollable = () => {
|
|
438
|
+
if (relayoutScheduled) {
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
relayoutScheduled = true;
|
|
442
|
+
relayoutScheduler.value = runAtThisOrScheduleAtNextAnimationFrame(getWindow(this.domNode), () => {
|
|
443
|
+
relayoutScheduled = false;
|
|
444
|
+
this.layoutInputScrollable(inputScrollable);
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
const inputResizeObserver = questionRenderStore.add(new DisposableResizeObserver(() => scheduleLayoutInputScrollable()));
|
|
448
|
+
questionRenderStore.add(inputResizeObserver.observe(inputScrollableNode));
|
|
449
|
+
questionRenderStore.add(inputResizeObserver.observe(inputContainer));
|
|
450
|
+
scheduleLayoutInputScrollable();
|
|
451
|
+
questionRenderStore.add(
|
|
452
|
+
runAtThisOrScheduleAtNextAnimationFrame(getWindow(this.domNode), () => {
|
|
453
|
+
inputContainer.scrollTop = 0;
|
|
454
|
+
inputContainer.scrollLeft = 0;
|
|
455
|
+
inputScrollable.setScrollPosition({
|
|
456
|
+
scrollTop: 0,
|
|
457
|
+
scrollLeft: 0
|
|
458
|
+
});
|
|
459
|
+
inputScrollable.scanDomNode();
|
|
460
|
+
})
|
|
461
|
+
);
|
|
420
462
|
this._updateAriaLabel();
|
|
421
463
|
if (focusContainerForScreenReader && this._accessibilityService.isScreenReaderOptimized()) {
|
|
422
464
|
this._focusContainerAndAnnounce();
|
|
423
465
|
}
|
|
424
466
|
this._onDidChangeHeight.fire();
|
|
425
467
|
}
|
|
468
|
+
renderFooter() {
|
|
469
|
+
if (!this._footerRow) {
|
|
470
|
+
const interactiveStore = this._interactiveUIStore.value;
|
|
471
|
+
if (!interactiveStore) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
this._footerRow = $(".chat-question-footer-row");
|
|
475
|
+
const leftControls = $(".chat-question-footer-left.chat-question-carousel-nav");
|
|
476
|
+
leftControls.setAttribute("role", "navigation");
|
|
477
|
+
leftControls.setAttribute("aria-label", ( localize(6548, "Question navigation")));
|
|
478
|
+
const arrowsContainer = $(".chat-question-nav-arrows");
|
|
479
|
+
const previousLabel = this.getLabelWithKeybinding(( localize(6549, "Previous")), PREVIOUS_QUESTION_ACTION_ID);
|
|
480
|
+
const prevButton = interactiveStore.add(( new Button(arrowsContainer, {
|
|
481
|
+
...defaultButtonStyles,
|
|
482
|
+
secondary: true,
|
|
483
|
+
supportIcons: true
|
|
484
|
+
})));
|
|
485
|
+
prevButton.element.classList.add("chat-question-nav-arrow", "chat-question-nav-prev");
|
|
486
|
+
prevButton.label = `$(${Codicon.chevronLeft.id})`;
|
|
487
|
+
prevButton.element.setAttribute("aria-label", previousLabel);
|
|
488
|
+
interactiveStore.add(this._hoverService.setupDelayedHover(prevButton.element, {
|
|
489
|
+
content: previousLabel
|
|
490
|
+
}));
|
|
491
|
+
interactiveStore.add(prevButton.onDidClick(() => this.navigate(-1)));
|
|
492
|
+
this._prevButton = prevButton;
|
|
493
|
+
const nextLabel = this.getLabelWithKeybinding(( localize(6550, "Next")), NEXT_QUESTION_ACTION_ID);
|
|
494
|
+
const nextButton = interactiveStore.add(( new Button(arrowsContainer, {
|
|
495
|
+
...defaultButtonStyles,
|
|
496
|
+
secondary: true,
|
|
497
|
+
supportIcons: true
|
|
498
|
+
})));
|
|
499
|
+
nextButton.element.classList.add("chat-question-nav-arrow", "chat-question-nav-next");
|
|
500
|
+
nextButton.label = `$(${Codicon.chevronRight.id})`;
|
|
501
|
+
nextButton.element.setAttribute("aria-label", nextLabel);
|
|
502
|
+
interactiveStore.add(this._hoverService.setupDelayedHover(nextButton.element, {
|
|
503
|
+
content: nextLabel
|
|
504
|
+
}));
|
|
505
|
+
interactiveStore.add(nextButton.onDidClick(() => this.navigate(1)));
|
|
506
|
+
this._nextButton = nextButton;
|
|
507
|
+
leftControls.appendChild(arrowsContainer);
|
|
508
|
+
this._stepIndicator = $(".chat-question-step-indicator");
|
|
509
|
+
leftControls.appendChild(this._stepIndicator);
|
|
510
|
+
this._footerRow.appendChild(leftControls);
|
|
511
|
+
const rightControls = $(".chat-question-footer-right");
|
|
512
|
+
const hint = $("span.chat-question-submit-hint");
|
|
513
|
+
hint.textContent = isMacintosh ? ( localize(6551, "⌘⏎ to submit")) : ( localize(6552, "Ctrl+Enter to submit"));
|
|
514
|
+
rightControls.appendChild(hint);
|
|
515
|
+
this._submitHint = hint;
|
|
516
|
+
const submitButton = interactiveStore.add(( new Button(rightControls, {
|
|
517
|
+
...defaultButtonStyles
|
|
518
|
+
})));
|
|
519
|
+
submitButton.element.classList.add("chat-question-submit-button");
|
|
520
|
+
submitButton.label = ( localize(6553, "Submit"));
|
|
521
|
+
interactiveStore.add(submitButton.onDidClick(() => this.submit()));
|
|
522
|
+
this._submitButton = submitButton;
|
|
523
|
+
this._footerRow.appendChild(rightControls);
|
|
524
|
+
this.domNode.append(this._footerRow);
|
|
525
|
+
}
|
|
526
|
+
this.updateFooterState();
|
|
527
|
+
}
|
|
528
|
+
updateFooterState() {
|
|
529
|
+
if (this._prevButton) {
|
|
530
|
+
this._prevButton.enabled = this._currentIndex > 0;
|
|
531
|
+
}
|
|
532
|
+
if (this._nextButton) {
|
|
533
|
+
this._nextButton.enabled = this._currentIndex < this.carousel.questions.length - 1;
|
|
534
|
+
}
|
|
535
|
+
if (this._stepIndicator) {
|
|
536
|
+
this._stepIndicator.textContent = ( localize(6554, "{0}/{1}", this._currentIndex + 1, this.carousel.questions.length));
|
|
537
|
+
}
|
|
538
|
+
if (this._submitButton) {
|
|
539
|
+
const isLastQuestion = this._currentIndex === this.carousel.questions.length - 1;
|
|
540
|
+
this._submitButton.element.style.display = isLastQuestion ? "" : "none";
|
|
541
|
+
if (this._submitHint) {
|
|
542
|
+
this._submitHint.style.display = isLastQuestion ? "" : "none";
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
renderSingleQuestionFooter() {
|
|
547
|
+
if (!this._footerRow) {
|
|
548
|
+
const interactiveStore = this._interactiveUIStore.value;
|
|
549
|
+
if (!interactiveStore) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
this._footerRow = $(".chat-question-footer-row");
|
|
553
|
+
const leftControls = $(".chat-question-footer-left.chat-question-carousel-nav");
|
|
554
|
+
leftControls.setAttribute("role", "navigation");
|
|
555
|
+
leftControls.setAttribute("aria-label", ( localize(6548, "Question navigation")));
|
|
556
|
+
this._footerRow.appendChild(leftControls);
|
|
557
|
+
const rightControls = $(".chat-question-footer-right");
|
|
558
|
+
const hint = $("span.chat-question-submit-hint");
|
|
559
|
+
hint.textContent = isMacintosh ? ( localize(6551, "⌘⏎ to submit")) : ( localize(6552, "Ctrl+Enter to submit"));
|
|
560
|
+
rightControls.appendChild(hint);
|
|
561
|
+
this._submitHint = hint;
|
|
562
|
+
const submitButton = interactiveStore.add(( new Button(rightControls, {
|
|
563
|
+
...defaultButtonStyles
|
|
564
|
+
})));
|
|
565
|
+
submitButton.element.classList.add("chat-question-submit-button");
|
|
566
|
+
submitButton.label = ( localize(6553, "Submit"));
|
|
567
|
+
interactiveStore.add(submitButton.onDidClick(() => this.submit()));
|
|
568
|
+
this._submitButton = submitButton;
|
|
569
|
+
this._footerRow.appendChild(rightControls);
|
|
570
|
+
this.domNode.append(this._footerRow);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
426
573
|
getLabelWithKeybinding(label, actionId) {
|
|
427
574
|
const keybindingLabel = this._keybindingService.lookupKeybinding(actionId, this._contextKeyService)?.getLabel();
|
|
428
|
-
return keybindingLabel ? ( localize(
|
|
575
|
+
return keybindingLabel ? ( localize(6555, "{0} ({1})", label, keybindingLabel)) : label;
|
|
429
576
|
}
|
|
430
577
|
renderInput(container, question) {
|
|
431
578
|
switch (question.type) {
|
|
@@ -444,6 +591,9 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
444
591
|
const autoResize = () => {
|
|
445
592
|
textarea.style.height = "auto";
|
|
446
593
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;
|
|
594
|
+
if (this._inputScrollable) {
|
|
595
|
+
this.layoutInputScrollable(this._inputScrollable);
|
|
596
|
+
}
|
|
447
597
|
this._onDidChangeHeight.fire();
|
|
448
598
|
};
|
|
449
599
|
this._inputBoxes.add(addDisposableListener(textarea, EventType.INPUT, autoResize));
|
|
@@ -451,9 +601,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
451
601
|
}
|
|
452
602
|
renderTextInput(container, question) {
|
|
453
603
|
const inputBox = this._inputBoxes.add(( new InputBox(container, undefined, {
|
|
454
|
-
placeholder: ( localize(
|
|
604
|
+
placeholder: ( localize(6556, "Enter your answer")),
|
|
455
605
|
inputBoxStyles: defaultInputBoxStyles
|
|
456
606
|
})));
|
|
607
|
+
this._inputBoxes.add(inputBox.onDidChange(() => this.saveCurrentAnswer()));
|
|
457
608
|
const previousAnswer = this._answers.get(question.id);
|
|
458
609
|
if (previousAnswer !== undefined) {
|
|
459
610
|
inputBox.value = String(previousAnswer);
|
|
@@ -508,13 +659,14 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
508
659
|
if (data) {
|
|
509
660
|
data.selectedIndex = newIndex;
|
|
510
661
|
}
|
|
662
|
+
this.saveCurrentAnswer();
|
|
511
663
|
};
|
|
512
664
|
options.forEach((option, index) => {
|
|
513
665
|
const isSelected = index === selectedIndex;
|
|
514
666
|
const listItem = $(".chat-question-list-item");
|
|
515
667
|
listItem.setAttribute("role", "option");
|
|
516
668
|
listItem.setAttribute("aria-selected", String(isSelected));
|
|
517
|
-
listItem.setAttribute("aria-label", ( localize(
|
|
669
|
+
listItem.setAttribute("aria-label", ( localize(6557, "Option {0}: {1}", index + 1, option.label)));
|
|
518
670
|
listItem.id = `option-${question.id}-${index}`;
|
|
519
671
|
listItem.tabIndex = -1;
|
|
520
672
|
const number = $(".chat-question-list-number");
|
|
@@ -528,11 +680,12 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
528
680
|
const label = $(".chat-question-list-label");
|
|
529
681
|
const separatorIndex = option.label.indexOf(" - ");
|
|
530
682
|
if (separatorIndex !== -1) {
|
|
683
|
+
listItem.classList.add("has-description");
|
|
531
684
|
const titleSpan = $("span.chat-question-list-label-title");
|
|
532
685
|
titleSpan.textContent = option.label.substring(0, separatorIndex);
|
|
533
686
|
label.appendChild(titleSpan);
|
|
534
687
|
const descSpan = $("span.chat-question-list-label-desc");
|
|
535
|
-
descSpan.textContent =
|
|
688
|
+
descSpan.textContent = option.label.substring(separatorIndex + 3);
|
|
536
689
|
label.appendChild(descSpan);
|
|
537
690
|
} else {
|
|
538
691
|
label.textContent = option.label;
|
|
@@ -550,7 +703,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
550
703
|
if (freeform) {
|
|
551
704
|
freeform.value = "";
|
|
552
705
|
}
|
|
553
|
-
this.
|
|
706
|
+
this.handleNextOrSubmit();
|
|
554
707
|
}));
|
|
555
708
|
this._inputBoxes.add(this._hoverService.setupDelayedHover(listItem, {
|
|
556
709
|
content: option.label,
|
|
@@ -576,7 +729,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
576
729
|
freeformNumber.textContent = `${options.length + 1}`;
|
|
577
730
|
freeformContainer.appendChild(freeformNumber);
|
|
578
731
|
const freeformTextarea = $("textarea.chat-question-freeform-textarea");
|
|
579
|
-
freeformTextarea.placeholder = ( localize(
|
|
732
|
+
freeformTextarea.placeholder = ( localize(6558, "Enter custom answer"));
|
|
580
733
|
freeformTextarea.rows = 1;
|
|
581
734
|
if (previousFreeform !== undefined) {
|
|
582
735
|
freeformTextarea.value = previousFreeform;
|
|
@@ -585,6 +738,8 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
585
738
|
this._inputBoxes.add(addDisposableListener(freeformTextarea, EventType.INPUT, () => {
|
|
586
739
|
if (freeformTextarea.value.length > 0) {
|
|
587
740
|
updateSelection(-1);
|
|
741
|
+
} else {
|
|
742
|
+
this.saveCurrentAnswer();
|
|
588
743
|
}
|
|
589
744
|
}));
|
|
590
745
|
freeformContainer.appendChild(freeformTextarea);
|
|
@@ -603,10 +758,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
603
758
|
} else if (event.keyCode === KeyCode.UpArrow) {
|
|
604
759
|
e.preventDefault();
|
|
605
760
|
newIndex = Math.max(data.selectedIndex - 1, 0);
|
|
606
|
-
} else if (event.keyCode === KeyCode.Enter || event.keyCode === KeyCode.Space) {
|
|
761
|
+
} else if ((event.keyCode === KeyCode.Enter || event.keyCode === KeyCode.Space) && !event.metaKey && !event.ctrlKey) {
|
|
607
762
|
e.preventDefault();
|
|
608
763
|
e.stopPropagation();
|
|
609
|
-
this.
|
|
764
|
+
this.handleNextOrSubmit();
|
|
610
765
|
return;
|
|
611
766
|
} else if (event.keyCode >= KeyCode.Digit1 && event.keyCode <= KeyCode.Digit9) {
|
|
612
767
|
const numberIndex = event.keyCode - KeyCode.Digit1;
|
|
@@ -679,7 +834,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
679
834
|
const listItem = $(".chat-question-list-item.multi-select");
|
|
680
835
|
listItem.setAttribute("role", "option");
|
|
681
836
|
listItem.setAttribute("aria-selected", String(isChecked));
|
|
682
|
-
listItem.setAttribute("aria-label", ( localize(
|
|
837
|
+
listItem.setAttribute("aria-label", ( localize(6557, "Option {0}: {1}", index + 1, option.label)));
|
|
683
838
|
listItem.id = `option-${question.id}-${index}`;
|
|
684
839
|
listItem.tabIndex = -1;
|
|
685
840
|
const number = $(".chat-question-list-number");
|
|
@@ -692,11 +847,12 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
692
847
|
const label = $(".chat-question-list-label");
|
|
693
848
|
const separatorIndex = option.label.indexOf(" - ");
|
|
694
849
|
if (separatorIndex !== -1) {
|
|
850
|
+
listItem.classList.add("has-description");
|
|
695
851
|
const titleSpan = $("span.chat-question-list-label-title");
|
|
696
852
|
titleSpan.textContent = option.label.substring(0, separatorIndex);
|
|
697
853
|
label.appendChild(titleSpan);
|
|
698
854
|
const descSpan = $("span.chat-question-list-label-desc");
|
|
699
|
-
descSpan.textContent =
|
|
855
|
+
descSpan.textContent = option.label.substring(separatorIndex + 3);
|
|
700
856
|
label.appendChild(descSpan);
|
|
701
857
|
} else {
|
|
702
858
|
label.textContent = option.label;
|
|
@@ -711,6 +867,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
711
867
|
this._inputBoxes.add(checkbox.onChange(() => {
|
|
712
868
|
listItem.classList.toggle("checked", checkbox.checked);
|
|
713
869
|
listItem.setAttribute("aria-selected", String(checkbox.checked));
|
|
870
|
+
this.saveCurrentAnswer();
|
|
714
871
|
}));
|
|
715
872
|
this._inputBoxes.add(addDisposableListener(listItem, EventType.CLICK, e => {
|
|
716
873
|
focusedIndex = index;
|
|
@@ -737,12 +894,15 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
737
894
|
freeformNumber.textContent = `${options.length + 1}`;
|
|
738
895
|
freeformContainer.appendChild(freeformNumber);
|
|
739
896
|
const freeformTextarea = $("textarea.chat-question-freeform-textarea");
|
|
740
|
-
freeformTextarea.placeholder = ( localize(
|
|
897
|
+
freeformTextarea.placeholder = ( localize(6558, "Enter custom answer"));
|
|
741
898
|
freeformTextarea.rows = 1;
|
|
742
899
|
if (previousFreeform !== undefined) {
|
|
743
900
|
freeformTextarea.value = previousFreeform;
|
|
744
901
|
}
|
|
745
902
|
const autoResize = this.setupTextareaAutoResize(freeformTextarea);
|
|
903
|
+
this._inputBoxes.add(
|
|
904
|
+
addDisposableListener(freeformTextarea, EventType.INPUT, () => this.saveCurrentAnswer())
|
|
905
|
+
);
|
|
746
906
|
freeformContainer.appendChild(freeformTextarea);
|
|
747
907
|
container.appendChild(freeformContainer);
|
|
748
908
|
this._freeformTextareas.set(question.id, freeformTextarea);
|
|
@@ -759,10 +919,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
759
919
|
e.preventDefault();
|
|
760
920
|
focusedIndex = Math.max(focusedIndex - 1, 0);
|
|
761
921
|
listItems[focusedIndex].focus();
|
|
762
|
-
} else if (event.keyCode === KeyCode.Enter) {
|
|
922
|
+
} else if (event.keyCode === KeyCode.Enter && !event.metaKey && !event.ctrlKey) {
|
|
763
923
|
e.preventDefault();
|
|
764
924
|
e.stopPropagation();
|
|
765
|
-
this.
|
|
925
|
+
this.handleNextOrSubmit();
|
|
766
926
|
} else if (event.keyCode === KeyCode.Space) {
|
|
767
927
|
e.preventDefault();
|
|
768
928
|
if (focusedIndex >= 0 && focusedIndex < checkboxes.length) {
|
|
@@ -871,7 +1031,7 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
871
1031
|
renderSkippedMessage() {
|
|
872
1032
|
const skippedContainer = $(".chat-question-carousel-summary");
|
|
873
1033
|
const skippedMessage = $(".chat-question-summary-skipped");
|
|
874
|
-
skippedMessage.textContent = ( localize(
|
|
1034
|
+
skippedMessage.textContent = ( localize(6559, "Skipped"));
|
|
875
1035
|
skippedContainer.appendChild(skippedMessage);
|
|
876
1036
|
this.domNode.appendChild(skippedContainer);
|
|
877
1037
|
}
|
|
@@ -885,29 +1045,22 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
885
1045
|
const summaryContainer = $(".chat-question-carousel-summary");
|
|
886
1046
|
for (const question of this.carousel.questions) {
|
|
887
1047
|
const answer = this._answers.get(question.id);
|
|
888
|
-
if (answer === undefined) {
|
|
889
|
-
continue;
|
|
890
|
-
}
|
|
891
1048
|
const summaryItem = $(".chat-question-summary-item");
|
|
892
|
-
const
|
|
1049
|
+
const questionRow = $("div.chat-question-summary-label");
|
|
893
1050
|
const questionText = question.message ?? question.title;
|
|
894
1051
|
let labelText = typeof questionText === "string" ? questionText : questionText.value;
|
|
895
1052
|
labelText = labelText.replace(/[:\s]+$/, "");
|
|
896
|
-
|
|
897
|
-
summaryItem.appendChild(
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
summaryItem.appendChild(answerTitle);
|
|
904
|
-
const answerDesc = $("span.chat-question-summary-answer-desc");
|
|
905
|
-
answerDesc.textContent = " - " + formattedAnswer.substring(separatorIndex + 3);
|
|
906
|
-
summaryItem.appendChild(answerDesc);
|
|
1053
|
+
questionRow.textContent = ( localize(6560, "Q: {0}", labelText));
|
|
1054
|
+
summaryItem.appendChild(questionRow);
|
|
1055
|
+
if (answer !== undefined) {
|
|
1056
|
+
const formattedAnswer = this.formatAnswerForSummary(question, answer);
|
|
1057
|
+
const answerRow = $("div.chat-question-summary-answer-title");
|
|
1058
|
+
answerRow.textContent = ( localize(6561, "A: {0}", formattedAnswer));
|
|
1059
|
+
summaryItem.appendChild(answerRow);
|
|
907
1060
|
} else {
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
summaryItem.appendChild(
|
|
1061
|
+
const unanswered = $("div.chat-question-summary-unanswered");
|
|
1062
|
+
unanswered.textContent = ( localize(6562, "Not answered yet"));
|
|
1063
|
+
summaryItem.appendChild(unanswered);
|
|
911
1064
|
}
|
|
912
1065
|
summaryContainer.appendChild(summaryItem);
|
|
913
1066
|
}
|
|
@@ -932,6 +1085,11 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
932
1085
|
}
|
|
933
1086
|
return selectedLabel ?? String(selectedValue ?? "");
|
|
934
1087
|
}
|
|
1088
|
+
if (typeof answer === "object" && answer !== null && hasKey(answer, {
|
|
1089
|
+
freeformValue: true
|
|
1090
|
+
})) {
|
|
1091
|
+
return answer.freeformValue ?? "";
|
|
1092
|
+
}
|
|
935
1093
|
const label = question.options?.find(opt => opt.value === answer)?.label;
|
|
936
1094
|
return label ?? String(answer);
|
|
937
1095
|
}
|
|
@@ -948,10 +1106,10 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
948
1106
|
if (freeformValue) {
|
|
949
1107
|
labels.push(freeformValue);
|
|
950
1108
|
}
|
|
951
|
-
return labels.join(( localize(
|
|
1109
|
+
return labels.join(( localize(6563, ", ")));
|
|
952
1110
|
}
|
|
953
1111
|
if (Array.isArray(answer)) {
|
|
954
|
-
return ( answer.map(v => question.options?.find(opt => opt.value === v)?.label ?? String(v))).join(( localize(
|
|
1112
|
+
return ( answer.map(v => question.options?.find(opt => opt.value === v)?.label ?? String(v))).join(( localize(6563, ", ")));
|
|
955
1113
|
}
|
|
956
1114
|
return String(answer);
|
|
957
1115
|
}
|
|
@@ -972,6 +1130,12 @@ let ChatQuestionCarouselPart = class ChatQuestionCarouselPart extends Disposable
|
|
|
972
1130
|
addDisposable(disposable) {
|
|
973
1131
|
this._register(disposable);
|
|
974
1132
|
}
|
|
1133
|
+
dispose() {
|
|
1134
|
+
if (!this._isSkipped && !this.carousel.isUsed) {
|
|
1135
|
+
this.saveCurrentAnswer();
|
|
1136
|
+
}
|
|
1137
|
+
super.dispose();
|
|
1138
|
+
}
|
|
975
1139
|
};
|
|
976
1140
|
ChatQuestionCarouselPart = ( __decorate([( __param(3, IMarkdownRendererService)), ( __param(4, IHoverService)), ( __param(5, IAccessibilityService)), ( __param(6, IContextKeyService)), ( __param(7, IKeybindingService))], ChatQuestionCarouselPart));
|
|
977
1141
|
|