feat(analytics): build-time bake + telemetry depth (#336)

Bake PostHog + Sentry into the published Docker image (SNAPOTTER_ANALYTICS
build arg, codegen script). Delete entire consent system. Move event emission
to BullMQ worker. Add cross-tier identity stitching, Sentry performance
tracing on both tiers, frontend funnel events. Fix stateful regex bug.

86 files changed, 1593 insertions(+), 3747 deletions(-)
This commit is contained in:
SnapOtter
2026-06-24 11:05:39 +08:00
committed by GitHub
parent a53038ed96
commit 5d36ac06d8
86 changed files with 1594 additions and 3748 deletions
+11 -1
View File
@@ -1,5 +1,5 @@
import type { Tool } from "@snapotter/shared";
import { CATEGORIES, SECTIONS, TOOLS, toolSection } from "@snapotter/shared";
import { ANALYTICS_EVENTS, CATEGORIES, SECTIONS, TOOLS, toolSection } from "@snapotter/shared";
import { ChevronDown, Search, X } from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Link, useLocation, useNavigate } from "react-router-dom";
@@ -85,6 +85,16 @@ export function HomePage() {
const searchResults = useFuseSearch(visibleTools, search);
useEffect(() => {
if (!search || search.length < 2) return;
const timer = setTimeout(() => {
import("@/lib/analytics").then(({ track }) => {
track(ANALYTICS_EVENTS.SEARCH, { query: search, results_count: searchResults.length });
});
}, 1000);
return () => clearTimeout(timer);
}, [search, searchResults.length]);
const tabTools = useMemo(() => {
if (activeTab === "all") return visibleTools;
return visibleTools.filter((tool) => toolSection(tool) === activeTab);