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
2 changes: 2 additions & 0 deletions packages/types/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export enum TelemetryEventName {
TASK_CONVERSATION_MESSAGE = "Conversation Message",
LLM_COMPLETION = "LLM Completion",
MODE_SWITCH = "Mode Switched",
MODE_SELECTOR_OPENED = "Mode Selector Opened",
TOOL_USED = "Tool Used",

CHECKPOINT_CREATED = "Checkpoint Created",
Expand Down Expand Up @@ -126,6 +127,7 @@ export const rooCodeTelemetryEventSchema = z.discriminatedUnion("type", [
TelemetryEventName.TASK_COMPLETED,
TelemetryEventName.TASK_CONVERSATION_MESSAGE,
TelemetryEventName.MODE_SWITCH,
TelemetryEventName.MODE_SELECTOR_OPENED,
TelemetryEventName.TOOL_USED,
TelemetryEventName.CHECKPOINT_CREATED,
TelemetryEventName.CHECKPOINT_RESTORED,
Expand Down
6 changes: 6 additions & 0 deletions webview-ui/src/components/chat/ModeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { useExtensionState } from "@/context/ExtensionStateContext"
import { useAppTranslation } from "@/i18n/TranslationContext"
import { Mode, getAllModes } from "@roo/modes"
import { ModeConfig, CustomModePrompts } from "@roo-code/types"
import { telemetryClient } from "@/utils/TelemetryClient"
import { TelemetryEventName } from "@roo-code/types"

interface ModeSelectorProps {
value: Mode
Expand Down Expand Up @@ -37,6 +39,10 @@ export const ModeSelector = ({
const { t } = useAppTranslation()

const trackModeSelectorOpened = () => {
// Track telemetry every time the mode selector is opened
telemetryClient.capture(TelemetryEventName.MODE_SELECTOR_OPENED)

// Track first-time usage for UI purposes
if (!hasOpenedModeSelector) {
setHasOpenedModeSelector(true)
vscode.postMessage({ type: "hasOpenedModeSelector", bool: true })
Expand Down
Loading