From b12725b231a1562b854afdf565bc86dad767e188 Mon Sep 17 00:00:00 2001 From: MananTank Date: Wed, 4 Jun 2025 04:13:00 +0000 Subject: [PATCH] [TOOL-4673] Dashboard: Enable posthog session recording for nebula app (#7267) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on enhancing the `PHProvider` component by introducing a `disable_session_recording` prop, allowing for more control over session recording. Additionally, it renames the `Providers` component to `PayProviders` and `BridgeProviders` in their respective files for clarity. ### Detailed summary - Added `disable_session_recording` prop to `` in multiple files. - Renamed `Providers` to `PayProviders` in `Providers.client.tsx` and `pay/layout.tsx`. - Renamed `Providers` to `BridgeProviders` in `Providers.client.tsx` and `bridge/layout.tsx`. - Updated the `PHProvider` function signature to accept `disable_session_recording` as a prop. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit - **New Features** - Added explicit controls to enable or disable session recording across different sections of the dashboard. - **Refactor** - Renamed provider components for improved clarity in the Bridge and Pay sections. - Updated component usage to reflect new provider names. - **Style** - No visual changes introduced. - **Bug Fixes** - None. - **Documentation** - None. --- apps/dashboard/src/app/(app)/layout.tsx | 2 +- .../app/bridge/components/client/Providers.client.tsx | 4 ++-- apps/dashboard/src/app/bridge/layout.tsx | 4 ++-- apps/dashboard/src/app/nebula-app/layout.tsx | 2 +- .../app/pay/components/client/Providers.client.tsx | 4 ++-- apps/dashboard/src/app/pay/layout.tsx | 6 +++--- apps/dashboard/src/lib/posthog/Posthog.tsx | 11 +++++------ 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/apps/dashboard/src/app/(app)/layout.tsx b/apps/dashboard/src/app/(app)/layout.tsx index 06a5fca2fdd..179030a7dbe 100644 --- a/apps/dashboard/src/app/(app)/layout.tsx +++ b/apps/dashboard/src/app/(app)/layout.tsx @@ -63,7 +63,7 @@ export default function RootLayout({ /> - + - + {children} diff --git a/apps/dashboard/src/app/bridge/layout.tsx b/apps/dashboard/src/app/bridge/layout.tsx index fd657fd3380..3e49b785598 100644 --- a/apps/dashboard/src/app/bridge/layout.tsx +++ b/apps/dashboard/src/app/bridge/layout.tsx @@ -1,7 +1,7 @@ import { cn } from "@/lib/utils"; import { Inter } from "next/font/google"; import "../../global.css"; -import { Providers } from "./components/client/Providers.client"; +import { BridgeProviders } from "./components/client/Providers.client"; const fontSans = Inter({ subsets: ["latin"], @@ -22,7 +22,7 @@ export default function BridgeLayout({ fontSans.variable, )} > - {children} + {children} ); diff --git a/apps/dashboard/src/app/nebula-app/layout.tsx b/apps/dashboard/src/app/nebula-app/layout.tsx index f4bdf49beeb..927bbc8a5eb 100644 --- a/apps/dashboard/src/app/nebula-app/layout.tsx +++ b/apps/dashboard/src/app/nebula-app/layout.tsx @@ -39,7 +39,7 @@ export default function Layout(props: { - + - + {children} diff --git a/apps/dashboard/src/app/pay/layout.tsx b/apps/dashboard/src/app/pay/layout.tsx index 167fad4f10c..f78e2a8c1e0 100644 --- a/apps/dashboard/src/app/pay/layout.tsx +++ b/apps/dashboard/src/app/pay/layout.tsx @@ -2,7 +2,7 @@ import "../../global.css"; import { cn } from "@/lib/utils"; import { ThemeProvider } from "next-themes"; import { Inter } from "next/font/google"; -import { Providers } from "./components/client/Providers.client"; +import { PayProviders } from "./components/client/Providers.client"; const fontSans = Inter({ subsets: ["latin"], @@ -23,7 +23,7 @@ export default async function PayLayout({ fontSans.variable, )} > - + - + ); diff --git a/apps/dashboard/src/lib/posthog/Posthog.tsx b/apps/dashboard/src/lib/posthog/Posthog.tsx index 9c5de28adc9..3850de96679 100644 --- a/apps/dashboard/src/lib/posthog/Posthog.tsx +++ b/apps/dashboard/src/lib/posthog/Posthog.tsx @@ -7,10 +7,9 @@ import { useEffect } from "react"; const NEXT_PUBLIC_POSTHOG_API_KEY = process.env.NEXT_PUBLIC_POSTHOG_API_KEY; -export function PHProvider({ - children, -}: { +export function PHProvider(props: { children: React.ReactNode; + disable_session_recording: boolean; }) { // eslint-disable-next-line no-restricted-syntax useEffect(() => { @@ -19,10 +18,10 @@ export function PHProvider({ api_host: "https://a.thirdweb.com", capture_pageview: false, debug: false, - disable_session_recording: true, + disable_session_recording: props.disable_session_recording, }); } - }, []); + }, [props.disable_session_recording]); - return {children}; + return {props.children}; }