Skip to content

Commit 5fd2b43

Browse files
committed
remove telemetry, loosen up the "atBottom" check (50% of viewport)
1 parent 7899e99 commit 5fd2b43

3 files changed

Lines changed: 12 additions & 41 deletions

File tree

frontend/app/view/term/termwrap.ts

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
globalStore,
1414
isDev,
1515
openLink,
16-
recordTEvent,
1716
setTabIndicator,
1817
WOS,
1918
} from "@/store/global";
@@ -561,34 +560,13 @@ export class TermWrap {
561560

562561
handleViewportScroll(viewportElem: HTMLElement) {
563562
const { scrollTop, scrollHeight, clientHeight } = viewportElem;
564-
const atBottom = scrollTop + clientHeight >= scrollHeight - 20;
563+
const atBottom = scrollTop + clientHeight >= scrollHeight - clientHeight * 0.5;
565564
this.setAtBottom(atBottom);
566-
const hasScrollback = scrollHeight > clientHeight + 20;
567565
const delta = this.viewportScrollTop - scrollTop;
568-
const wasNearBottom = this.viewportScrollTop >= scrollHeight - clientHeight - 100;
569-
const shouldSendTelemetry = scrollTop === 0 && hasScrollback && delta >= 1000;
570-
if ((isDev() && delta >= 500) || shouldSendTelemetry) {
571-
const lastCmd = globalStore.get(this.lastCommandAtom) ?? "";
572-
let termCmd = "";
573-
if (/^claude\b/.test(lastCmd)) {
574-
termCmd = "claude";
575-
} else if (/^opencode\b/.test(lastCmd)) {
576-
termCmd = "opencode";
577-
}
578-
if (isDev() && delta >= 500) {
579-
console.log(
580-
`[termwrap] large-scroll blockId=${this.blockId} delta=${Math.round(delta)}px scrollTop=${scrollTop} wasNearBottom=${wasNearBottom} termCmd=${termCmd || "(none)"} sendTelemetry=${shouldSendTelemetry}`
581-
);
582-
console.log("[termwrap] recentWrites (last 50):", this.recentWrites);
583-
console.trace("[termwrap] large-scroll callstack");
584-
}
585-
if (shouldSendTelemetry) {
586-
recordTEvent("debug:termscrolltop", {
587-
"debug:scrollpx": Math.round(delta),
588-
"debug:scrollfrombot": wasNearBottom,
589-
"debug:termcmd": termCmd || undefined,
590-
});
591-
}
566+
if (isDev() && delta >= 500) {
567+
console.log(
568+
`[termwrap] large-scroll blockId=${this.blockId} delta=${Math.round(delta)}px scrollTop=${scrollTop} wasNearBottom=${atBottom}`
569+
);
592570
}
593571
this.viewportScrollTop = scrollTop;
594572
}

frontend/types/gotypes.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,9 +1469,6 @@ declare global {
14691469
"action:initiator"?: "keyboard" | "mouse";
14701470
"action:type"?: string;
14711471
"debug:panictype"?: string;
1472-
"debug:scrollpx"?: number;
1473-
"debug:scrollfrombot"?: boolean;
1474-
"debug:termcmd"?: string;
14751472
"block:view"?: string;
14761473
"block:controller"?: string;
14771474
"ai:backendtype"?: string;

pkg/telemetry/telemetrydata/telemetrydata.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ var ValidEventNames = map[string]bool{
3232

3333
"wsh:run": true,
3434

35-
"debug:panic": true,
36-
"debug:termscrolltop": true,
35+
"debug:panic": true,
3736

3837
"conn:connect": true,
3938
"conn:connecterror": true,
@@ -116,10 +115,7 @@ type TEventProps struct {
116115
ActionInitiator string `json:"action:initiator,omitempty" tstype:"\"keyboard\" | \"mouse\""`
117116
ActionType string `json:"action:type,omitempty"`
118117

119-
PanicType string `json:"debug:panictype,omitempty"`
120-
DebugScrollPx int `json:"debug:scrollpx,omitempty"`
121-
DebugScrollFromBot bool `json:"debug:scrollfrombot,omitempty"`
122-
DebugTermCmd string `json:"debug:termcmd,omitempty"`
118+
PanicType string `json:"debug:panictype,omitempty"`
123119

124120
BlockView string `json:"block:view,omitempty"`
125121
BlockController string `json:"block:controller,omitempty"`
@@ -130,11 +126,11 @@ type TEventProps struct {
130126
WshCmd string `json:"wsh:cmd,omitempty"`
131127
WshHadError bool `json:"wsh:haderror,omitempty"`
132128

133-
ConnType string `json:"conn:conntype,omitempty"`
134-
ConnWshErrorCode string `json:"conn:wsherrorcode,omitempty"`
135-
ConnErrorCode string `json:"conn:errorcode,omitempty"`
136-
ConnSubErrorCode string `json:"conn:suberrorcode,omitempty"`
137-
ConnContextError bool `json:"conn:contexterror,omitempty"`
129+
ConnType string `json:"conn:conntype,omitempty"`
130+
ConnWshErrorCode string `json:"conn:wsherrorcode,omitempty"`
131+
ConnErrorCode string `json:"conn:errorcode,omitempty"`
132+
ConnSubErrorCode string `json:"conn:suberrorcode,omitempty"`
133+
ConnContextError bool `json:"conn:contexterror,omitempty"`
138134

139135
OnboardingFeature string `json:"onboarding:feature,omitempty" tstype:"\"waveai\" | \"durable\" | \"magnify\" | \"wsh\""`
140136
OnboardingVersion string `json:"onboarding:version,omitempty"`

0 commit comments

Comments
 (0)