Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(replay): keep embedded settings nav in-context (#64443)

Kim Svatos Dugan880d41b2493e
diff --git a/frontend/src/scenes/settings/Settings.tsx b/frontend/src/scenes/settings/Settings.tsx
index afa3c5a4141b..5c52e9710b4c 100644
--- a/frontend/src/scenes/settings/Settings.tsx
+++ b/frontend/src/scenes/settings/Settings.tsx
@@ -67,7 +67,6 @@ export function Settings({
selectedSectionId,
selectedLevel,
selectedSettingId,
- selectedSetting,
settings,
isCompactNavigationOpen,
searchTerm,
@@ -111,7 +110,15 @@ export function Settings({
// in normal flow instead, so it sits beside the content rather than overlapping.
const isFullScene = props.logicKey === 'settingsScene'
- const settingsInSidebar = props.sectionId && !!selectedSetting
+ // When embedded in a specific section (replay, logs, error tracking, etc. — anything that
+ // passes a `sectionId`), the nav always lists that section's settings as in-context sub-tabs.
+ // It must NOT depend on `selectedSetting` resolving: that value is derived from asynchronously
+ // loaded feature flags / team config, so on a cold load it is briefly null. Folding it in here
+ // made the nav fall back to the full multi-level settings map, whose items link out to
+ // `/settings/...` — which is why clicking a replay settings sub-tab would occasionally bounce
+ // the user to the top-level settings page. The standalone settings scene passes no `sectionId`
+ // and keeps the full map. (Content single-vs-stacked is decided separately in SettingsRenderer.)
+ const settingsInSidebar = !!props.sectionId
const searchItems: SearchResult[] = React.useMemo(
() => searchResults.flatMap((group) => group.results),