Skip to content

Commit e1bfca7

Browse files
committed
fix(telemetry): require explicit banner consent
1 parent 8709004 commit e1bfca7

4 files changed

Lines changed: 14 additions & 41 deletions

File tree

‎PRIVACY.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Zoo Code Privacy Policy
22

3-
**Last Updated: May 13th, 2026**
3+
**Last Updated: August 15th, 2026**
44

55
Zoo Code respects your privacy and is committed to transparency about how we
66
handle your data. Below is a simple breakdown of where key pieces of data
@@ -37,11 +37,11 @@ go—and, importantly, where they don't.
3737
Code machine ID, feature usage patterns, and exception reports. The VS Code
3838
machine ID is a persistent identifier and may be considered personal data in
3939
some jurisdictions; we use it only for product analytics and error grouping.
40-
We retain telemetry only as long as needed for product analytics and
41-
debugging. This PostHog-based telemetry does **not** collect your code or AI
40+
PostHog event data is retained for 12 months under our current project
41+
configuration. This PostHog-based telemetry does **not** collect your code or AI
4242
prompts. Telemetry is on by default. To turn it off, choose "Disabled" in
43-
the settings or in the notice shown on first use; closing that notice
44-
without a choice leaves telemetry on. Telemetry also follows VS Code's own
43+
the settings or in the notice shown on first use. The notice remains until
44+
you explicitly Accept or Decline. Telemetry also follows VS Code's own
4545
global telemetry setting: if you turn that off, Zoo Code stops sending
4646
telemetry right away, even if the Zoo Code setting says "Enabled."
4747
- **Marketplace Requests**: When you browse or search the Marketplace for Model

‎webview-ui/src/components/common/TelemetryBanner.tsx‎

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { memo, useState } from "react"
1+
import { memo } from "react"
22
import { Trans } from "react-i18next"
33
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
44

@@ -9,23 +9,12 @@ import { useAppTranslation } from "@src/i18n/TranslationContext"
99

1010
const TelemetryBanner = () => {
1111
const { t } = useAppTranslation()
12-
const [isDismissed, setIsDismissed] = useState(false)
13-
14-
// A neutral dismiss ("x") intentionally sends no message, leaving the setting
15-
// "unset" so the disclosed opt-out default (telemetry on) stays in effect.
16-
// Only an explicit Decline (-> "disabled") opts out. Only the explicit
17-
// Accept/Decline actions record the user's choice.
18-
const handleClose = () => {
19-
setIsDismissed(true)
20-
}
2112

2213
const handleAccept = () => {
23-
setIsDismissed(true)
2414
vscode.postMessage({ type: "telemetrySetting", text: "enabled" satisfies TelemetrySetting })
2515
}
2616

2717
const handleDecline = () => {
28-
setIsDismissed(true)
2918
vscode.postMessage({ type: "telemetrySetting", text: "disabled" satisfies TelemetrySetting })
3019
}
3120

@@ -37,20 +26,8 @@ const TelemetryBanner = () => {
3726
})
3827
}
3928

40-
if (isDismissed) {
41-
return null
42-
}
43-
4429
return (
45-
<div className="relative px-4 py-2.5 pr-10 bg-vscode-banner-background border-b border-vscode-panel-border text-sm leading-normal text-vscode-foreground">
46-
{/* Close button (X) - neutral dismiss, does not record a choice */}
47-
<button
48-
onClick={handleClose}
49-
className="absolute top-1.5 right-2 bg-transparent border-none text-vscode-foreground cursor-pointer text-2xl p-1 opacity-70 hover:opacity-100 transition-opacity duration-200 leading-none"
50-
aria-label="Close">
51-
×
52-
</button>
53-
30+
<div className="px-4 py-2.5 bg-vscode-banner-background border-b border-vscode-panel-border text-sm leading-normal text-vscode-foreground">
5431
<div className="mb-0.5 font-bold">{t("welcome:telemetry.helpImprove")}</div>
5532
<div className="mb-2">
5633
<Trans

‎webview-ui/src/components/common/__tests__/TelemetryBanner.spec.tsx‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,26 @@ describe("TelemetryBanner", () => {
3636
expect(screen.getByRole("button", { name: "Decline" })).toBeInTheDocument()
3737
})
3838

39-
it("sends an enabled setting and dismisses when Accept is clicked", () => {
40-
const { container } = render(<TelemetryBanner />)
39+
it("sends an enabled setting when Accept is clicked", () => {
40+
render(<TelemetryBanner />)
4141

4242
fireEvent.click(screen.getByRole("button", { name: "Accept" }))
4343

4444
expect(mockPostMessage).toHaveBeenCalledWith({ type: "telemetrySetting", text: "enabled" })
45-
expect(container.firstChild).toBeNull()
4645
})
4746

48-
it("sends a disabled setting and dismisses when Decline is clicked", () => {
49-
const { container } = render(<TelemetryBanner />)
47+
it("sends a disabled setting when Decline is clicked", () => {
48+
render(<TelemetryBanner />)
5049

5150
fireEvent.click(screen.getByRole("button", { name: "Decline" }))
5251

5352
expect(mockPostMessage).toHaveBeenCalledWith({ type: "telemetrySetting", text: "disabled" })
54-
expect(container.firstChild).toBeNull()
5553
})
5654

57-
it("dismisses without sending any message when the close (x) button is clicked", () => {
58-
const { container } = render(<TelemetryBanner />)
59-
60-
fireEvent.click(screen.getByRole("button", { name: /close/i }))
55+
it("requires an explicit telemetry choice", () => {
56+
render(<TelemetryBanner />)
6157

58+
expect(screen.getAllByRole("button").map((button) => button.textContent)).toEqual(["Accept", "Decline"])
6259
expect(mockPostMessage).not.toHaveBeenCalled()
63-
expect(container.firstChild).toBeNull()
6460
})
6561
})
-556 Bytes
Loading

0 commit comments

Comments
 (0)