mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Telemetry for title button clicks (#3108)
This commit is contained in:
parent
be387fa948
commit
2d8beb2ed0
2 changed files with 26 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import delay from "delay"
|
|||
|
||||
import { ClineProvider } from "../core/webview/ClineProvider"
|
||||
import { ContextProxy } from "../core/config/ContextProxy"
|
||||
import { telemetryService } from "../services/telemetry/TelemetryService"
|
||||
|
||||
import { registerHumanRelayCallback, unregisterHumanRelayCallback, handleHumanRelayResponse } from "./humanRelay"
|
||||
import { handleNewTask } from "./handleTask"
|
||||
|
|
@ -71,6 +72,8 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
|
|||
return
|
||||
}
|
||||
|
||||
telemetryService.captureTitleButtonClicked("plus")
|
||||
|
||||
await visibleProvider.removeClineFromStack()
|
||||
await visibleProvider.postStateToWebview()
|
||||
await visibleProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
|
||||
|
|
@ -82,6 +85,8 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
|
|||
return
|
||||
}
|
||||
|
||||
telemetryService.captureTitleButtonClicked("mcp")
|
||||
|
||||
visibleProvider.postMessageToWebview({ type: "action", action: "mcpButtonClicked" })
|
||||
},
|
||||
"roo-cline.promptsButtonClicked": () => {
|
||||
|
|
@ -91,9 +96,15 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
|
|||
return
|
||||
}
|
||||
|
||||
telemetryService.captureTitleButtonClicked("prompts")
|
||||
|
||||
visibleProvider.postMessageToWebview({ type: "action", action: "promptsButtonClicked" })
|
||||
},
|
||||
"roo-cline.popoutButtonClicked": () => openClineInNewTab({ context, outputChannel }),
|
||||
"roo-cline.popoutButtonClicked": () => {
|
||||
telemetryService.captureTitleButtonClicked("popout")
|
||||
|
||||
return openClineInNewTab({ context, outputChannel })
|
||||
},
|
||||
"roo-cline.openInNewTab": () => openClineInNewTab({ context, outputChannel }),
|
||||
"roo-cline.settingsButtonClicked": () => {
|
||||
const visibleProvider = getVisibleProviderOrLog(outputChannel)
|
||||
|
|
@ -102,6 +113,8 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
|
|||
return
|
||||
}
|
||||
|
||||
telemetryService.captureTitleButtonClicked("settings")
|
||||
|
||||
visibleProvider.postMessageToWebview({ type: "action", action: "settingsButtonClicked" })
|
||||
},
|
||||
"roo-cline.historyButtonClicked": () => {
|
||||
|
|
@ -111,9 +124,13 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
|
|||
return
|
||||
}
|
||||
|
||||
telemetryService.captureTitleButtonClicked("history")
|
||||
|
||||
visibleProvider.postMessageToWebview({ type: "action", action: "historyButtonClicked" })
|
||||
},
|
||||
"roo-cline.helpButtonClicked": () => {
|
||||
telemetryService.captureTitleButtonClicked("help")
|
||||
|
||||
vscode.env.openExternal(vscode.Uri.parse("https://docs.roocode.com"))
|
||||
},
|
||||
"roo-cline.showHumanRelayDialog": (params: { requestId: string; promptText: string }) => {
|
||||
|
|
|
|||
|
|
@ -145,6 +145,14 @@ class TelemetryService {
|
|||
this.captureEvent(PostHogClient.EVENTS.ERRORS.CONSECUTIVE_MISTAKE_ERROR, { taskId })
|
||||
}
|
||||
|
||||
/**
|
||||
* Captures a title button click event
|
||||
* @param button The button that was clicked
|
||||
*/
|
||||
public captureTitleButtonClicked(button: string): void {
|
||||
this.captureEvent("Title Button Clicked", { button })
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if telemetry is currently enabled
|
||||
* @returns Whether telemetry is enabled
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue