Skip to content

Commit 8c50f7b

Browse files
authored
revert file telemetry (#2538)
1 parent 0f36b1c commit 8c50f7b

File tree

3 files changed

+37
-20
lines changed

3 files changed

+37
-20
lines changed

frontend/app/aipanel/aitooluse.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { BlockModel } from "@/app/block/block-model";
55
import { Modal } from "@/app/modals/modal";
6+
import { recordTEvent } from "@/app/store/global";
67
import { cn, fireAndForget } from "@/util/util";
78
import { useAtomValue } from "jotai";
89
import { memo, useEffect, useRef, useState } from "react";
@@ -151,10 +152,12 @@ const RestoreBackupModal = memo(({ part }: RestoreBackupModalProps) => {
151152
};
152153

153154
const handleConfirm = () => {
155+
recordTEvent("waveai:revertfile", { "waveai:action": "revertfile:confirm" });
154156
model.restoreBackup(toolData.toolcallid, toolData.writebackupfilename, toolData.inputfilename);
155157
};
156158

157159
const handleCancel = () => {
160+
recordTEvent("waveai:revertfile", { "waveai:action": "revertfile:cancel" });
158161
model.closeRestoreBackupModal();
159162
};
160163

@@ -309,6 +312,7 @@ const AIToolUse = memo(({ part, isStreaming }: AIToolUseProps) => {
309312
};
310313

311314
const handleOpenDiff = () => {
315+
recordTEvent("waveai:showdiff");
312316
fireAndForget(() => WaveAIModel.getInstance().openDiff(toolData.inputfilename, toolData.toolcallid));
313317
};
314318

@@ -328,7 +332,10 @@ const AIToolUse = memo(({ part, isStreaming }: AIToolUseProps) => {
328332
toolData.runts &&
329333
Date.now() - toolData.runts < BackupRetentionDays * 24 * 60 * 60 * 1000 && (
330334
<button
331-
onClick={() => model.openRestoreBackupModal(toolData.toolcallid)}
335+
onClick={() => {
336+
recordTEvent("waveai:revertfile", { "waveai:action": "revertfile:open" });
337+
model.openRestoreBackupModal(toolData.toolcallid);
338+
}}
332339
className="flex-shrink-0 px-1.5 py-0.5 border border-gray-600 hover:border-gray-500 hover:bg-gray-700 rounded cursor-pointer transition-colors flex items-center gap-1 text-gray-400"
333340
title="Restore backup file"
334341
>

frontend/types/gotypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,7 @@ declare global {
11461146
"waveai:requestdurms"?: number;
11471147
"waveai:widgetaccess"?: boolean;
11481148
"waveai:feedback"?: "good" | "bad";
1149+
"waveai:action"?: string;
11491150
$set?: TEventUserProps;
11501151
$set_once?: TEventUserProps;
11511152
};

pkg/telemetry/telemetrydata/telemetrydata.go

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,36 @@ import (
1414
)
1515

1616
var ValidEventNames = map[string]bool{
17-
"app:startup": true,
18-
"app:shutdown": true,
19-
"app:activity": true,
20-
"app:display": true,
21-
"app:counts": true,
22-
"action:magnify": true,
23-
"action:settabtheme": true,
24-
"action:runaicmd": true,
25-
"action:createtab": true,
26-
"action:createblock": true,
27-
"action:openwaveai": true,
28-
"wsh:run": true,
29-
"debug:panic": true,
30-
"conn:connect": true,
31-
"conn:connecterror": true,
17+
"app:startup": true,
18+
"app:shutdown": true,
19+
"app:activity": true,
20+
"app:display": true,
21+
"app:counts": true,
22+
23+
"action:magnify": true,
24+
"action:settabtheme": true,
25+
"action:runaicmd": true,
26+
"action:createtab": true,
27+
"action:createblock": true,
28+
"action:openwaveai": true,
29+
30+
"wsh:run": true,
31+
32+
"debug:panic": true,
33+
34+
"conn:connect": true,
35+
"conn:connecterror": true,
36+
3237
"waveai:enabletelemetry": true,
3338
"waveai:post": true,
3439
"waveai:feedback": true,
35-
"onboarding:start": true,
36-
"onboarding:skip": true,
37-
"onboarding:fire": true,
38-
"onboarding:githubstar": true,
40+
"waveai:showdiff": true,
41+
"waveai:revertfile": true,
42+
43+
"onboarding:start": true,
44+
"onboarding:skip": true,
45+
"onboarding:fire": true,
46+
"onboarding:githubstar": true,
3947
}
4048

4149
type TEvent struct {
@@ -137,6 +145,7 @@ type TEventProps struct {
137145
WaveAIRequestDurMs int `json:"waveai:requestdurms,omitempty"` // ms
138146
WaveAIWidgetAccess bool `json:"waveai:widgetaccess,omitempty"`
139147
WaveAIFeedback string `json:"waveai:feedback,omitempty" tstype:"\"good\" | \"bad\""`
148+
WaveAIAction string `json:"waveai:action,omitempty"`
140149

141150
UserSet *TEventUserProps `json:"$set,omitempty"`
142151
UserSetOnce *TEventUserProps `json:"$set_once,omitempty"`

0 commit comments

Comments
 (0)