Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion frontend/app/aipanel/aitooluse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

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

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

const handleCancel = () => {
recordTEvent("waveai:revertfile", { "waveai:action": "revertfile:cancel" });
model.closeRestoreBackupModal();
};

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

const handleOpenDiff = () => {
recordTEvent("waveai:showdiff");
fireAndForget(() => WaveAIModel.getInstance().openDiff(toolData.inputfilename, toolData.toolcallid));
};

Expand All @@ -328,7 +332,10 @@ const AIToolUse = memo(({ part, isStreaming }: AIToolUseProps) => {
toolData.runts &&
Date.now() - toolData.runts < BackupRetentionDays * 24 * 60 * 60 * 1000 && (
<button
onClick={() => model.openRestoreBackupModal(toolData.toolcallid)}
onClick={() => {
recordTEvent("waveai:revertfile", { "waveai:action": "revertfile:open" });
model.openRestoreBackupModal(toolData.toolcallid);
}}
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"
title="Restore backup file"
>
Expand Down
1 change: 1 addition & 0 deletions frontend/types/gotypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,7 @@ declare global {
"waveai:requestdurms"?: number;
"waveai:widgetaccess"?: boolean;
"waveai:feedback"?: "good" | "bad";
"waveai:action"?: string;
$set?: TEventUserProps;
$set_once?: TEventUserProps;
};
Expand Down
47 changes: 28 additions & 19 deletions pkg/telemetry/telemetrydata/telemetrydata.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,36 @@ import (
)

var ValidEventNames = map[string]bool{
"app:startup": true,
"app:shutdown": true,
"app:activity": true,
"app:display": true,
"app:counts": true,
"action:magnify": true,
"action:settabtheme": true,
"action:runaicmd": true,
"action:createtab": true,
"action:createblock": true,
"action:openwaveai": true,
"wsh:run": true,
"debug:panic": true,
"conn:connect": true,
"conn:connecterror": true,
"app:startup": true,
"app:shutdown": true,
"app:activity": true,
"app:display": true,
"app:counts": true,

"action:magnify": true,
"action:settabtheme": true,
"action:runaicmd": true,
"action:createtab": true,
"action:createblock": true,
"action:openwaveai": true,

"wsh:run": true,

"debug:panic": true,

"conn:connect": true,
"conn:connecterror": true,

"waveai:enabletelemetry": true,
"waveai:post": true,
"waveai:feedback": true,
"onboarding:start": true,
"onboarding:skip": true,
"onboarding:fire": true,
"onboarding:githubstar": true,
"waveai:showdiff": true,
"waveai:revertfile": true,

"onboarding:start": true,
"onboarding:skip": true,
"onboarding:fire": true,
"onboarding:githubstar": true,
}

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

UserSet *TEventUserProps `json:"$set,omitempty"`
UserSetOnce *TEventUserProps `json:"$set_once,omitempty"`
Expand Down
Loading