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(settings): redirect removed toolbar section to web analytics (#67019)

posthog[bot]97295889b4df
diff --git a/frontend/src/scenes/settings/settingsSceneLogic.test.ts b/frontend/src/scenes/settings/settingsSceneLogic.test.ts
index 6db623aab9b2..95bad77075d6 100644
--- a/frontend/src/scenes/settings/settingsSceneLogic.test.ts
+++ b/frontend/src/scenes/settings/settingsSceneLogic.test.ts
@@ -120,6 +120,37 @@ describe('settingsSceneLogic', () => {
expect(router.values.hashParams).toHaveProperty('internal-user-filtering')
})
+ it('redirects the removed toolbar section to web analytics', async () => {
+ router.actions.push('/settings/project-toolbar')
+
+ await expectLogic(logic).toMatchValues({
+ selectedLevel: 'project',
+ selectedSectionId: 'project-web-analytics',
+ })
+ expect(router.values.location.pathname).toContain('/settings/project-web-analytics')
+
+ router.actions.push('/settings/environment-toolbar')
+
+ await expectLogic(logic).toMatchValues({
+ selectedLevel: 'project',
+ selectedSectionId: 'project-web-analytics',
+ })
+ expect(router.values.location.pathname).toContain('/settings/project-web-analytics')
+ })
+
+ it('rewrites the legacy toolbar authorized-urls deep link to the web analytics setting', async () => {
+ router.actions.push('/settings/project-toolbar', {}, { 'authorized-urls': null })
+
+ await expectLogic(logic).toMatchValues({
+ selectedLevel: 'project',
+ selectedSectionId: 'project-web-analytics',
+ })
+ expect(router.values.location.pathname).toContain('/settings/project-web-analytics')
+ expect(router.values.location.hash).toBe('#web-analytics-authorized-urls')
+ expect(router.values.hashParams).toHaveProperty('web-analytics-authorized-urls')
+ expect(router.values.hashParams).not.toHaveProperty('authorized-urls')
+ })
+
it('redirects level-only URLs to first section', async () => {
// Each push switches to a different level, so no section at the target level is
// selected yet and the redirect to the first section runs.
diff --git a/frontend/src/scenes/settings/settingsSceneLogic.ts b/frontend/src/scenes/settings/settingsSceneLogic.ts
index fa2ac5e255e3..b35f53b19fa6 100644
--- a/frontend/src/scenes/settings/settingsSceneLogic.ts
+++ b/frontend/src/scenes/settings/settingsSceneLogic.ts
@@ -17,10 +17,16 @@ import type { Setting, SettingSection } from './types'
const AI_OBSERVABILITY_SETTINGS_SECTION: SettingSectionId = 'project-ai-observability'
const AI_OBSERVABILITY_BYOK_SETTING: SettingId = 'ai-observability-byok'
const LEGACY_LLM_ANALYTICS_BYOK_SETTING = 'llm-analytics-byok'
+const WEB_ANALYTICS_SETTINGS_SECTION: SettingSectionId = 'project-web-analytics'
+const WEB_ANALYTICS_AUTHORIZED_URLS_SETTING: SettingId = 'web-analytics-authorized-urls'
+const LEGACY_TOOLBAR_AUTHORIZED_URLS_SETTING = 'authorized-urls'
const LEGACY_SETTINGS_SECTIONS: Record<string, SettingSectionId> = {
'environment-llm-analytics': AI_OBSERVABILITY_SETTINGS_SECTION,
'project-llm-analytics': AI_OBSERVABILITY_SETTINGS_SECTION,
+ // The dedicated Toolbar section was removed; its authorized-URL config now lives under Web analytics.
+ 'environment-toolbar': WEB_ANALYTICS_SETTINGS_SECTION,
+ 'project-toolbar': WEB_ANALYTICS_SETTINGS_SECTION,
}
// Settings that moved to a different section, keyed by setting id. Deep links to the old
@@ -82,6 +88,25 @@ const canonicalSettingsHashParams = (hashParams: Params): [Params, boolean] => {
changed = true
}
+ // The toolbar `#authorized-urls` deep link now points at the Web analytics domains setting.
+ if (hasHashParam(nextHashParams, LEGACY_TOOLBAR_AUTHORIZED_URLS_SETTING)) {
+ delete nextHashParams[LEGACY_TOOLBAR_AUTHORIZED_URLS_SETTING]
+ nextHashParams[WEB_ANALYTICS_AUTHORIZED_URLS_SETTING] = null
+ changed = true
+ }
+
+ if (nextHashParams.setting === LEGACY_TOOLBAR_AUTHORIZED_URLS_SETTING) {
+ nextHashParams.setting = WEB_ANALYTICS_AUTHORIZED_URLS_SETTING
+ nextHashParams[WEB_ANALYTICS_AUTHORIZED_URLS_SETTING] = null
+ changed = true
+ }
+
+ if (nextHashParams.selectedSetting === LEGACY_TOOLBAR_AUTHORIZED_URLS_SETTING) {
+ nextHashParams.selectedSetting = WEB_ANALYTICS_AUTHORIZED_URLS_SETTING
+ nextHashParams[WEB_ANALYTICS_AUTHORIZED_URLS_SETTING] = null
+ changed = true
+ }
+
return [nextHashParams, changed]
}
diff --git a/frontend/src/scenes/settings/types.ts b/frontend/src/scenes/settings/types.ts
index 93e6ea830267..1c3df58f50b9 100644
--- a/frontend/src/scenes/settings/types.ts
+++ b/frontend/src/scenes/settings/types.ts
@@ -58,6 +58,7 @@ export type SettingSectionId =
| 'project-product-analytics'
| 'project-replay'
| 'project-surveys'
+ | 'project-web-analytics'
| 'project-danger-zone'
// Organization
| 'organization-details'