mirror of
https://github.com/cline/cline.git
synced 2026-09-19 02:05:44 +08:00
* feat(desktop): add pull request links and merge/CI status * fix(desktop): align PR status colors with merge readiness * feat(desktop): track pull request feature interactions * fix(desktop): use camelCase PR telemetry properties * fix(desktop): hide unavailable PR integration and throttle retries --------- Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
18 lines
612 B
TypeScript
18 lines
612 B
TypeScript
import type { ITelemetryService } from "@cline/shared";
|
|
import { pullRequestTelemetrySchema } from "../webview/lib/pull-request-telemetry-schema";
|
|
|
|
export function capturePullRequestEvent(
|
|
telemetry: ITelemetryService | undefined,
|
|
input: unknown,
|
|
): void {
|
|
const parsed = pullRequestTelemetrySchema.safeParse(input);
|
|
if (!parsed.success) return;
|
|
try {
|
|
if (!telemetry?.isEnabled()) return;
|
|
const { action, ...properties } = parsed.data;
|
|
telemetry.capture({ event: `desktop.pull_request.${action}`, properties });
|
|
} catch {
|
|
// Product interactions must continue if the telemetry provider fails.
|
|
}
|
|
}
|