Skip to content

Commit 11d97fa

Browse files
committed
fix: adding back telemetry
1 parent 4fadb1e commit 11d97fa

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

webview-ui/src/components/ErrorBoundary.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { Component } from "react"
2+
import { telemetryClient } from "@src/utils/TelemetryClient"
23
import { withTranslation, WithTranslation } from "react-i18next"
34
import { enhanceErrorWithSourceMaps } from "@src/utils/sourceMapUtils"
45
import { EXTERNAL_LINKS } from "@src/constants/externalLinks"
@@ -38,6 +39,14 @@ class ErrorBoundary extends Component<ErrorProps, ErrorState> {
3839
const componentStack = errorInfo.componentStack || ""
3940
const enhancedError = await enhanceErrorWithSourceMaps(error, componentStack)
4041

42+
telemetryClient.capture("error_boundary_caught_error", {
43+
error: enhancedError.message,
44+
stack: enhancedError.sourceMappedStack || enhancedError.stack,
45+
componentStack: enhancedError.sourceMappedComponentStack || componentStack,
46+
timestamp: Date.now(),
47+
errorType: enhancedError.name,
48+
})
49+
4150
this.setState({
4251
error: enhancedError.sourceMappedStack || enhancedError.stack,
4352
componentStack: enhancedError.sourceMappedComponentStack || componentStack,

webview-ui/src/components/settings/UISettings.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { HTMLAttributes, useMemo } from "react"
22
import { useAppTranslation } from "@/i18n/TranslationContext"
33
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
4+
import { telemetryClient } from "@/utils/TelemetryClient"
45

56
import { SetCachedStateField } from "./types"
67
import { SectionHeader } from "./SectionHeader"
@@ -30,11 +31,21 @@ export const UISettings = ({
3031

3132
const handleReasoningBlockCollapsedChange = (value: boolean) => {
3233
setCachedStateField("reasoningBlockCollapsed", value)
34+
35+
// Track telemetry event
36+
telemetryClient.capture("ui_settings_collapse_thinking_changed", {
37+
enabled: value,
38+
})
3339
}
3440

3541
const handleEnterBehaviorChange = (requireCtrlEnter: boolean) => {
3642
const newBehavior = requireCtrlEnter ? "newline" : "send"
3743
setCachedStateField("enterBehavior", newBehavior)
44+
45+
// Track telemetry event
46+
telemetryClient.capture("ui_settings_enter_behavior_changed", {
47+
behavior: newBehavior,
48+
})
3849
}
3950

4051
return (

0 commit comments

Comments
 (0)