Skip to content

Commit 532feb5

Browse files
msukkariclaude
andcommitted
feat(web): add wa_askgh_repo_indexed PostHog event
Fires when a repo completes indexing on Ask GitHub, capturing the repo name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 064f9b1 commit 532feb5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/web/src/app/[domain]/askgh/[owner]/[repo]/components/repoIndexedGuard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Loader2 } from "lucide-react";
77
import { usePrevious } from "@uidotdev/usehooks";
88
import { useEffect } from "react";
99
import { useBrowserNotification } from "@/hooks/useBrowserNotification";
10+
import { captureEvent } from "@/hooks/useCaptureEvent";
1011
import { RepoInfo } from "../types";
1112

1213
const REINDEX_INTERVAL_MS = 2000;
@@ -45,9 +46,10 @@ export function RepoIndexedGuard({ initialRepoInfo, children }: Props) {
4546
}
4647
}, [initialRepoInfo.isIndexed, requestPermission]);
4748

48-
// Show notification when indexing completes
49+
// Show notification and fire event when indexing completes
4950
useEffect(() => {
5051
if (previousIsIndexed === false && repoInfo.isIndexed === true) {
52+
captureEvent('wa_askgh_repo_indexed', { repoName: repoInfo.name });
5153
const displayName = repoInfo.displayName ?? repoInfo.name;
5254
showNotification({
5355
title: "Repository Ready",

packages/web/src/lib/posthogEvents.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ export type PosthogEventMap = {
232232
},
233233
//////////////////////////////////////////////////////////////////
234234
wa_askgh_login_wall_prompted: {},
235+
wa_askgh_repo_indexed: {
236+
repoName: string,
237+
},
235238
//////////////////////////////////////////////////////////////////
236239
wa_demo_docs_link_pressed: {},
237240
wa_demo_search_example_card_pressed: {

0 commit comments

Comments
 (0)