diff --git a/ui/src/app/overview/page.tsx b/ui/src/app/overview/page.tsx index a78c77f..73ce435 100644 --- a/ui/src/app/overview/page.tsx +++ b/ui/src/app/overview/page.tsx @@ -1,8 +1,8 @@ "use client"; -import { Star } from 'lucide-react'; import Link from 'next/link'; +import { GitHubStarBadge } from '@/components/layout/GitHubStarBadge'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { useAuth } from '@/lib/auth'; @@ -36,17 +36,9 @@ export default function OverviewPage() { {isOSSMode && ( - +
+ +
)}
diff --git a/ui/src/app/workflow/[workflowId]/components/WorkflowEditorHeader.tsx b/ui/src/app/workflow/[workflowId]/components/WorkflowEditorHeader.tsx index b923b31..9066d57 100644 --- a/ui/src/app/workflow/[workflowId]/components/WorkflowEditorHeader.tsx +++ b/ui/src/app/workflow/[workflowId]/components/WorkflowEditorHeader.tsx @@ -385,7 +385,7 @@ export const WorkflowEditorHeader = ({ {/* GitHub star badge - desktop only */}
- +
diff --git a/ui/src/components/layout/AppLayout.tsx b/ui/src/components/layout/AppLayout.tsx index 93bdec7..e573454 100644 --- a/ui/src/components/layout/AppLayout.tsx +++ b/ui/src/components/layout/AppLayout.tsx @@ -3,9 +3,11 @@ import { Menu } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; +import posthog from "posthog-js"; import React, { ReactNode } from "react"; import { Button } from "@/components/ui/button"; +import { PostHogEvent } from "@/constants/posthog-events"; import { SidebarInset, SidebarProvider, useSidebar } from "@/components/ui/sidebar"; import { AppSidebar } from "./AppSidebar"; @@ -28,6 +30,7 @@ function AppHeader() { href="https://join.slack.com/t/dograh-community/shared_invite/zt-2z2i1p37n-CkHFbPWDCQ~hNqmKeFGJiQ" target="_blank" rel="noopener noreferrer" + onClick={() => posthog.capture(PostHogEvent.SLACK_COMMUNITY_CLICKED, { source: "app_header" })} className="flex items-center gap-2" > @@ -36,7 +39,7 @@ function AppHeader() { Join Slack - + ); diff --git a/ui/src/components/layout/AppSidebar.tsx b/ui/src/components/layout/AppSidebar.tsx index 61a92b9..62685e0 100644 --- a/ui/src/components/layout/AppSidebar.tsx +++ b/ui/src/components/layout/AppSidebar.tsx @@ -15,7 +15,6 @@ import { Megaphone, Phone, Settings, - Star, TrendingUp, Workflow, Wrench, @@ -276,52 +275,6 @@ export function AppSidebar() { )} - {/* Star us on GitHub for OSS mode - at the top */} - {provider !== "stack" && ( -
- {effectiveState === "collapsed" ? ( - - - - - - -

Star us on GitHub

-
-
-
- ) : ( - - )} -
- )} (null); + + useEffect(() => { + if (!showCount) return; + fetch("https://api.github.com/repos/dograh-hq/dograh") + .then((res) => res.json()) + .then((data) => { + if (data.stargazers_count != null) { + const count = data.stargazers_count as number; + setStarCount(count >= 1000 ? `${(count / 1000).toFixed(1)}k` : String(count)); + } + }) + .catch(() => {}); + }, [showCount]); + + const hasCount = showCount && starCount; + return ( posthog.capture(PostHogEvent.GITHUB_STAR_CLICKED, { source })} className={cn( "inline-flex items-center rounded-md border text-sm leading-none hover:opacity-80 transition-opacity", className )} > - + - Star + {label || "Star"} + {hasCount && ( + {starCount} + )} ); } diff --git a/ui/src/constants/posthog-events.ts b/ui/src/constants/posthog-events.ts index cd07602..e09244f 100644 --- a/ui/src/constants/posthog-events.ts +++ b/ui/src/constants/posthog-events.ts @@ -8,4 +8,6 @@ export const PostHogEvent = { RECORDING_PLAYED: "recording_played", TRANSCRIPT_VIEWED: "transcript_viewed", WEB_CALL_INITIATED: "web_call_initiated", + GITHUB_STAR_CLICKED: "github_star_clicked", + SLACK_COMMUNITY_CLICKED: "slack_community_clicked", } as const;