Skip to content

Commit 864c6bd

Browse files
committed
refactor: remove telemetry logging from documentation links in various components
1 parent 5c576f5 commit 864c6bd

File tree

4 files changed

+6
-116
lines changed

4 files changed

+6
-116
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,35 +1259,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12591259
i18nKey="chat:about"
12601260
components={{
12611261
DocsLink: (
1262-
<a
1263-
href={buildDocLink("", "welcome")}
1264-
target="_blank"
1265-
rel="noopener noreferrer"
1266-
onClick={() => {
1267-
const url = buildDocLink("", "welcome")
1268-
const event = "docs_link_clicked"
1269-
const properties = { campaign: "welcome", page: "/" }
1270-
// TEMP LOGGING: UTM Telemetry Event
1271-
// eslint-disable-next-line no-console
1272-
console.log(
1273-
"%c[Telemetry]%c Event: %c%s%c | Properties: %c%o%c | URL: %c%s",
1274-
"background: #222; color: #fff; padding:2px 4px; border-radius:2px;",
1275-
"",
1276-
"color: #4FC3F7; font-weight:bold;",
1277-
event,
1278-
"",
1279-
"color: #81C784;",
1280-
properties,
1281-
"",
1282-
"color: #FFD54F;",
1283-
url,
1284-
)
1285-
vscode.postMessage({
1286-
type: "telemetry",
1287-
event,
1288-
properties,
1289-
} as any)
1290-
}}>
1262+
<a href={buildDocLink("", "welcome")} target="_blank" rel="noopener noreferrer">
12911263
the docs
12921264
</a>
12931265
),

webview-ui/src/components/chat/CommandExecutionError.tsx

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useCallback } from "react"
22
import { useTranslation, Trans } from "react-i18next"
33
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
44
import { buildDocLink } from "../../utils/docLinks"
5-
import { vscode } from "@/utils/vscode"
65

76
export const CommandExecutionError = () => {
87
const { t } = useTranslation()
@@ -34,32 +33,7 @@ export const CommandExecutionError = () => {
3433
className="underline"
3534
style={{ color: "inherit" }}
3635
target="_blank"
37-
rel="noopener noreferrer"
38-
onClick={() => {
39-
const url = buildDocLink("troubleshooting/shell-integration/", "error_tooltip")
40-
const event = "docs_link_clicked"
41-
const properties = { campaign: "error_tooltip", page: "/troubleshooting/shell-integration/" }
42-
// TEMP LOGGING: UTM Telemetry Event
43-
// eslint-disable-next-line no-console
44-
console.log(
45-
"%c[Telemetry]%c Event: %c%s%c | Properties: %c%o%c | URL: %c%s",
46-
"background: #222; color: #fff; padding:2px 4px; border-radius:2px;",
47-
"",
48-
"color: #4FC3F7; font-weight:bold;",
49-
event,
50-
"",
51-
"color: #81C784;",
52-
properties,
53-
"",
54-
"color: #FFD54F;",
55-
url,
56-
)
57-
vscode.postMessage({
58-
type: "telemetry",
59-
event,
60-
properties,
61-
} as any)
62-
}}>
36+
rel="noopener noreferrer">
6337
{t("chat:shellIntegration.troubleshooting")}
6438
</a>
6539
</div>

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

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -288,35 +288,7 @@ const ApiOptions = ({
288288
<label className="block font-medium mb-1">{t("settings:providers.apiProvider")}</label>
289289
{docs && (
290290
<div className="text-xs text-vscode-descriptionForeground">
291-
<VSCodeLink
292-
href={docs.url}
293-
className="hover:text-vscode-foreground"
294-
target="_blank"
295-
onClick={() => {
296-
const url = docs.url
297-
const event = "docs_link_clicked"
298-
const properties = { campaign: "provider_docs", page: docs.page }
299-
// TEMP LOGGING: UTM Telemetry Event
300-
// eslint-disable-next-line no-console
301-
console.log(
302-
"%c[Telemetry]%c Event: %c%s%c | Properties: %c%o%c | URL: %c%s",
303-
"background: #222; color: #fff; padding:2px 4px; border-radius:2px;",
304-
"",
305-
"color: #4FC3F7; font-weight:bold;",
306-
event,
307-
"",
308-
"color: #81C784;",
309-
properties,
310-
"",
311-
"color: #FFD54F;",
312-
url,
313-
)
314-
vscode.postMessage({
315-
type: "telemetry",
316-
event,
317-
properties,
318-
} as any)
319-
}}>
291+
<VSCodeLink href={docs.url} className="hover:text-vscode-foreground" target="_blank">
320292
{t("settings:providers.providerDocumentation", { provider: docs.name })}
321293
</VSCodeLink>
322294
</div>

webview-ui/src/components/welcome/RooTips.tsx

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useState, useEffect } from "react"
44
import clsx from "clsx"
55

66
import { buildDocLink } from "@src/utils/docLinks"
7-
import { vscode } from "@/utils/vscode"
87

98
const tips = [
109
{
@@ -67,21 +66,8 @@ const RooTips = ({ cycle = false }: RooTipsProps) => {
6766
{" "}
6867
<span className={`codicon ${currentTip.icon}`}></span>
6968
<span>
70-
<VSCodeLink
71-
href={currentTip.href}
72-
onClick={() =>
73-
vscode.postMessage({
74-
type: "telemetry",
75-
event: "docs_link_clicked",
76-
properties: {
77-
campaign: "tips",
78-
page: currentTip.page,
79-
},
80-
} as any)
81-
}>
82-
{t(currentTip.titleKey)}
83-
</VSCodeLink>
84-
: {t(currentTip.descriptionKey)}
69+
<VSCodeLink href={currentTip.href}>{t(currentTip.titleKey)}</VSCodeLink>:{" "}
70+
{t(currentTip.descriptionKey)}
8571
</span>
8672
</div>
8773
</>
@@ -92,21 +78,7 @@ const RooTips = ({ cycle = false }: RooTipsProps) => {
9278
className="flex items-center gap-2 text-vscode-editor-foreground font-vscode max-w-[250px]">
9379
<span className={`codicon ${tip.icon}`}></span>
9480
<span>
95-
<VSCodeLink
96-
href={tip.href}
97-
onClick={() =>
98-
vscode.postMessage({
99-
type: "telemetry",
100-
event: "docs_link_clicked",
101-
properties: {
102-
campaign: "tips",
103-
page: tip.page,
104-
},
105-
} as any)
106-
}>
107-
{t(tip.titleKey)}
108-
</VSCodeLink>
109-
: {t(tip.descriptionKey)}
81+
<VSCodeLink href={tip.href}>{t(tip.titleKey)}</VSCodeLink>: {t(tip.descriptionKey)}
11082
</span>
11183
</div>
11284
))

0 commit comments

Comments
 (0)