diff --git a/app/src/pages/playground/Playground.tsx b/app/src/pages/playground/Playground.tsx index 53c451d358..865637e804 100644 --- a/app/src/pages/playground/Playground.tsx +++ b/app/src/pages/playground/Playground.tsx @@ -1,5 +1,6 @@ -import React from "react"; +import React, { useEffect } from "react"; import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"; +import { useSearchParams } from "react-router-dom"; import { css } from "@emotion/react"; import { @@ -40,6 +41,20 @@ const playgroundWrapCSS = css` export function Playground(props: InitialPlaygroundState) { const showStreamToggle = useFeatureFlag("playgroundNonStreaming"); + const [, setSearchParams] = useSearchParams(); + + useEffect(() => { + setSearchParams( + (searchParams) => { + // remove lingering selectedSpanNodeId param so as to not poison the trace details slideover + // with stale data from previous pages + searchParams.delete("selectedSpanNodeId"); + return searchParams; + }, + { replace: true } + ); + }, [setSearchParams]); + return (
diff --git a/app/src/pages/playground/SpanPlaygroundPage.tsx b/app/src/pages/playground/SpanPlaygroundPage.tsx index 8e0e13fabb..4ce8155a1f 100644 --- a/app/src/pages/playground/SpanPlaygroundPage.tsx +++ b/app/src/pages/playground/SpanPlaygroundPage.tsx @@ -28,7 +28,11 @@ export function SpanPlaygroundPage() { return ( - + ); }