: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(navigation): per-user sidebar customization via ui_configuration (#74278)
Fernando Gomes69ded3864cc7
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 5235cbf12076..3edfcc6513da 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7094,6 +7094,10 @@ snapshots:hash: v1.k794b7964.dc6b6575cab56e03e45623a66310f420afe58dea530cff4b14e4f498ec74372b.LaVjuAO7tExYpsnsG9uV2MsCUVihAsA_rroSnQ1Jf44scenes-app-settings-user--settings-user-danger-zone--light:hash: v1.k794b7964.96846d7823357e89a9d91350f6f435373fe287f713250b59ccce2dbd31b6f69c.kl21kygOhH1SlNOJ6VekMMlGUuyNg5Ka7NXFoHcG6M0+ scenes-app-settings-user--settings-user-navigation--dark:+ hash: v1.k794b7964.68e19b6597e184cfa2953dc29e234545cf800d0b82cb7d1f29b1fc0d56802c25.0jGd_KRf9U-UvFIdYhGpFZBnIjnD9NP-9oIvIJ9QFjs+ scenes-app-settings-user--settings-user-navigation--light:+ hash: v1.k794b7964.78cc9b0da938b3d09c8053de11dc396961b566d87a27e7c07134457ce23aea82.x1XNnjEtqJ9scvL7-t_t0MvTFXeuveiQImx1NUWptqEscenes-app-settings-user--settings-user-notifications--dark:hash: v1.k794b7964.a09a57f1c0bbcebf82942edebeba7772b2f684ba235bcef3a816aec2beb4cbce.AtQZhdZeeMVvpcmyBhPvprSMZawliTZaIFE5G8M_MVgscenes-app-settings-user--settings-user-notifications--light:diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.tsindex 3031e5ef8cde..2bf033947352 100644--- a/frontend/src/generated/core/api.schemas.ts+++ b/frontend/src/generated/core/api.schemas.ts@@ -3571,6 +3571,8 @@ export interface UserApi {passkeys_enabled_for_2fa?: boolean | null/** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */hide_mcp_hints?: boolean+ /** Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown. */+ ui_configuration?: unknown/** @nullable */readonly onboarding_skipped_at: string | nullreadonly onboarding_skipped_reason: OnboardingSkippedReasonEnumApi | null@@ -3678,6 +3680,8 @@ export interface PatchedUserApi {passkeys_enabled_for_2fa?: boolean | null/** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */hide_mcp_hints?: boolean+ /** Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown. */+ ui_configuration?: unknown/** @nullable */readonly onboarding_skipped_at?: string | nullreadonly onboarding_skipped_reason?: OnboardingSkippedReasonEnumApi | nulldiff --git a/frontend/src/generated/core/api.zod.ts b/frontend/src/generated/core/api.zod.tsindex dd7672286d81..149dcd9ac962 100644--- a/frontend/src/generated/core/api.zod.ts+++ b/frontend/src/generated/core/api.zod.ts@@ -9877,6 +9877,12 @@ export const UsersUpdateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})/**@@ -9962,6 +9968,12 @@ export const UsersPartialUpdateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})export const usersHedgehogConfigPartialUpdateBodyFirstNameMax = 150@@ -10044,6 +10056,12 @@ export const UsersHedgehogConfigPartialUpdateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})/**@@ -10260,6 +10278,12 @@ export const UsersScenePersonalisationCreateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})/**@@ -10345,6 +10369,12 @@ export const UsersTwoFactorBackupCodesCreateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})/**@@ -10430,6 +10460,12 @@ export const UsersTwoFactorDisableCreateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})export const usersTwoFactorValidateCreateBodyFirstNameMax = 150@@ -10512,6 +10548,12 @@ export const UsersTwoFactorValidateCreateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})export const usersValidate2faCreateBodyFirstNameMax = 150@@ -10594,6 +10636,12 @@ export const UsersValidate2faCreateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})export const usersCancelEmailChangeRequestPartialUpdateBodyFirstNameMax = 150@@ -10676,6 +10724,12 @@ export const UsersCancelEmailChangeRequestPartialUpdateBody = /* @__PURE__ */ zo.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})export const usersRequestEmailVerificationCreateBodyFirstNameMax = 150@@ -10758,6 +10812,12 @@ export const UsersRequestEmailVerificationCreateBody = /* @__PURE__ */ zod.objec.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})export const usersVerifyEmailCreateBodyFirstNameMax = 150@@ -10840,4 +10900,10 @@ export const UsersVerifyEmailCreateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})diff --git a/frontend/src/layout/panel-layout/NavBarFooter.tsx b/frontend/src/layout/panel-layout/NavBarFooter.tsxindex 8ff6114ef6de..78fe7f0c3990 100644--- a/frontend/src/layout/panel-layout/NavBarFooter.tsx+++ b/frontend/src/layout/panel-layout/NavBarFooter.tsx@@ -19,11 +19,14 @@ import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'import { cn } from 'lib/utils/css-classes'import { urls } from 'scenes/urls'+import { uiCustomizationLogic } from '~/layout/uiCustomizationLogic'+import { InstallationStatusNavButton } from './InstallationStatusNavButton'export function NavBarFooter({ isLayoutNavCollapsed }: { isLayoutNavCollapsed: boolean }): JSX.Element {const isNotificationsEnabled = useFeatureFlag('REAL_TIME_NOTIFICATIONS')const { featureFlags } = useValues(featureFlagLogic)+ const { isSidebarItemShown } = useValues(uiCustomizationLogic)const { toggleCommand } = useActions(commandLogic)const showSearchHint = featureFlags[FEATURE_FLAGS.CMD_K_NAV_EXPERIMENT] === 'footer-hint'@@ -71,7 +74,9 @@ export function NavBarFooter({ isLayoutNavCollapsed }: { isLayoutNavCollapsed: b)}</ButtonPrimitive>)}- {isNotificationsEnabled && <NotificationsMenu iconOnly={isLayoutNavCollapsed} />}+ {isNotificationsEnabled && isSidebarItemShown('notifications') && (+ <NotificationsMenu iconOnly={isLayoutNavCollapsed} />+ )}<InstallationStatusNavButton iconOnly={isLayoutNavCollapsed} /><Linkto={urls.settings('project')}@@ -83,7 +88,7 @@ export function NavBarFooter({ isLayoutNavCollapsed }: { isLayoutNavCollapsed: b<IconGear />{!isLayoutNavCollapsed && 'Settings'}</Link>- <HelpMenu iconOnly={isLayoutNavCollapsed} />+ {isSidebarItemShown('help') && <HelpMenu iconOnly={isLayoutNavCollapsed} />}<PosthogStatusShownOnlyIfNotOperational iconOnly={isLayoutNavCollapsed} /></div></div>diff --git a/frontend/src/layout/panel-layout/ProjectTree/customProductsLogic.test.ts b/frontend/src/layout/panel-layout/ProjectTree/customProductsLogic.test.tsnew file mode 100644index 000000000000..9f232a21f146--- /dev/null+++ b/frontend/src/layout/panel-layout/ProjectTree/customProductsLogic.test.ts@@ -0,0 +1,82 @@+import { expectLogic } from 'kea-test-utils'++import { useMocks } from '~/mocks/jest'+import { UserProductListItem, UserProductListReason } from '~/queries/schema/schema-general'+import { initKeaTests } from '~/test/init'++import { customProductsLogic } from './customProductsLogic'++const serverRow = (productPath: string): UserProductListItem => ({+ id: `id-${productPath}`,+ product_path: productPath,+ enabled: true,+ reason: UserProductListReason.PRODUCT_INTENT,+ reason_text: null,+ created_at: '2026-01-01T00:00:00Z',+ updated_at: '2026-01-01T00:00:00Z',+})++describe('customProductsLogic', () => {+ let logic: ReturnType<typeof customProductsLogic.build>+ let listCalls: number+ let serverPaths: string[]+ let failBulkUpdate: boolean++ beforeEach(() => {+ listCalls = 0+ serverPaths = []+ failBulkUpdate = false+ useMocks({+ get: {+ '/api/environments/:team_id/user_product_list/': () => {+ listCalls += 1+ return [200, { results: serverPaths.map(serverRow) }]+ },+ },+ patch: {+ '/api/environments/:team_id/user_product_list/bulk_update/': () =>+ failBulkUpdate ? [400, { detail: 'nope' }] : [200, { results: [] }],+ },+ })+ initKeaTests()+ logic = customProductsLogic()+ logic.mount()+ })++ afterEach(() => {+ logic?.unmount()+ })++ it('keeps a toggle made while an earlier save was in flight', async () => {+ // The server still only knows about tool A. A refetch on A's success would answer with+ // just A and wipe B off the screen, which is what the user notices.+ serverPaths = ['a']++ await expectLogic(logic, () => {+ logic.actions.setToolEnabled('a', true)+ logic.actions.setToolEnabled('b', true)+ }).toFinishAllListeners()++ expect(logic.values.enabledToolPaths).toEqual(new Set(['a', 'b']))+ })++ it('does not refetch when a save succeeds', async () => {+ await expectLogic(logic, () => {+ logic.actions.setToolEnabled('a', true)+ }).toFinishAllListeners()++ expect(listCalls).toBe(0)+ })++ it('refetches to revert the optimistic row when a save fails', async () => {+ failBulkUpdate = true+ serverPaths = []++ await expectLogic(logic, () => {+ logic.actions.setToolEnabled('a', true)+ }).toFinishAllListeners()++ expect(listCalls).toBe(1)+ expect(logic.values.enabledToolPaths).toEqual(new Set())+ })+})diff --git a/frontend/src/layout/panel-layout/ProjectTree/customProductsLogic.tsx b/frontend/src/layout/panel-layout/ProjectTree/customProductsLogic.tsxindex 31a040f6dd3d..fae98132a65d 100644--- a/frontend/src/layout/panel-layout/ProjectTree/customProductsLogic.tsx+++ b/frontend/src/layout/panel-layout/ProjectTree/customProductsLogic.tsx@@ -1,15 +1,19 @@-import { MakeLogicType, kea, path } from 'kea'+import { MakeLogicType, actions, kea, listeners, path, selectors } from 'kea'import { loaders } from 'kea-loaders'+import posthog from 'posthog-js'++import { lemonToast } from '@posthog/lemon-ui'import api from 'lib/api'import { getAppContext } from 'lib/utils/getAppContext'-import type { UserProductListItem } from '~/queries/schema/schema-general'+import { UserProductListItem, UserProductListReason } from '~/queries/schema/schema-general'// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface customProductsLogicValues {customProducts: UserProductListItem[]customProductsLoading: boolean+ enabledToolPaths: Set<string>}// Generated by kea-typegen. Update if you're an agent, ignore if you're human.@@ -29,12 +33,34 @@ export interface customProductsLogicActions {customProducts: UserProductListItem[]payload?: any}+ setToolEnabled: (+ productPath: string,+ enabled: boolean+ ) => {+ enabled: boolean+ productPath: string+ }}-export type customProductsLogicType = MakeLogicType<customProductsLogicValues, customProductsLogicActions>+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface customProductsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ enabledToolPaths: (customProducts: UserProductListItem[]) => Set<string>+ }+}++export type customProductsLogicType = MakeLogicType<+ customProductsLogicValues,+ customProductsLogicActions,+ Record<string, any>,+ customProductsLogicMeta+>export const customProductsLogic = kea<customProductsLogicType>([path(['layout', 'panel-layout', 'ProjectTree', 'customProductsLogic']),+ actions({+ setToolEnabled: (productPath: string, enabled: boolean) => ({ productPath, enabled }),+ }),loaders(() => ({customProducts: [getAppContext()?.custom_products ?? [],@@ -47,4 +73,45 @@ export const customProductsLogic = kea<customProductsLogicType>([},],})),+ selectors({+ enabledToolPaths: [+ (s) => [s.customProducts],+ (customProducts: UserProductListItem[]): Set<string> =>+ new Set(customProducts.map((item) => item.product_path)),+ ],+ }),+ listeners(({ actions, values }) => ({+ setToolEnabled: async ({ productPath, enabled }) => {+ posthog.capture('sidebar my tools changed', { product_path: productPath, enabled })+ // Placeholder row: every consumer reads `product_path` only, so the fields the server+ // would fill in are never looked at and there is nothing to reconcile on success.+ const now = new Date().toISOString()+ const withoutTool = values.customProducts.filter((item) => item.product_path !== productPath)+ actions.loadCustomProductsSuccess(+ enabled+ ? [+ ...withoutTool,+ {+ id: '',+ product_path: productPath,+ enabled: true,+ reason: UserProductListReason.PRODUCT_INTENT,+ reason_text: null,+ created_at: now,+ updated_at: now,+ },+ ]+ : withoutTool+ )+ try {+ await api.userProductList.bulkUpdate([{ product_path: productPath, enabled }])+ } catch (error) {+ console.error('Failed to save tool changes:', error)+ lemonToast.error('Failed to save some changes. Try again?')+ // Only refetch to undo the failed toggle. Refetching on success would race a+ // toggle the user made while this call was in flight, reverting it on screen.+ actions.loadCustomProducts()+ }+ },+ })),])diff --git a/frontend/src/layout/panel-layout/ProjectTree/menus/MenuItems.tsx b/frontend/src/layout/panel-layout/ProjectTree/menus/MenuItems.tsxindex 70e7ff120b1b..502dcaf1bf43 100644--- a/frontend/src/layout/panel-layout/ProjectTree/menus/MenuItems.tsx+++ b/frontend/src/layout/panel-layout/ProjectTree/menus/MenuItems.tsx@@ -37,9 +37,9 @@ import { groupAnalyticsConfigLogic } from 'scenes/settings/environment/groupAnalimport { FileSystemEntry } from '~/queries/schema/schema-general'-import { editToolsLogic } from '../../ai-first/tabs/editToolsLogic'import { NewMenu } from '../../menus/NewMenu'import { panelLayoutLogic } from '../../panelLayoutLogic'+import { customProductsLogic } from '../customProductsLogic'import { projectTreeDataLogic } from '../projectTreeDataLogic'import { projectTreeLogic } from '../projectTreeLogic'import { joinPath, splitPath } from '../utils'@@ -72,7 +72,7 @@ export function MenuItems({const { deleteShortcut, addShortcutItem } = useActions(projectTreeDataLogic)const { groupTypes } = useValues(groupAnalyticsConfigLogic)const { deleteGroupType } = useActions(groupAnalyticsConfigLogic)- const { selectedPaths: customProductsSelectedPaths } = useValues(editToolsLogic)+ const { enabledToolPaths: customProductsSelectedPaths } = useValues(customProductsLogic)const projectTreeLogicProps = { key: logicKey ?? uniqueKey, root }const { checkedItems, checkedItemCountNumeric, checkedItemsArray } = useValues(@@ -91,7 +91,7 @@ export function MenuItems({} = useActions(projectTreeLogic(projectTreeLogicProps))const { openMoveToModal } = useActions(moveToLogic)const { openLinkToModal } = useActions(linkToLogic)- const { toggleTool } = useActions(editToolsLogic)+ const { setToolEnabled } = useActions(customProductsLogic)const { resetPanelLayout } = useActions(panelLayoutLogic)@@ -284,7 +284,7 @@ export function MenuItems({asChildonClick={(e) => {e.stopPropagation()- toggleTool(item.record!.path as string)+ setToolEnabled(item.record!.path as string, false)}}><ButtonPrimitive menuItem>Remove from sidebar panel</ButtonPrimitive>@@ -296,7 +296,7 @@ export function MenuItems({asChildonClick={(e) => {e.stopPropagation()- toggleTool(item.record!.path as string)+ setToolEnabled(item.record!.path as string, true)}}><ButtonPrimitive menuItem>Add to sidebar panel</ButtonPrimitive>diff --git a/frontend/src/layout/panel-layout/ai-first/tabs/NavTabBrowse.tsx b/frontend/src/layout/panel-layout/ai-first/tabs/NavTabBrowse.tsxindex 968ad2021334..34f0b7cf5c8d 100644--- a/frontend/src/layout/panel-layout/ai-first/tabs/NavTabBrowse.tsx+++ b/frontend/src/layout/panel-layout/ai-first/tabs/NavTabBrowse.tsx@@ -1,17 +1,19 @@import { useActions, useValues } from 'kea'+import { router } from 'kea-router'import posthog from 'posthog-js'import { Fragment } from 'react'import {IconApps,+ IconCheck,IconChevronRight,IconClock,IconDatabase,IconFolder,IconFolderOpen,+ IconGear,IconHome,IconNotification,- IconCheck,IconPencil,IconSearch,IconStar,@@ -39,10 +41,12 @@ import { urls } from 'scenes/urls'import { navigationLogic } from '~/layout/navigation/navigationLogic'import { NavLink } from '~/layout/panel-layout/ai-first/NavLink'import { PanelLayoutNavIdentifier, panelLayoutLogic } from '~/layout/panel-layout/panelLayoutLogic'+import { customProductsLogic } from '~/layout/panel-layout/ProjectTree/customProductsLogic'import { iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'import { ProjectTree } from '~/layout/panel-layout/ProjectTree/ProjectTree'import { projectTreeDataLogic } from '~/layout/panel-layout/ProjectTree/projectTreeDataLogic'import { joinPath, splitPath, unescapePath } from '~/layout/panel-layout/ProjectTree/utils'+import { SidebarItemKey, uiCustomizationLogic } from '~/layout/uiCustomizationLogic'import { FileSystemEntry, FileSystemIconType } from '~/queries/schema/schema-general'import { ActivityTab } from '~/types'@@ -53,24 +57,34 @@ import { navRecentsLogic } from './navRecentsLogic'const panelTriggerItems: {identifier: PanelLayoutNavIdentifier+ configKey: SidebarItemKeylabel: stringicon: React.ReactNode}[] = [{identifier: 'DataAndPeople',+ configKey: 'data',label: 'Data',icon: <IconDatabase />,},{identifier: 'Project',+ configKey: 'files',label: 'Files',icon: <IconFolderOpen className="stroke-[1.2]" />,},{identifier: 'Products',+ configKey: 'tools',label: 'Tools',icon: <IconApps />,},+ {+ identifier: 'Shortcuts',+ configKey: 'starred',+ label: 'Starred',+ icon: <IconStar />,+ },]function getItemName(item: FileSystemEntry): string {@@ -165,6 +179,9 @@ export function NavTabBrowse(): JSX.Element {const { featureFlags } = useValues(featureFlagLogic)const isProductAutonomyEnabled = useFeatureFlag('PRODUCT_AUTONOMY')const { recentItems, recentItemsLoading } = useValues(navRecentsLogic)+ const { isSidebarSectionShown, isSidebarItemShown, uiCustomizationEnabled } = useValues(uiCustomizationLogic)+ const { enabledToolPaths } = useValues(customProductsLogic)+ // Flag-off path: the pre-customization edit mode and home modal.const { isEditMode, checkedTools } = useValues(editToolsLogic)const { enterEditMode, saveAndExitEditMode, toggleTool } = useActions(editToolsLogic)const { showConfigureHomeModal } = useActions(navigationLogic)@@ -206,21 +223,26 @@ export function NavTabBrowse(): JSX.Element {<SectionTrigger icon={<IconFolder />} label="Project" isCollapsed={isLayoutNavCollapsed} />)}<Collapsible.Panel className={cn('pl-2 pt-1', isLayoutNavCollapsed && 'items-center pl-0')}>- <NavLink- to={urls.projectRoot()}- label="Home"- icon={<IconHome />}- isCollapsed={isLayoutNavCollapsed}- data-attr="nav-item-home"- onClick={() => posthog.capture('nav item clicked', { item: 'home' })}- sideAction={{- onClick: () => showConfigureHomeModal(),- tooltip: 'Configure home',- 'data-attr': 'nav-configure-home',- }}- />+ {isSidebarItemShown('home') && (+ <NavLink+ to={urls.projectRoot()}+ label="Home"+ icon={<IconHome />}+ isCollapsed={isLayoutNavCollapsed}+ data-attr="nav-item-home"+ onClick={() => posthog.capture('nav item clicked', { item: 'home' })}+ sideAction={{+ onClick: () =>+ uiCustomizationEnabled+ ? router.actions.push(urls.settings('user-navigation', 'homepage'))+ : showConfigureHomeModal(),+ tooltip: 'Configure home',+ 'data-attr': 'nav-configure-home',+ }}+ />+ )}- {isProductAutonomyEnabled && (+ {isProductAutonomyEnabled && isSidebarItemShown('inbox') && (<NavLinkto={urls.inbox()}label="Inbox"@@ -242,88 +264,92 @@ export function NavTabBrowse(): JSX.Element {/><div className={cn('flex flex-col gap-px', isLayoutNavCollapsed && 'items-center')}>- {panelTriggerItems.map((item) => {- const isActive =- activePanelIdentifier === item.identifier ||- activePanelIdentifierFromUrlAiFirst === item.identifier- const tooltip = isLayoutNavCollapsed- ? isLayoutPanelVisible && activePanelIdentifier === item.identifier- ? `Close ${item.label.toLowerCase()}`- : `Open ${item.label.toLowerCase()}`- : undefined+ {panelTriggerItems+ // Starred only joined the trigger list with customization; keep the old layout without it.+ .filter((item) => uiCustomizationEnabled || item.configKey !== 'starred')+ .filter((item) => isSidebarItemShown(item.configKey))+ .map((item) => {+ const isActive =+ activePanelIdentifier === item.identifier ||+ activePanelIdentifierFromUrlAiFirst === item.identifier+ const tooltip = isLayoutNavCollapsed+ ? isLayoutPanelVisible && activePanelIdentifier === item.identifier+ ? `Close ${item.label.toLowerCase()}`+ : `Open ${item.label.toLowerCase()}`+ : undefined- return (- <Fragment key={item.identifier}>- <ButtonPrimitive- active={isActive}- className="group -outline-offset-2"- menuItem={!isLayoutNavCollapsed}- iconOnly={isLayoutNavCollapsed}- tooltip={tooltip}- tooltipPlacement="right"- onClick={() => handlePanelTriggerClick(item.identifier)}- data-attr={`menu-item-${item.identifier.toLowerCase()}`}- >- <span- className={cn(- 'relative size-4 text-secondary group-hover:text-primary opacity-50 group-hover:opacity-100 transition-all duration-50',- isActive && 'text-primary opacity-100'- )}+ return (+ <Fragment key={item.identifier}>+ <ButtonPrimitive+ active={isActive}+ className="group -outline-offset-2"+ menuItem={!isLayoutNavCollapsed}+ iconOnly={isLayoutNavCollapsed}+ tooltip={tooltip}+ tooltipPlacement="right"+ onClick={() => handlePanelTriggerClick(item.identifier)}+ data-attr={`menu-item-${item.identifier.toLowerCase()}`}>- {item.icon}+ <span+ className={cn(+ 'relative size-4 text-secondary group-hover:text-primary opacity-50 group-hover:opacity-100 transition-all duration-50',+ isActive && 'text-primary opacity-100'+ )}+ >+ {item.icon}- <PanelIndicatorIcon />- </span>- {!isLayoutNavCollapsed && (- <>- <span- className={cn(- 'truncate text-secondary group-hover:text-primary',- isActive && 'text-primary'- )}- >- {item.label}- </span>- <span className="ml-auto pr-1">- <IconChevronRight+ <PanelIndicatorIcon />+ </span>+ {!isLayoutNavCollapsed && (+ <>+ <spanclassName={cn(- 'size-3 text-secondary opacity-50 group-hover:opacity-100 transition-all duration-50',- isActive && 'opacity-100'+ 'truncate text-secondary group-hover:text-primary',+ isActive && 'text-primary')}- />+ >+ {item.label}+ </span>+ <span className="ml-auto pr-1">+ <IconChevronRight+ className={cn(+ 'size-3 text-secondary opacity-50 group-hover:opacity-100 transition-all duration-50',+ isActive && 'opacity-100'+ )}+ />+ </span>+ </>+ )}+ </ButtonPrimitive>+ {item.identifier === 'Products' && showToolsSearchRow && (+ <ButtonPrimitive+ menuItem+ className="group -outline-offset-2"+ data-attr="nav-tools-search-row"+ onClick={() => {+ posthog.capture('nav search clicked')+ toggleCommand('nav-tools-row')+ }}+ >+ <span className="relative size-4 text-secondary group-hover:text-primary opacity-50 group-hover:opacity-100 transition-all duration-50">+ <IconSearch /></span>- </>+ <span className="truncate text-secondary group-hover:text-primary">+ Search+ </span>+ <span className="ml-auto pr-1">+ <RenderKeybind keybind={[keyBinds.search]} minimal />+ </span>+ </ButtonPrimitive>)}- </ButtonPrimitive>- {item.identifier === 'Products' && showToolsSearchRow && (- <ButtonPrimitive- menuItem- className="group -outline-offset-2"- data-attr="nav-tools-search-row"- onClick={() => {- posthog.capture('nav search clicked')- toggleCommand('nav-tools-row')- }}- >- <span className="relative size-4 text-secondary group-hover:text-primary opacity-50 group-hover:opacity-100 transition-all duration-50">- <IconSearch />- </span>- <span className="truncate text-secondary group-hover:text-primary">- Search- </span>- <span className="ml-auto pr-1">- <RenderKeybind keybind={[keyBinds.search]} minimal />- </span>- </ButtonPrimitive>- )}- </Fragment>- )- })}+ </Fragment>+ )+ })}</div></Collapsible.Panel></Collapsible>- {!isLayoutNavCollapsed && (+ {!isLayoutNavCollapsed && isSidebarSectionShown('recents') && (<Collapsibleopen={expandedNavSections.recents ?? false}onOpenChange={() => {@@ -387,7 +413,7 @@ export function NavTabBrowse(): JSX.Element {</Collapsible>)}- {!isLayoutNavCollapsed && (+ {!isLayoutNavCollapsed && isSidebarSectionShown('my_tools') && (<Collapsibleopen={expandedNavSections.tools ?? false}onOpenChange={() => {@@ -402,42 +428,64 @@ export function NavTabBrowse(): JSX.Element {><div className="relative"><SectionTrigger icon={<IconApps />} label="My Tools" isCollapsed={isLayoutNavCollapsed} />- {expandedNavSections.tools && (- <ButtonPrimitive- iconOnly- size="xs"- tooltip={isEditMode ? 'Save' : 'Choose which tools to show in the sidebar'}- tooltipPlacement="top"- onClick={() => {- if (isEditMode) {- posthog.capture('nav tools edit saved')- saveAndExitEditMode()- } else {- posthog.capture('nav tools edit toggled', { is_editing: true })- enterEditMode()- }- }}- data-attr="nav-tools-edit-button"- className="absolute right-1 top-0 bottom-0 my-auto rounded-[var(--radius)] z-5"- >- {isEditMode ? (- <IconCheck className="size-3 text-primary" />- ) : (- <IconPencil className="size-3 text-secondary" />- )}- </ButtonPrimitive>- )}+ {expandedNavSections.tools &&+ (uiCustomizationEnabled ? (+ <Link+ to={urls.settings('user-navigation')}+ tooltip="Choose which tools to show in the sidebar"+ tooltipPlacement="top"+ onClick={() => posthog.capture('nav tools customize clicked')}+ buttonProps={{+ iconOnly: true,+ size: 'xs',+ className:+ 'absolute right-1 top-0 bottom-0 my-auto rounded-[var(--radius)] z-5',+ }}+ data-attr="nav-tools-customize-button"+ >+ <IconGear className="size-3 text-secondary" />+ </Link>+ ) : (+ <ButtonPrimitive+ iconOnly+ size="xs"+ tooltip={isEditMode ? 'Save' : 'Choose which tools to show in the sidebar'}+ tooltipPlacement="top"+ onClick={() => {+ if (isEditMode) {+ posthog.capture('nav tools edit saved')+ saveAndExitEditMode()+ } else {+ posthog.capture('nav tools edit toggled', { is_editing: true })+ enterEditMode()+ }+ }}+ data-attr="nav-tools-edit-button"+ className="absolute right-1 top-0 bottom-0 my-auto rounded-[var(--radius)] z-5"+ >+ {isEditMode ? (+ <IconCheck className="size-3 text-primary" />+ ) : (+ <IconPencil className="size-3 text-secondary" />+ )}+ </ButtonPrimitive>+ ))}</div><Collapsible.Panel className="-ml-2 pl-3 pr-1 w-[calc(100%+(var(--spacing)*4))]">- {(expandedNavSections.tools ?? false) && (+ {!(expandedNavSections.tools ?? false) ? null : uiCustomizationEnabled &&+ enabledToolPaths.size === 0 ? (+ // Without this the section header opens onto nothing, reading as broken+ // rather than as "you haven't picked any tools yet".+ <span className="text-xs text-tertiary px-2 py-1 block">No tools shown</span>+ ) : (<ProjectTree- root={isEditMode ? 'products://' : 'custom-products://'}+ root={!uiCustomizationEnabled && isEditMode ? 'products://' : 'custom-products://'}onlyTreetreeSize={isLayoutNavCollapsed ? 'narrow' : 'default'}- selectModeOverride={isEditMode ? 'multi' : undefined}- checkedItemsOverride={isEditMode ? checkedTools : undefined}+ selectModeOverride={!uiCustomizationEnabled && isEditMode ? 'multi' : undefined}+ checkedItemsOverride={!uiCustomizationEnabled && isEditMode ? checkedTools : undefined}onItemCheckedOverride={- isEditMode+ !uiCustomizationEnabled && isEditMode? (id) => {// Tree item IDs for products:// are "products/{path}"const toolPath = id.replace(/^products\//, '')diff --git a/frontend/src/layout/panel-layout/ai-first/tabs/editToolsLogic.ts b/frontend/src/layout/panel-layout/ai-first/tabs/editToolsLogic.tsindex ce194dd65caf..338a4db4470d 100644--- a/frontend/src/layout/panel-layout/ai-first/tabs/editToolsLogic.ts+++ b/frontend/src/layout/panel-layout/ai-first/tabs/editToolsLogic.ts@@ -159,9 +159,10 @@ export const editToolsLogic = kea<editToolsLogicType>([} catch (error) {console.error('Failed to save tool changes:', error)lemonToast.error('Failed to save some changes. Try again?')+ // Only refetch to undo the failed save. Refetching on success would race a+ // later save, reverting it on screen; the placeholder fields are never read.+ actions.loadCustomProducts()}- // Refresh with real server data to replace optimistic placeholders- actions.loadCustomProducts()}},})),diff --git a/frontend/src/layout/panel-layout/sidebarCustomization.tsx b/frontend/src/layout/panel-layout/sidebarCustomization.tsxnew file mode 100644index 000000000000..b9cafe34e8ab--- /dev/null+++ b/frontend/src/layout/panel-layout/sidebarCustomization.tsx@@ -0,0 +1,115 @@+import {+ IconApps,+ IconClock,+ IconDatabase,+ IconFolder,+ IconFolderOpen,+ IconGear,+ IconHome,+ IconNotification,+ IconQuestion,+ IconStar,+} from '@posthog/icons'++import { FEATURE_FLAGS } from 'lib/constants'++import { SidebarItemKey, SidebarSectionKey } from '~/layout/uiCustomizationLogic'++export interface SidebarCustomizableItem {+ /** Absent for items that always stay visible (they render a locked switch). */+ key?: SidebarItemKey+ label: string+ /** Very brief explanation of what the item opens, shown under the label in settings. */+ description: string+ icon: JSX.Element+ /** Mirrors the flag gating the item in the navbar, so the toggle is only offered when the item can render at all. */+ flag?: string+}++export interface SidebarCustomizableSection {+ key: SidebarSectionKey+ label: string+ description: string+ icon: JSX.Element+ items: SidebarCustomizableItem[]+}++/**+ * The exhaustive list of customizable sidebar elements, used to render the settings UI.+ * Keys must match the UserUIConfiguration schema and labels/icons must match what the+ * navbar renders (NavTabBrowse and NavBarFooter), so keep the three in sync.+ * Activity and Settings have no key: they always stay visible.+ */+export const SIDEBAR_CUSTOMIZABLE_SECTIONS: SidebarCustomizableSection[] = [+ {+ key: 'project',+ label: 'Project',+ description: 'The core navigation for your project.',+ icon: <IconFolder />,+ items: [+ { key: 'home', label: 'Home', description: 'Opens your homepage.', icon: <IconHome /> },+ {+ key: 'inbox',+ label: 'Inbox',+ description: 'Reports and signals that need your attention.',+ icon: <IconNotification />,+ flag: FEATURE_FLAGS.PRODUCT_AUTONOMY,+ },+ {+ label: 'Activity',+ description: 'A live stream of events coming into your project.',+ icon: <IconClock />,+ },+ {+ key: 'data',+ label: 'Data',+ description: 'Manage events, actions, properties, and people.',+ icon: <IconDatabase />,+ },+ {+ key: 'files',+ label: 'Files',+ description: 'Everything saved in your project, organized in folders.',+ icon: <IconFolderOpen />,+ },+ { key: 'tools', label: 'Tools', description: 'Browse all PostHog tools.', icon: <IconApps /> },+ {+ key: 'starred',+ label: 'Starred',+ description: 'Quick access to items you starred.',+ icon: <IconStar />,+ },+ ],+ },+ {+ key: 'recents',+ label: 'Recents',+ description: 'Items you viewed recently.',+ icon: <IconClock />,+ items: [],+ },+ {+ key: 'my_tools',+ label: 'My Tools',+ description: 'The tools you picked for quick access.',+ icon: <IconApps />,+ items: [],+ },+]++/** Customizable items at the bottom of the sidebar. */+export const SIDEBAR_CUSTOMIZABLE_FOOTER_ITEMS: SidebarCustomizableItem[] = [+ {+ key: 'notifications',+ label: 'Notifications',+ description: 'Your in-app notifications.',+ icon: <IconNotification />,+ flag: FEATURE_FLAGS.REAL_TIME_NOTIFICATIONS,+ },+ { key: 'help', label: 'Help', description: 'Docs, support, and product updates.', icon: <IconQuestion /> },+ {+ label: 'Settings',+ description: 'Project, organization, and account settings.',+ icon: <IconGear />,+ },+]diff --git a/frontend/src/layout/scenes/HomepageConfiguration.tsx b/frontend/src/layout/scenes/HomepageConfiguration.tsxnew file mode 100644index 000000000000..eca8856afe34--- /dev/null+++ b/frontend/src/layout/scenes/HomepageConfiguration.tsx@@ -0,0 +1,209 @@+import { useActions, useValues } from 'kea'+import posthog from 'posthog-js'+import { useEffect, useState } from 'react'++import { LemonSearchableSelect, LemonSegmentedButton, LemonSelectOptions, LemonTag } from '@posthog/lemon-ui'++import { iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'+import { dashboardsModel } from '~/models/dashboardsModel'+import { FileSystemIconType } from '~/queries/schema/schema-general'+import { sceneLogic } from '~/scenes/sceneLogic'+import { emptySceneParams } from '~/scenes/scenes'+import { Scene, SceneTab } from '~/scenes/sceneTypes'+import { teamLogic } from '~/scenes/teamLogic'+import { urls } from '~/scenes/urls'++type HomepageMode = 'launchpad' | 'search' | 'default_dashboard'++function getHomepageMode(+ isUsingProjectDefault: boolean,+ isUsingNewTabHomepage: boolean,+ isUsingDefaultDashboard: boolean+): HomepageMode | null {+ if (isUsingProjectDefault) {+ return 'launchpad'+ }+ if (isUsingNewTabHomepage) {+ return 'search'+ }+ if (isUsingDefaultDashboard) {+ return 'default_dashboard'+ }+ return null+}++/** The homepage picker, rendered by the Navigation settings page. */+export function HomepageConfiguration(): JSX.Element {+ const { homepage } = useValues(sceneLogic)+ const { currentTeam } = useValues(teamLogic)+ const { nameSortedDashboards, dashboardsLoading } = useValues(dashboardsModel)+ const { setHomepage } = useActions(sceneLogic)+ const { updateCurrentTeam } = useActions(teamLogic)++ const isUsingProjectDefault = !homepage+ const isUsingNewTabHomepage = homepage?.sceneId === Scene.NewTab+ const isUsingDefaultDashboard =+ homepage?.sceneId === Scene.Dashboard && homepage?.id?.startsWith('homepage-dashboard-')++ // Local UI selection so users can preview the "Default dashboard" picker even+ // when no `primary_dashboard` is set yet — otherwise the picker is hidden behind+ // a disabled tile, and the only place to set it is the same hidden picker.+ const [pendingMode, setPendingMode] = useState<HomepageMode | null>(null)+ const currentMode = getHomepageMode(isUsingProjectDefault, isUsingNewTabHomepage, isUsingDefaultDashboard)+ useEffect(() => setPendingMode(null), [currentMode])+ const activeMode = pendingMode ?? currentMode+ const showDashboardPicker = activeMode === 'default_dashboard'++ const projectDefaultDashboardId = currentTeam?.primary_dashboard ?? null++ const homepageDisplayTitle = homepage ? homepage.customTitle || homepage.title : 'Launchpad'+ const homepageSubtitle = isUsingProjectDefault ? 'Default' : isUsingNewTabHomepage ? 'Search' : null++ const projectDefaultDashboardOptions: LemonSelectOptions<number | null> = [+ { value: null, label: 'No default dashboard / show the "new tab" page' },+ ...nameSortedDashboards.map((dashboard) => ({+ value: dashboard.id,+ label: dashboard.name || 'Untitled',+ })),+ ]++ const homepageIcon = homepage?.iconType+ const homepageIconElement = iconForType(+ homepageIcon && homepageIcon !== 'loading' && homepageIcon !== 'blank'+ ? (homepageIcon as FileSystemIconType)+ : isUsingNewTabHomepage+ ? ('default_icon_type' as FileSystemIconType)+ : ('home' as FileSystemIconType)+ )++ const newTabHomepage: SceneTab = {+ id: 'homepage-new-tab',+ pathname: urls.newTab(),+ search: '',+ hash: '',+ title: 'Search',+ iconType: 'search',+ sceneId: Scene.NewTab,+ sceneKey: 'newTab',+ sceneParams: emptySceneParams,+ }++ return (+ <section className="flex flex-col gap-3">+ <div className="flex flex-col gap-2">+ <div className="flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2 bg-surface-primary">+ <div className="flex min-w-0 items-center gap-2">+ <span className="shrink-0 text-lg text-muted-alt">{homepageIconElement}</span>+ <div className="min-w-0">+ <div className="truncate font-medium text-primary">{homepageDisplayTitle}</div>+ {homepageSubtitle && <div className="truncate text-xs text-muted">{homepageSubtitle}</div>}+ </div>+ </div>+ <LemonSegmentedButton+ size="small"+ value={activeMode ?? undefined}+ onChange={(newValue) => {+ posthog.capture('homepage configure set homepage', {+ 'homepage choice': newValue,+ })+ if (newValue === 'launchpad') {+ setPendingMode(null)+ setHomepage(null)+ } else if (newValue === 'search') {+ setPendingMode(null)+ setHomepage(newTabHomepage)+ } else if (newValue === 'default_dashboard') {+ const dashboardId = currentTeam?.primary_dashboard+ if (dashboardId) {+ setPendingMode(null)+ setHomepage({+ id: `homepage-dashboard-${dashboardId}`,+ pathname: urls.dashboard(dashboardId),+ search: '',+ hash: '',+ title: 'Default dashboard',+ iconType: 'dashboard',+ sceneId: Scene.Dashboard,+ sceneKey: `dashboard-${dashboardId}`,+ sceneParams: emptySceneParams,+ })+ } else {+ // No primary dashboard yet — keep selection local so the picker+ // appears; setHomepage fires once a dashboard is chosen below.+ setPendingMode('default_dashboard')+ }+ }+ }}+ options={[+ {+ value: 'launchpad' as const,+ label: (+ <>+ Launchpad{' '}+ <LemonTag size="small" type="highlight" className="ml-1">+ New+ </LemonTag>+ </>+ ),+ 'data-attr': 'configure-home-modal-set-launchpad',+ tooltip: 'An AI-powered home with quick actions and recent items',+ },+ {+ value: 'search' as const,+ label: 'Search',+ 'data-attr': 'configure-home-modal-set-search',+ tooltip: 'A search page to quickly find anything in your project',+ },+ {+ value: 'default_dashboard' as const,+ label: 'Default dashboard',+ 'data-attr': 'configure-home-modal-set-default-dashboard',+ tooltip: "Open your project's default dashboard when you go home",+ },+ ]}+ />+ </div>+ {showDashboardPicker && (+ <section className="space-y-3 bg-surface-secondary rounded-lg p-3 border">+ <div className="flex flex-col">+ <h4 className="text-base font-semibold text-primary m-0">+ Set default dashboard (project based)+ </h4>+ <p className="text-sm text-tertiary m-0">+ This dashboard opens by default for everyone who has not set a custom homepage.+ </p>+ </div>+ <LemonSearchableSelect<number | null>+ className="w-full"+ fullWidth+ options={projectDefaultDashboardOptions}+ value={projectDefaultDashboardId}+ searchPlaceholder="Search dashboards…"+ searchInputDataAttr="configure-home-modal-default-dashboard-search"+ data-attr="configure-home-modal-set-default-dashboard-select"+ onChange={(dashboardId) => {+ posthog.capture('homepage configure default dashboard changed')+ updateCurrentTeam({ primary_dashboard: dashboardId ?? null })+ if (dashboardId) {+ setPendingMode(null)+ setHomepage({+ id: `homepage-dashboard-${dashboardId}`,+ pathname: urls.dashboard(dashboardId),+ search: '',+ hash: '',+ title: 'Default dashboard',+ iconType: 'dashboard',+ sceneId: Scene.Dashboard,+ sceneKey: `dashboard-${dashboardId}`,+ sceneParams: emptySceneParams,+ })+ }+ }}+ disabledReason={dashboardsLoading ? 'Loading dashboards…' : undefined}+ />+ </section>+ )}+ </div>+ </section>+ )+}diff --git a/frontend/src/layout/uiCustomizationLogic.test.ts b/frontend/src/layout/uiCustomizationLogic.test.tsnew file mode 100644index 000000000000..c01becfabd37--- /dev/null+++ b/frontend/src/layout/uiCustomizationLogic.test.ts@@ -0,0 +1,116 @@+import { MOCK_DEFAULT_USER } from 'lib/api.mock'++import { expectLogic } from 'kea-test-utils'++import { FEATURE_FLAGS } from 'lib/constants'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'+import { userLogic } from 'scenes/userLogic'++import { useMocks } from '~/mocks/jest'+import { UserUIConfiguration } from '~/queries/schema/schema-general'+import { initKeaTests } from '~/test/init'+import { UserType } from '~/types'++import { uiCustomizationLogic, withSidebarItemVisibility, withSidebarSectionVisibility } from './uiCustomizationLogic'++describe('uiCustomizationLogic', () => {+ let logic: ReturnType<typeof uiCustomizationLogic.build>+ let patchedUser: Partial<UserType> | null++ function seedUser(uiConfiguration: UserUIConfiguration | null): void {+ userLogic.actions.loadUserSuccess({ ...MOCK_DEFAULT_USER, ui_configuration: uiConfiguration })+ }++ beforeEach(() => {+ patchedUser = null+ useMocks({+ patch: {+ '/api/users/@me/': async ({ request }) => {+ patchedUser = (await request.json()) as Partial<UserType>+ return [200, { ...MOCK_DEFAULT_USER, ...patchedUser }]+ },+ },+ })+ initKeaTests()+ featureFlagLogic.mount()+ featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.UI_CUSTOMIZATION], {+ [FEATURE_FLAGS.UI_CUSTOMIZATION]: true,+ })+ logic = uiCustomizationLogic()+ logic.mount()+ })++ it('ignores stored configuration while the customization flag is off', () => {+ featureFlagLogic.actions.setFeatureFlags([], {})+ seedUser({+ version: 1,+ sidebar: {+ sections: { recents: { visible: false } },+ items: { data: { visible: false } },+ },+ })++ expect(logic.values.isSidebarItemShown('data')).toBe(true)+ expect(logic.values.isSidebarSectionShown('recents')).toBe(true)+ })++ it('shows everything when the user has no configuration', () => {+ seedUser(null)++ expect(logic.values.isSidebarItemShown('data')).toBe(true)+ expect(logic.values.isSidebarSectionShown('my_tools')).toBe(true)+ })++ it('hides only elements explicitly configured as hidden', () => {+ seedUser({+ version: 1,+ sidebar: {+ sections: { recents: { visible: false } },+ items: { data: { visible: false }, home: { visible: true } },+ },+ })++ expect(logic.values.isSidebarItemShown('data')).toBe(false)+ expect(logic.values.isSidebarItemShown('home')).toBe(true)+ expect(logic.values.isSidebarItemShown('files')).toBe(true)+ expect(logic.values.isSidebarSectionShown('recents')).toBe(false)+ expect(logic.values.isSidebarSectionShown('project')).toBe(true)+ })++ it('applies a toggle optimistically and persists the complete configuration', async () => {+ seedUser({ version: 1, sidebar: { items: { starred: { visible: false } } } })++ await expectLogic(logic, () => {+ logic.actions.setSidebarItemShown('data', false)+ }).toFinishAllListeners()++ expect(logic.values.isSidebarItemShown('data')).toBe(false)+ expect(logic.values.isSidebarItemShown('starred')).toBe(false)+ expect(patchedUser?.ui_configuration).toEqual({+ version: 1,+ sidebar: { items: { starred: { visible: false }, data: { visible: false } } },+ })+ })++ it('helpers add visibility without dropping the rest of the configuration', () => {+ const existing: UserUIConfiguration = {+ version: 2,+ sidebar: {+ sections: { recents: { visible: false } },+ items: { data: { visible: false } },+ },+ }++ expect(withSidebarItemVisibility(existing, 'files', false)).toEqual({+ version: 2,+ sidebar: {+ sections: { recents: { visible: false } },+ items: { data: { visible: false }, files: { visible: false } },+ },+ })+ expect(withSidebarSectionVisibility(null, 'my_tools', false)).toEqual({+ version: 1,+ sidebar: { sections: { my_tools: { visible: false } } },+ })+ })+})diff --git a/frontend/src/layout/uiCustomizationLogic.ts b/frontend/src/layout/uiCustomizationLogic.tsnew file mode 100644index 000000000000..1d86bbb42be0--- /dev/null+++ b/frontend/src/layout/uiCustomizationLogic.ts@@ -0,0 +1,222 @@+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'+import posthog from 'posthog-js'++import { FEATURE_FLAGS } from 'lib/constants'+import { FeatureFlagsSet, featureFlagLogic } from 'lib/logic/featureFlagLogic'+import { userLogic } from 'scenes/userLogic'++import {+ SidebarItemsConfiguration,+ SidebarSectionsConfiguration,+ UserUIConfiguration,+} from '~/queries/schema/schema-general'+import { UserType } from '~/types'++export type SidebarSectionKey = keyof SidebarSectionsConfiguration+export type SidebarItemKey = keyof SidebarItemsConfiguration++/** Version stamped onto the configuration whenever this client persists it. */+export const UI_CONFIGURATION_VERSION = 1++export function withSidebarSectionVisibility(+ configuration: UserUIConfiguration | null,+ section: SidebarSectionKey,+ visible: boolean+): UserUIConfiguration {+ return {+ version: UI_CONFIGURATION_VERSION,+ ...configuration,+ sidebar: {+ ...configuration?.sidebar,+ sections: {+ ...configuration?.sidebar?.sections,+ [section]: { ...configuration?.sidebar?.sections?.[section], visible },+ },+ },+ }+}++export function withSidebarItemVisibility(+ configuration: UserUIConfiguration | null,+ item: SidebarItemKey,+ visible: boolean+): UserUIConfiguration {+ return {+ version: UI_CONFIGURATION_VERSION,+ ...configuration,+ sidebar: {+ ...configuration?.sidebar,+ items: {+ ...configuration?.sidebar?.items,+ [item]: { ...configuration?.sidebar?.items?.[item], visible },+ },+ },+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface uiCustomizationLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ user: UserType | null // userLogic+ userLoading: boolean // userLogic+ isSidebarItemShown: (item: keyof SidebarItemsConfiguration) => boolean+ isSidebarSectionShown: (section: keyof SidebarSectionsConfiguration) => boolean+ pendingUiConfiguration: UserUIConfiguration | null+ uiConfiguration: UserUIConfiguration | null+ uiCustomizationEnabled: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface uiCustomizationLogicActions {+ updateUser: (+ user: Partial<UserType>,+ successCallback?: (() => void) | undefined+ ) => {+ successCallback: (() => void) | undefined+ user: Partial<UserType>+ } // userLogic+ updateUserFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ } // userLogic+ updateUserSuccess: (+ user: UserType,+ payload?:+ | {+ successCallback: (() => void) | undefined+ user: Partial<UserType>+ }+ | undefined+ ) => {+ payload?: {+ successCallback: (() => void) | undefined+ user: Partial<UserType>+ }+ user: UserType+ } // userLogic+ setPendingUiConfiguration: (configuration: UserUIConfiguration | null) => {+ configuration: UserUIConfiguration | null+ }+ setSidebarItemShown: (+ item: SidebarItemKey,+ shown: boolean+ ) => {+ item: keyof SidebarItemsConfiguration+ shown: boolean+ }+ setSidebarSectionShown: (+ section: SidebarSectionKey,+ shown: boolean+ ) => {+ section: keyof SidebarSectionsConfiguration+ shown: boolean+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface uiCustomizationLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ uiCustomizationEnabled: (featureFlags: FeatureFlagsSet) => boolean+ uiConfiguration: (+ user: UserType | null,+ pendingUiConfiguration: UserUIConfiguration | null+ ) => UserUIConfiguration | null+ isSidebarSectionShown: (+ uiConfiguration: UserUIConfiguration | null,+ uiCustomizationEnabled: boolean+ ) => (section: keyof SidebarSectionsConfiguration) => boolean+ isSidebarItemShown: (+ uiConfiguration: UserUIConfiguration | null,+ uiCustomizationEnabled: boolean+ ) => (item: keyof SidebarItemsConfiguration) => boolean+ }+}++export type uiCustomizationLogicType = MakeLogicType<+ uiCustomizationLogicValues,+ uiCustomizationLogicActions,+ Record<string, any>,+ uiCustomizationLogicMeta+>++/**+ * Per-user UI customization, persisted as `User.ui_configuration` (see the UserUIConfiguration schema).+ * Resolution is fail-open: a null configuration or an absent key means "shown", so nothing disappears+ * while the user is loading and newly shipped sidebar elements show for everyone until hidden explicitly.+ */+export const uiCustomizationLogic = kea<uiCustomizationLogicType>([+ path(['layout', 'uiCustomizationLogic']),+ connect(() => ({+ values: [userLogic, ['user', 'userLoading'], featureFlagLogic, ['featureFlags']],+ actions: [userLogic, ['updateUser', 'updateUserSuccess', 'updateUserFailure']],+ })),+ actions({+ setSidebarSectionShown: (section: SidebarSectionKey, shown: boolean) => ({ section, shown }),+ setSidebarItemShown: (item: SidebarItemKey, shown: boolean) => ({ item, shown }),+ setPendingUiConfiguration: (configuration: UserUIConfiguration | null) => ({ configuration }),+ }),+ reducers({+ // Optimistic copy held while the user PATCH is in flight, so toggles apply instantly.+ pendingUiConfiguration: [+ null as UserUIConfiguration | null,+ {+ setPendingUiConfiguration: (_, { configuration }) => configuration,+ },+ ],+ }),+ selectors({+ uiCustomizationEnabled: [+ (s) => [s.featureFlags],+ (featureFlags: FeatureFlagsSet): boolean => !!featureFlags[FEATURE_FLAGS.UI_CUSTOMIZATION],+ ],+ uiConfiguration: [+ (s) => [s.user, s.pendingUiConfiguration],+ (user: UserType | null, pendingUiConfiguration: UserUIConfiguration | null): UserUIConfiguration | null =>+ pendingUiConfiguration ?? user?.ui_configuration ?? null,+ ],+ // With the flag off, any stored configuration is ignored so the sidebar keeps its default layout.+ isSidebarSectionShown: [+ (s) => [s.uiConfiguration, s.uiCustomizationEnabled],+ (uiConfiguration: UserUIConfiguration | null, uiCustomizationEnabled: boolean) =>+ (section: SidebarSectionKey): boolean =>+ !uiCustomizationEnabled || uiConfiguration?.sidebar?.sections?.[section]?.visible !== false,+ ],+ isSidebarItemShown: [+ (s) => [s.uiConfiguration, s.uiCustomizationEnabled],+ (uiConfiguration: UserUIConfiguration | null, uiCustomizationEnabled: boolean) =>+ (item: SidebarItemKey): boolean =>+ !uiCustomizationEnabled || uiConfiguration?.sidebar?.items?.[item]?.visible !== false,+ ],+ }),+ listeners(({ actions, values }) => ({+ setSidebarSectionShown: ({ section, shown }) => {+ const configuration = withSidebarSectionVisibility(values.uiConfiguration, section, shown)+ actions.setPendingUiConfiguration(configuration)+ actions.updateUser({ ui_configuration: configuration })+ posthog.capture('sidebar customization changed', {+ element_kind: 'section',+ element_key: section,+ shown,+ })+ },+ setSidebarItemShown: ({ item, shown }) => {+ const configuration = withSidebarItemVisibility(values.uiConfiguration, item, shown)+ actions.setPendingUiConfiguration(configuration)+ actions.updateUser({ ui_configuration: configuration })+ posthog.capture('sidebar customization changed', {+ element_kind: 'item',+ element_key: item,+ shown,+ })+ },+ updateUserSuccess: () => {+ actions.setPendingUiConfiguration(null)+ },+ updateUserFailure: () => {+ actions.setPendingUiConfiguration(null)+ },+ })),+])diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex e009c401f0ee..6fae3ff0b852 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -507,6 +507,7 @@ export const FEATURE_FLAGS = {TRACING_OPERATIONS_VIEW: 'tracing-operations-view', // owner: #team-apm — gates the Operations (per-operation aggregate) tab in tracingTRACING_SAVED_VIEWS: 'tracing-saved-views', // owner: #team-apm — gates saved views (saved filter sets) in tracingTRAFFIC_TYPE_VIRTUAL_PROPERTIES: 'traffic-type-virtual-properties', // owner: #team-web-analytics+ UI_CUSTOMIZATION: 'ui-customization-enabled', // owner: @fercgomes #team-self-driving, gates sidebar/homepage UI customizationUSER_INTERVIEWS: 'user-interviews', // owner: @Twixes @jurajmajerikUX_REMOVE_SIDEPANEL: 'ux-remove-sidepanel', // owner: #team-surveysVISUAL_REVIEW: 'visual-review', // owner: #team-devexdiff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex bd7f8cf3ad6d..9eef8ef148e9 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -45251,6 +45251,77 @@},"type": "object"},+ "SidebarConfiguration": {+ "additionalProperties": false,+ "description": "Customization of the main navigation sidebar.",+ "properties": {+ "items": {+ "$ref": "#/definitions/SidebarItemsConfiguration"+ },+ "sections": {+ "$ref": "#/definitions/SidebarSectionsConfiguration"+ }+ },+ "type": "object"+ },+ "SidebarItemsConfiguration": {+ "additionalProperties": false,+ "description": "Individual items of the main navigation sidebar. Items inside a hidden section are hidden regardless of their own config. Activity and Settings are deliberately absent: they always stay visible.",+ "properties": {+ "data": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Data\" panel trigger in the Project section."+ },+ "files": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Files\" panel trigger in the Project section."+ },+ "help": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Help\" entry in the sidebar footer."+ },+ "home": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Home\" link in the Project section."+ },+ "inbox": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Inbox\" link in the Project section. Only rendered when the inbox feature is available."+ },+ "notifications": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Notifications\" entry in the sidebar footer. Only rendered when real-time notifications are available."+ },+ "starred": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Starred\" panel trigger in the Project section."+ },+ "tools": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "\"Tools\" panel trigger in the Project section."+ }+ },+ "type": "object"+ },+ "SidebarSectionsConfiguration": {+ "additionalProperties": false,+ "description": "Collapsible sections of the main navigation sidebar. Hiding a section hides everything inside it, except always-visible items like Activity.",+ "properties": {+ "my_tools": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "The \"My tools\" section, listing the user's selected tools."+ },+ "project": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "The \"Project\" section (Home and the Data/Files/Tools/Starred panel triggers). Activity stays visible even when this section is hidden."+ },+ "recents": {+ "$ref": "#/definitions/UIVisibilityConfig",+ "description": "The \"Recents\" section, listing recently viewed items."+ }+ },+ "type": "object"+ },"SimilarIssue": {"additionalProperties": false,"properties": {@@ -48965,6 +49036,16 @@"required": ["kind"],"type": "object"},+ "UIVisibilityConfig": {+ "additionalProperties": false,+ "description": "Visibility of a single customizable UI element. An absent config or an absent `visible` means the element is shown.",+ "properties": {+ "visible": {+ "type": "boolean"+ }+ },+ "type": "object"+ },"UsageMetric": {"additionalProperties": false,"properties": {@@ -49203,6 +49284,21 @@],"type": "string"},+ "UserUIConfiguration": {+ "additionalProperties": false,+ "description": "Per-user UI customization, persisted on the User model as a single JSONB blob. A null configuration and any absent key mean \"default\", which for visibility is \"shown\", so newly added UI surfaces appear for everyone until explicitly hidden. Writers must send the complete object; the server validates and replaces it wholesale.",+ "properties": {+ "sidebar": {+ "$ref": "#/definitions/SidebarConfiguration"+ },+ "version": {+ "description": "Schema version of this configuration blob, for future format migrations.",+ "type": "integer"+ }+ },+ "required": ["version"],+ "type": "object"+ },"VectorSearchQuery": {"additionalProperties": false,"properties": {diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex bb0b506ed4bd..f75e76ba7df0 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -8628,6 +8628,62 @@ export interface UserProductListItem {updated_at: string}+/** Visibility of a single customizable UI element. An absent config or an absent `visible` means the element is shown. */+export interface UIVisibilityConfig {+ visible?: boolean+}++/** Collapsible sections of the main navigation sidebar. Hiding a section hides everything inside it, except always-visible items like Activity. */+export interface SidebarSectionsConfiguration {+ /** The "Project" section (Home and the Data/Files/Tools/Starred panel triggers). Activity stays visible even when this section is hidden. */+ project?: UIVisibilityConfig+ /** The "Recents" section, listing recently viewed items. */+ recents?: UIVisibilityConfig+ /** The "My tools" section, listing the user's selected tools. */+ my_tools?: UIVisibilityConfig+}++/** Individual items of the main navigation sidebar. Items inside a hidden section are hidden regardless of their own config. Activity and Settings are deliberately absent: they always stay visible. */+export interface SidebarItemsConfiguration {+ /** "Home" link in the Project section. */+ home?: UIVisibilityConfig+ /** "Inbox" link in the Project section. Only rendered when the inbox feature is available. */+ inbox?: UIVisibilityConfig+ /** "Data" panel trigger in the Project section. */+ data?: UIVisibilityConfig+ /** "Files" panel trigger in the Project section. */+ files?: UIVisibilityConfig+ /** "Tools" panel trigger in the Project section. */+ tools?: UIVisibilityConfig+ /** "Starred" panel trigger in the Project section. */+ starred?: UIVisibilityConfig+ /** "Notifications" entry in the sidebar footer. Only rendered when real-time notifications are available. */+ notifications?: UIVisibilityConfig+ /** "Help" entry in the sidebar footer. */+ help?: UIVisibilityConfig+}++/** Customization of the main navigation sidebar. */+export interface SidebarConfiguration {+ sections?: SidebarSectionsConfiguration+ items?: SidebarItemsConfiguration+}++/**+ * Per-user UI customization, persisted on the User model as a single JSONB blob.+ * A null configuration and any absent key mean "default", which for visibility is "shown",+ * so newly added UI surfaces appear for everyone until explicitly hidden.+ * Writers must send the complete object; the server validates and replaces it wholesale.+ */+export interface UserUIConfiguration {+ /**+ * Schema version of this configuration blob, for future format migrations.+ * @asType integer+ */+ version: number+ sidebar?: SidebarConfiguration+}+// Keep this in alphabetical order if you wanna maintain Rafa's sanityexport enum ProductKey {ACTIONS = 'actions',diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsxindex e036629f8485..73cfede5598e 100644--- a/frontend/src/scenes/settings/SettingsMap.tsx+++ b/frontend/src/scenes/settings/SettingsMap.tsx@@ -172,6 +172,7 @@ import { PersonalGitHubIntegrations, PersonalSlackIntegrations } from './user/Peimport { RealtimeNotificationPreferences } from './user/RealtimeNotificationPreferences'import { Reminders } from './user/Reminders'import { SidebarAutoSuggestSetting } from './user/SidebarProductSettings'+import { HomepageSetting, SidebarItemsSetting, SidebarMyToolsSetting } from './user/SidebarSettings'import { ThemeSwitcher } from './user/ThemeSwitcher'import { TwoFactorSettings } from './user/TwoFactorSettings'import { UpdateEmailPreferences } from './user/UpdateEmailPreferences'@@ -2021,6 +2022,38 @@ export const SETTINGS_MAP: SettingSection[] = [},],},+ {+ level: 'user',+ id: 'user-navigation',+ title: 'Navigation',+ flag: 'UI_CUSTOMIZATION',+ settings: [+ {+ id: 'homepage',+ title: 'Homepage',+ description:+ 'The page that opens when you open PostHog or select Home in the sidebar. This applies to the current project.',+ component: <HomepageSetting />,+ keywords: ['homepage', 'home', 'default page', 'landing page', 'launchpad', 'start'],+ },+ {+ id: 'sidebar-items',+ title: 'Navigation items',+ description:+ 'Choose which items appear in your sidebar. These preferences only apply to you. Activity and Settings always stay visible.',+ component: <SidebarItemsSetting />,+ keywords: ['sidebar', 'navigation', 'navbar', 'menu', 'hide', 'show', 'customize', 'starred'],+ },+ {+ id: 'sidebar-my-tools',+ title: 'My Tools',+ description:+ 'Choose which tools appear in the My Tools section of your sidebar. This selection applies to the current project.',+ component: <SidebarMyToolsSetting />,+ keywords: ['sidebar', 'tools', 'products', 'apps', 'my tools', 'customize'],+ },+ ],+ },{level: 'user',id: 'user-feature-previews',diff --git a/frontend/src/scenes/settings/stories/SettingsUser.stories.tsx b/frontend/src/scenes/settings/stories/SettingsUser.stories.tsxindex 7adefad92491..e0858a2d2f36 100644--- a/frontend/src/scenes/settings/stories/SettingsUser.stories.tsx+++ b/frontend/src/scenes/settings/stories/SettingsUser.stories.tsx@@ -75,6 +75,10 @@ export const SettingsUserCustomization: Story = {args: { sectionId: 'user-customization' },}+export const SettingsUserNavigation: Story = {+ args: { sectionId: 'user-navigation' },+}+export const SettingsUserDangerZone: Story = {args: { sectionId: 'user-danger-zone' },}diff --git a/frontend/src/scenes/settings/types.ts b/frontend/src/scenes/settings/types.tsindex 1c3df58f50b9..dbc2366c8678 100644--- a/frontend/src/scenes/settings/types.ts+++ b/frontend/src/scenes/settings/types.ts@@ -79,6 +79,7 @@ export type SettingSectionId =| 'user-api-keys'| 'user-connected-apps'| 'user-customization'+ | 'user-navigation'| 'user-feature-previews'| 'user-notifications'| 'user-personal-integrations'@@ -169,6 +170,7 @@ export type SettingId =| 'group-analytics'| 'heatmaps'| 'hedgehog-mode'+ | 'homepage'| 'human-friendly-comparison-periods'| 'integration-error-tracking'| 'integration-github'@@ -245,6 +247,8 @@ export type SettingId =| 'session-join-mode'| 'session-table-version'| 'sidebar-auto-suggest'+ | 'sidebar-items'+ | 'sidebar-my-tools'| 'snippet'| 'snippet-v2'| 'surveys-default-appearance'diff --git a/frontend/src/scenes/settings/user/SidebarSettings.tsx b/frontend/src/scenes/settings/user/SidebarSettings.tsxnew file mode 100644index 000000000000..75b96ad79a26--- /dev/null+++ b/frontend/src/scenes/settings/user/SidebarSettings.tsx@@ -0,0 +1,223 @@+import { useActions, useValues } from 'kea'++import { LemonLabel, LemonSwitch } from '@posthog/lemon-ui'++import { Link } from 'lib/lemon-ui/Link'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'+import { getProductAccessDisabledReason } from 'lib/utils/accessControlUtils'+import { PRODUCT_BRANDING } from 'scenes/welcome/productBranding'++import { customProductsLogic } from '~/layout/panel-layout/ProjectTree/customProductsLogic'+import { getDefaultTreeProducts, iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'+import { getCategoryOrder } from '~/layout/panel-layout/ProjectTree/utils'+import {+ SIDEBAR_CUSTOMIZABLE_FOOTER_ITEMS,+ SIDEBAR_CUSTOMIZABLE_SECTIONS,+ SidebarCustomizableItem,+} from '~/layout/panel-layout/sidebarCustomization'+import { HomepageConfiguration } from '~/layout/scenes/HomepageConfiguration'+import { uiCustomizationLogic } from '~/layout/uiCustomizationLogic'+import { productConfiguration } from '~/products'+import { FileSystemImport } from '~/queries/schema/schema-general'++export function HomepageSetting(): JSX.Element {+ return (+ <div className="max-w-160">+ <HomepageConfiguration />+ </div>+ )+}++function ItemLabel({+ icon,+ label,+ description,+ docsHref,+}: {+ icon: JSX.Element+ label: string+ description?: string+ docsHref?: string+}): JSX.Element {+ return (+ <span className="flex items-center gap-2">+ <span className="text-lg text-secondary flex items-center">{icon}</span>+ <span className="flex flex-col">+ <span className="flex items-center gap-2">+ {label}+ {docsHref && (+ <Link+ to={docsHref}+ target="_blank"+ className="text-xs font-normal"+ onClick={(e) => e.stopPropagation()}+ >+ Docs+ </Link>+ )}+ </span>+ {description && <span className="text-xs font-normal text-secondary">{description}</span>}+ </span>+ </span>+ )+}++export function SidebarItemsSetting(): JSX.Element {+ const { isSidebarSectionShown, isSidebarItemShown, userLoading } = useValues(uiCustomizationLogic)+ const { setSidebarSectionShown, setSidebarItemShown } = useActions(uiCustomizationLogic)+ const { featureFlags } = useValues(featureFlagLogic)++ const renderItemSwitch = (item: SidebarCustomizableItem): JSX.Element => {+ const { key } = item+ if (!key) {+ return (+ <LemonSwitch+ key={item.label}+ className="py-2"+ checked={true}+ disabledReason={`${item.label} always stays visible`}+ label={<ItemLabel icon={item.icon} label={item.label} description={item.description} />}+ bordered+ fullWidth+ data-attr={`sidebar-customization-item-${item.label.toLowerCase()}`}+ />+ )+ }+ return (+ <LemonSwitch+ key={key}+ className="py-2"+ checked={isSidebarItemShown(key)}+ onChange={(checked) => setSidebarItemShown(key, checked)}+ loading={userLoading}+ label={<ItemLabel icon={item.icon} label={item.label} description={item.description} />}+ bordered+ fullWidth+ data-attr={`sidebar-customization-item-${key}`}+ />+ )+ }++ return (+ <div className="flex flex-col gap-4 max-w-160">+ {SIDEBAR_CUSTOMIZABLE_SECTIONS.map((section) => {+ const items = section.items.filter(+ (item) => !item.flag || (featureFlags as Record<string, boolean | string>)[item.flag]+ )+ // A section with no items of its own is a single sidebar element, so it toggles+ // directly rather than heading a group.+ if (items.length === 0) {+ return (+ <LemonSwitch+ key={section.key}+ className="py-2"+ checked={isSidebarSectionShown(section.key)}+ onChange={(checked) => setSidebarSectionShown(section.key, checked)}+ loading={userLoading}+ label={+ <ItemLabel+ icon={section.icon}+ label={section.label}+ description={section.description}+ />+ }+ bordered+ fullWidth+ data-attr={`sidebar-customization-section-${section.key}`}+ />+ )+ }+ return (+ <div key={section.key} className="flex flex-col gap-2">+ <LemonLabel>{section.label}</LemonLabel>+ {items.map((item) => renderItemSwitch(item))}+ </div>+ )+ })}+ <div className="flex flex-col gap-2">+ <LemonLabel>Bottom of the sidebar</LemonLabel>+ {SIDEBAR_CUSTOMIZABLE_FOOTER_ITEMS.filter(+ (item) => !item.flag || (featureFlags as Record<string, boolean | string>)[item.flag]+ ).map((item) => renderItemSwitch(item))}+ </div>+ </div>+ )+}++export function SidebarMyToolsSetting(): JSX.Element {+ const { enabledToolPaths, customProductsLoading } = useValues(customProductsLogic)+ const { setToolEnabled } = useActions(customProductsLogic)+ const { featureFlags } = useValues(featureFlagLogic)++ const products = getDefaultTreeProducts()+ .filter((product) => !product.flag || (featureFlags as Record<string, boolean | string>)[product.flag])+ .filter((product) => !getProductAccessDisabledReason(product))+ const productsByCategory = new Map<string, FileSystemImport[]>()+ for (const product of products) {+ const category = product.category || 'Other'+ if (!productsByCategory.has(category)) {+ productsByCategory.set(category, [])+ }+ productsByCategory.get(category)?.push(product)+ }+ // Mirror the sidebar tree ordering: hardcoded category order, then visualOrder, then name.+ const sortProducts = (a: FileSystemImport, b: FileSystemImport): number => {+ if (a.visualOrder !== undefined && b.visualOrder !== undefined) {+ return a.visualOrder - b.visualOrder+ }+ if (a.visualOrder !== undefined) {+ return -1+ }+ if (b.visualOrder !== undefined) {+ return 1+ }+ return (a.displayLabel ?? a.path).localeCompare(b.displayLabel ?? b.path, undefined, {+ sensitivity: 'accent',+ })+ }++ return (+ // The colorful-product-icons group class turns on each tool's brand color, as in the navbar.+ <div className="flex flex-col gap-4 max-w-160 group/colorful-product-icons colorful-product-icons-true">+ {[...productsByCategory.entries()]+ .sort(+ (a, b) =>+ getCategoryOrder(a[0]) - getCategoryOrder(b[0]) ||+ a[0].localeCompare(b[0], undefined, { sensitivity: 'accent' })+ )+ .map(([category, categoryProducts]) => (+ <div key={category} className="flex flex-col gap-2">+ <LemonLabel>{category}</LemonLabel>+ {[...categoryProducts].sort(sortProducts).map((product) => {+ const description: string | undefined = product.sceneKey+ ? productConfiguration[product.sceneKey]?.description+ : undefined+ const docsHref: string | undefined = product.intents?.length+ ? PRODUCT_BRANDING[product.intents[0]]?.docsHref+ : undefined+ return (+ <LemonSwitch+ key={product.path}+ className="py-2"+ checked={enabledToolPaths.has(product.path)}+ onChange={(checked) => setToolEnabled(product.path, checked)}+ loading={customProductsLoading}+ label={+ <ItemLabel+ icon={iconForType(product.iconType, product.iconColor)}+ label={product.displayLabel ?? product.path}+ description={description}+ docsHref={docsHref}+ />+ }+ bordered+ fullWidth+ data-attr={`sidebar-customization-tool-${product.path}`}+ />+ )+ })}+ </div>+ ))}+ </div>+ )+}diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex 499f7865192c..27dddc958f5a 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -76,6 +76,7 @@ import type {SharingConfigurationSettings,TileFilters,UserProductListItem,+ UserUIConfiguration,} from '~/queries/schema/schema-general'import { QueryContext } from '~/queries/types'@@ -383,6 +384,8 @@ export interface UserType extends UserBaseType {shortcut_position: UserShortcutPositionhas_seen_product_intro_for?: Record<string, boolean>hide_mcp_hints?: boolean+ /** Per-user UI customization. Null means no customization: every element is shown. */+ ui_configuration?: UserUIConfiguration | nullscene_personalisation?: SceneDashboardChoice[]theme_mode?: UserTheme | nullhedgehog_config?: HedgehogConfigdiff --git a/posthog/api/test/__snapshots__/test_element.ambr b/posthog/api/test/__snapshots__/test_element.ambrindex dcc6352f8fcd..e9651864ff5f 100644--- a/posthog/api/test/__snapshots__/test_element.ambr+++ b/posthog/api/test/__snapshots__/test_element.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -176,6 +177,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -685,6 +687,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -786,6 +789,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/posthog/api/test/__snapshots__/test_preflight.ambr b/posthog/api/test/__snapshots__/test_preflight.ambrindex 4b2d46e5d987..8d4f2a53c18b 100644--- a/posthog/api/test/__snapshots__/test_preflight.ambr+++ b/posthog/api/test/__snapshots__/test_preflight.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambrindex 8d435393e3e3..94ef638b5a93 100644--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -399,6 +400,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -948,6 +950,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -1174,6 +1177,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1213,6 +1217,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -1276,6 +1281,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -1315,6 +1321,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -1877,6 +1884,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1916,6 +1924,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -1979,6 +1988,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -2018,6 +2028,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -2260,6 +2271,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2470,6 +2482,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2849,6 +2862,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3391,6 +3405,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -3805,6 +3820,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3926,6 +3942,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -4806,6 +4823,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5223,6 +5241,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -5449,6 +5468,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5488,6 +5508,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -5551,6 +5572,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -5590,6 +5612,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -6119,6 +6142,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6158,6 +6182,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -6221,6 +6246,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -6260,6 +6286,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -6478,6 +6505,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6733,6 +6761,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6772,6 +6801,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -6835,6 +6865,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -6874,6 +6905,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -6945,6 +6977,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -7876,6 +7909,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -7915,6 +7949,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -7978,6 +8013,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -8017,6 +8053,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -8088,6 +8125,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -9061,6 +9099,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -9947,6 +9986,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -10915,6 +10955,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11133,6 +11174,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11172,6 +11214,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -11235,6 +11278,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -11274,6 +11318,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -11684,6 +11729,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11723,6 +11769,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -11786,6 +11833,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -11825,6 +11873,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -12259,6 +12308,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -12312,6 +12362,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -12648,6 +12699,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -12687,6 +12739,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -12750,6 +12803,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -12789,6 +12843,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -12860,6 +12915,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -13791,6 +13847,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -13830,6 +13887,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",@@ -13893,6 +13951,7 @@T10."shortcut_position",T10."passkeys_enabled_for_2fa",T10."hide_mcp_hints",+ T10."ui_configuration",T10."onboarding_skipped_at",T10."onboarding_skipped_reason",T10."onboarding_skipped_organization_id",@@ -13932,6 +13991,7 @@T11."shortcut_position",T11."passkeys_enabled_for_2fa",T11."hide_mcp_hints",+ T11."ui_configuration",T11."onboarding_skipped_at",T11."onboarding_skipped_reason",T11."onboarding_skipped_organization_id",@@ -14003,6 +14063,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -14451,6 +14512,7 @@T6."shortcut_position",T6."passkeys_enabled_for_2fa",T6."hide_mcp_hints",+ T6."ui_configuration",T6."onboarding_skipped_at",T6."onboarding_skipped_reason",T6."onboarding_skipped_organization_id",diff --git a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambrindex ead3d918377c..e03dac3b34be 100644--- a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr+++ b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -119,6 +120,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -606,6 +608,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -645,6 +648,7 @@T5."shortcut_position",T5."passkeys_enabled_for_2fa",T5."hide_mcp_hints",+ T5."ui_configuration",T5."onboarding_skipped_at",T5."onboarding_skipped_reason",T5."onboarding_skipped_organization_id",@@ -1133,6 +1137,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1203,6 +1208,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1592,6 +1598,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/posthog/api/test/test_user.py b/posthog/api/test/test_user.pyindex d2b3e704a4a7..4ed52214eb78 100644--- a/posthog/api/test/test_user.py+++ b/posthog/api/test/test_user.py@@ -14,6 +14,7 @@ from django.contrib.auth.tokens import default_token_generatorfrom django.core import mailfrom django.core.cache import cachefrom django.db import connection+from django.test import SimpleTestCasefrom django.test.utils import CaptureQueriesContextfrom django.utils import timezonefrom django.utils.text import slugify@@ -26,6 +27,7 @@ from social_django.models import UserSocialAuthfrom posthog.api.email_verification import email_verification_token_generatorfrom posthog.api.oauth.toolbar_service import ToolbarOAuthState, build_toolbar_oauth_state, new_state_nonce+from posthog.api.user import UserSerializerfrom posthog.constants import AvailableFeaturefrom posthog.models import Team, Userfrom posthog.models.instance_setting import set_instance_setting@@ -33,6 +35,7 @@ from posthog.models.oauth import OAuthAccessToken, OAuthApplication, OAuthGrant,from posthog.models.organization import Organization, OrganizationMembershipfrom posthog.models.organization_domain import OrganizationDomainfrom posthog.models.personal_api_key import PersonalAPIKey+from posthog.models.user import default_ui_configuration_for_new_usersfrom posthog.models.utils import generate_random_token_personal, hash_key_valuefrom posthog.models.webauthn_credential import WebauthnCredentialfrom posthog.temporal.tests.delete_teams.inline import execute_deletion_workflows_inline@@ -261,6 +264,35 @@ class TestUserAPI(APIBaseTest):assert response.status_code == status.HTTP_200_OKassert response.json() == {"a bag": "of data"}+ def test_can_update_ui_configuration(self):+ configuration = {+ "version": 1,+ "sidebar": {+ "sections": {"recents": {"visible": False}},+ "items": {"data": {"visible": False}},+ },+ }++ response = self.client.patch("/api/users/@me/", {"ui_configuration": configuration})++ self.assertEqual(response.status_code, status.HTTP_200_OK)+ self.assertEqual(response.json()["ui_configuration"], configuration)+ self.user.refresh_from_db()+ self.assertEqual(self.user.ui_configuration, configuration)++ def test_cannot_update_ui_configuration_not_matching_schema(self):+ configuration_before = self.user.ui_configuration++ response = self.client.patch(+ "/api/users/@me/",+ {"ui_configuration": {"version": 1, "sidebar": {"items": {"bogus": {"visible": False}}}}},+ )++ self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)+ self.assertEqual(response.json()["attr"], "ui_configuration")+ self.user.refresh_from_db()+ self.assertEqual(self.user.ui_configuration, configuration_before)+def test_users_me_includes_active_realtime_notification_types(self):self.client.force_login(self.user)response = self.client.get("/api/users/@me/")@@ -2148,6 +2180,58 @@ class TestUserAPI(APIBaseTest):)+class TestUserUIConfigurationValidation(SimpleTestCase):+ @parameterized.expand(+ [+ ("not_an_object", ["version"]),+ ("missing_version", {"sidebar": {}}),+ ("unknown_top_level_key", {"version": 1, "surprise": True}),+ ("unknown_section", {"version": 1, "sidebar": {"sections": {"bogus": {"visible": False}}}}),+ ("unknown_item", {"version": 1, "sidebar": {"items": {"bogus": {"visible": False}}}}),+ ("activity_not_customizable", {"version": 1, "sidebar": {"items": {"activity": {"visible": False}}}}),+ ("non_boolean_visible", {"version": 1, "sidebar": {"items": {"home": {"visible": "nope"}}}}),+ ("unknown_node_key", {"version": 1, "sidebar": {"items": {"home": {"visible": False, "size": 1}}}}),+ ]+ )+ def test_invalid_ui_configuration_is_rejected(self, _name, value):+ serializer = UserSerializer(data={"ui_configuration": value}, partial=True)++ self.assertFalse(serializer.is_valid())+ self.assertIn("ui_configuration", serializer.errors)++ @parameterized.expand(+ [+ ("null", None),+ ("minimal", {"version": 1}),+ (+ "full",+ {+ "version": 1,+ "sidebar": {+ "sections": {"project": {"visible": True}, "recents": {}, "my_tools": {"visible": False}},+ "items": {+ "home": {"visible": False},+ "inbox": {"visible": False},+ "data": {"visible": False},+ "files": {"visible": False},+ "tools": {"visible": False},+ "starred": {"visible": False},+ "notifications": {"visible": False},+ "help": {"visible": False},+ },+ },+ },+ ),+ ("new_user_default", default_ui_configuration_for_new_users()),+ ]+ )+ def test_valid_ui_configuration_is_accepted(self, _name, value):+ serializer = UserSerializer(data={"ui_configuration": value}, partial=True)++ self.assertTrue(serializer.is_valid(), serializer.errors)+ self.assertEqual(serializer.validated_data["ui_configuration"], value)++@pytest.mark.eeclass TestToolbarAccessControl(APIBaseTest):"""The toolbar launch endpoints must respect the `toolbar` resource's access control."""diff --git a/posthog/api/user.py b/posthog/api/user.pyindex 161efb483d99..cf7f2e89d9f5 100644--- a/posthog/api/user.py+++ b/posthog/api/user.py@@ -22,6 +22,7 @@ from django.utils.html import escapefrom django.views.decorators.http import require_http_methodsimport jwt+import pydanticimport requestsimport structlogimport posthoganalytics@@ -43,6 +44,8 @@ from social_django.models import UserSocialAuthfrom two_factor.forms import TOTPDeviceFormfrom two_factor.utils import default_device+from posthog.schema import UserUIConfiguration+from posthog.api.email_verification import EmailVerifier, email_verification_token_generatorfrom posthog.api.oauth.toolbar_service import (ToolbarOAuthError,@@ -234,6 +237,15 @@ class UserSerializer(serializers.ModelSerializer):),)scene_personalisation = ScenePersonalisationBasicSerializer(many=True, read_only=True)+ ui_configuration = serializers.JSONField(+ required=False,+ allow_null=True,+ help_text=(+ "Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers "+ "sidebar section and item visibility. Send the complete object: it replaces the stored value "+ "wholesale. Null means no customization; absent keys mean the element is shown."+ ),+ )anonymize_data = ClassicBehaviorBooleanFieldSerializer(help_text="Whether PostHog should anonymize events captured for this user when identified.")@@ -308,6 +320,7 @@ class UserSerializer(serializers.ModelSerializer):"role_at_organization","passkeys_enabled_for_2fa","hide_mcp_hints",+ "ui_configuration","onboarding_skipped_at","onboarding_skipped_reason","onboarding_skipped_organization_id",@@ -628,6 +641,20 @@ class UserSerializer(serializers.ModelSerializer):return cast(Notifications, current_settings)+ def validate_ui_configuration(self, value: Optional[dict[str, Any]]) -> Optional[dict[str, Any]]:+ if value is None:+ return None+ try:+ UserUIConfiguration.model_validate(value)+ except pydantic.ValidationError as e:+ errors = "; ".join(+ f"{'.'.join(str(part) for part in error['loc']) or 'root'}: {error['msg']}" for error in e.errors()+ )+ raise serializers.ValidationError(+ f"Does not match the UserUIConfiguration schema: {errors}", code="invalid_input"+ )+ return value+def validate_password_change(self, instance: User, current_password: Optional[str], password: Optional[str]) -> Optional[str]:@@ -945,6 +972,7 @@ class UserViewSet("has_seen_product_intro_for","events_column_config","role_at_organization",+ "ui_configuration",]time_sensitive_exclude_actions = ["hedgehog_config",diff --git a/posthog/hogql/database/test/__snapshots__/test_database.ambr b/posthog/hogql/database/test/__snapshots__/test_database.ambrindex 29650fba144e..c7cf79fc2622 100644--- a/posthog/hogql/database/test/__snapshots__/test_database.ambr+++ b/posthog/hogql/database/test/__snapshots__/test_database.ambr@@ -117,6 +117,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -218,6 +219,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -380,6 +382,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -497,6 +500,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -598,6 +602,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -722,6 +727,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txt b/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txtindex 3754b9e4054b..b28b70c1b456 100644--- a/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txt+++ b/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txt@@ -18,3 +18,4 @@# posthog.1234_team_some_genuinely_core_fieldposthog.1244_team_event_retention_monthsposthog.1262_organization_members_can_see_org_members+posthog.1272_user_ui_configurationdiff --git a/posthog/migrations/1272_user_ui_configuration.py b/posthog/migrations/1272_user_ui_configuration.pynew file mode 100644index 000000000000..e5baeb1172eb--- /dev/null+++ b/posthog/migrations/1272_user_ui_configuration.py@@ -0,0 +1,22 @@+from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("posthog", "1271_add_pardot_integration_kind"),+ ]++ # Nullable with no default so existing rows stay NULL, which the frontend resolves as+ # "everything shown". New accounts get their default in UserManager.create_user instead,+ # keeping this a metadata-only ADD COLUMN on the hot posthog_user table.+ operations = [+ migrations.AddField(+ model_name="user",+ name="ui_configuration",+ field=models.JSONField(+ blank=True,+ help_text="Per-user UI customization (currently sidebar element visibility), shaped like the UserUIConfiguration schema. NULL means the user has no customization and every element shows.",+ null=True,+ ),+ ),+ ]diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txtindex 91f82bca936c..bb0b540d5bc6 100644--- a/posthog/migrations/max_migration.txt+++ b/posthog/migrations/max_migration.txt@@ -1 +1 @@-1271_add_pardot_integration_kind+1272_user_ui_configurationdiff --git a/posthog/models/test/test_user_model.py b/posthog/models/test/test_user_model.pyindex 14d6160509ea..526d1ca29da5 100644--- a/posthog/models/test/test_user_model.py+++ b/posthog/models/test/test_user_model.py@@ -8,6 +8,7 @@ from django.core.management.base import CommandErrorfrom posthog.constants import AvailableFeaturefrom posthog.models import Team, Userfrom posthog.models.organization import Organization, OrganizationMembership+from posthog.models.user import default_ui_configuration_for_new_usersfrom ee.models.rbac.access_control import AccessControl@@ -19,6 +20,10 @@ class TestUser(BaseTest):self.assertNotEqual(user.distinct_id, "")self.assertNotEqual(user.distinct_id, None)+ def test_create_user_sets_slim_ui_configuration_default(self):+ user = User.objects.create_user(first_name="Tim", email="[email protected]", password=None)+ self.assertEqual(user.ui_configuration, default_ui_configuration_for_new_users())+def test_create_superuser_raises_with_guidance(self):with self.assertRaises(CommandError) as ctx:User.objects.create_superuser(email="[email protected]", password="12345678")diff --git a/posthog/models/user.py b/posthog/models/user.pyindex e6bbcfe850f7..186655b7394e 100644--- a/posthog/models/user.py+++ b/posthog/models/user.py@@ -111,6 +111,7 @@ class UserManager(BaseUserManager):raise ValueError("Email must be provided!")email = EmailNormalizer.normalize(email)extra_fields.setdefault("distinct_id", generate_random_token())+ extra_fields.setdefault("ui_configuration", default_ui_configuration_for_new_users())user = cast("User", self.model(email=email, first_name=first_name, **extra_fields))if password is not None:# nosemgrep: python.django.security.audit.unvalidated-password.unvalidated-password (validation happens at serializer/view layer before reaching this method)@@ -186,6 +187,22 @@ def events_column_config_default() -> dict[str, Any]:return {"active": "DEFAULT"}+# New users start with a slimmer sidebar. Existing users keep ui_configuration NULL, which the+# frontend resolves as "everything shown" (their pre-customization experience). Absent keys also+# mean "shown", so this only lists the elements hidden by default for new accounts. The shape must+# stay valid against the UserUIConfiguration schema (see frontend/src/queries/schema/schema-general.ts).+def default_ui_configuration_for_new_users() -> dict[str, Any]:+ return {+ "version": 1,+ "sidebar": {+ "items": {+ "files": {"visible": False},+ "starred": {"visible": False},+ },+ },+ }++class ThemeMode(models.TextChoices):LIGHT = "light", "Light"DARK = "dark", "Dark"@@ -261,6 +278,14 @@ class User(AbstractUser, UUIDTClassicModel, ModelActivityMixin): # type: ignoreblank=False,help_text="When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.",)+ # No field default on purpose: existing rows must stay NULL so long-time users keep seeing+ # everything. New accounts get default_ui_configuration_for_new_users() via UserManager.create_user.+ ui_configuration = models.JSONField(+ null=True,+ blank=True,+ help_text="Per-user UI customization (currently sidebar element visibility), shaped like the "+ "UserUIConfiguration schema. NULL means the user has no customization and every element shows.",+ )# Onboarding exit tracking. Set when the user explicitly leaves the onboarding flow (skip or delegate).ONBOARDING_SKIPPED_REASONS = OnboardingSkippedReason.choicesdiff --git a/posthog/schema.py b/posthog/schema.pyindex cbda9a18ec4c..894bf88851f6 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -2750,6 +2750,13 @@ class TrendsFormulaNode(BaseModel):formula: str+class UIVisibilityConfig(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ visible: bool | None = None++class UserBasicType(BaseModel):model_config = ConfigDict(extra="forbid",@@ -6394,6 +6401,51 @@ class SessionsTimelineQueryResponse(BaseModel):)+class SidebarItemsConfiguration(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ data: UIVisibilityConfig | None = Field(default=None, description='"Data" panel trigger in the Project section.')+ files: UIVisibilityConfig | None = Field(default=None, description='"Files" panel trigger in the Project section.')+ help: UIVisibilityConfig | None = Field(default=None, description='"Help" entry in the sidebar footer.')+ home: UIVisibilityConfig | None = Field(default=None, description='"Home" link in the Project section.')+ inbox: UIVisibilityConfig | None = Field(+ default=None,+ description=('"Inbox" link in the Project section. Only rendered when the inbox feature is available.'),+ )+ notifications: UIVisibilityConfig | None = Field(+ default=None,+ description=(+ '"Notifications" entry in the sidebar footer. Only rendered when real-time notifications are available.'+ ),+ )+ starred: UIVisibilityConfig | None = Field(+ default=None, description='"Starred" panel trigger in the Project section.'+ )+ tools: UIVisibilityConfig | None = Field(default=None, description='"Tools" panel trigger in the Project section.')+++class SidebarSectionsConfiguration(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ my_tools: UIVisibilityConfig | None = Field(+ default=None,+ description='The "My tools" section, listing the user\'s selected tools.',+ )+ project: UIVisibilityConfig | None = Field(+ default=None,+ description=(+ 'The "Project" section (Home and the Data/Files/Tools/Starred panel'+ " triggers). Activity stays visible even when this section is hidden."+ ),+ )+ recents: UIVisibilityConfig | None = Field(+ default=None,+ description='The "Recents" section, listing recently viewed items.',+ )++class SourceFieldFileUploadConfig(BaseModel):model_config = ConfigDict(extra="forbid",@@ -21638,6 +21690,14 @@ class SessionsTimelineQuery(BaseModel):version: float | None = Field(default=None, description="version of the node, used for schema migrations")+class SidebarConfiguration(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ items: SidebarItemsConfiguration | None = None+ sections: SidebarSectionsConfiguration | None = None++class SurveyCreationSchema(BaseModel):model_config = ConfigDict(extra="forbid",@@ -21856,6 +21916,17 @@ class UsageMetricsQuery(BaseModel):version: float | None = Field(default=None, description="version of the node, used for schema migrations")+class UserUIConfiguration(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ sidebar: SidebarConfiguration | None = None+ version: int = Field(+ ...,+ description=("Schema version of this configuration blob, for future format migrations."),+ )++class VectorSearchQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambrindex 049e6ca96809..796a264c9fad 100644--- a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr+++ b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr@@ -201,6 +201,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -240,6 +241,7 @@T4."shortcut_position",T4."passkeys_enabled_for_2fa",T4."hide_mcp_hints",+ T4."ui_configuration",T4."onboarding_skipped_at",T4."onboarding_skipped_reason",T4."onboarding_skipped_organization_id",@@ -327,6 +329,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -838,6 +841,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -877,6 +881,7 @@T4."shortcut_position",T4."passkeys_enabled_for_2fa",T4."hide_mcp_hints",+ T4."ui_configuration",T4."onboarding_skipped_at",T4."onboarding_skipped_reason",T4."onboarding_skipped_organization_id",@@ -1045,6 +1050,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1146,6 +1152,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1213,6 +1220,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1315,6 +1323,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1421,6 +1430,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1948,6 +1958,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1987,6 +1998,7 @@T4."shortcut_position",T4."passkeys_enabled_for_2fa",T4."hide_mcp_hints",+ T4."ui_configuration",T4."onboarding_skipped_at",T4."onboarding_skipped_reason",T4."onboarding_skipped_organization_id",diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambrindex 2fd24a868dc7..4b7f66e08def 100644--- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr+++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr@@ -39,6 +39,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -146,6 +147,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -580,6 +582,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -681,6 +684,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -799,6 +803,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -906,6 +911,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1336,6 +1342,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1437,6 +1444,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1555,6 +1563,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1662,6 +1671,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2088,6 +2098,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2189,6 +2200,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2307,6 +2319,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2414,6 +2427,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2840,6 +2854,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2941,6 +2956,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3059,6 +3075,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3166,6 +3183,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3596,6 +3614,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3697,6 +3716,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3815,6 +3835,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -3922,6 +3943,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -4352,6 +4374,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -4453,6 +4476,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -4571,6 +4595,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -4678,6 +4703,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5108,6 +5134,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5209,6 +5236,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5327,6 +5355,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5453,6 +5482,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5832,6 +5862,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -5933,6 +5964,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6038,6 +6070,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6102,6 +6135,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6261,6 +6295,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6683,6 +6718,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6784,6 +6820,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -6908,6 +6945,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -7210,6 +7248,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -7589,6 +7628,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -7690,6 +7730,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -7866,6 +7907,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -8033,6 +8075,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -8436,6 +8479,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -8537,6 +8581,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -8661,6 +8706,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -8908,6 +8954,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -9009,6 +9056,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -9272,6 +9320,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -9407,6 +9456,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -9838,6 +9888,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -9939,6 +9990,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -10063,6 +10115,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -10226,6 +10279,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -10605,6 +10659,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -10706,6 +10761,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -10880,6 +10936,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11023,6 +11080,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11328,6 +11386,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11503,6 +11562,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11604,6 +11664,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11728,6 +11789,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11885,6 +11947,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -11968,6 +12031,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -12347,6 +12411,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -12448,6 +12513,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -12610,6 +12676,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -12761,6 +12828,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -13059,6 +13127,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -13212,6 +13281,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -13313,6 +13383,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -13437,6 +13508,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambrindex 02809d541cdd..8bbe435fb621 100644--- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr+++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr@@ -652,6 +652,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -825,6 +826,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1520,6 +1522,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/products/actions/backend/api/test/__snapshots__/test_action.ambr b/products/actions/backend/api/test/__snapshots__/test_action.ambrindex 9e56876e2763..a60eefd669d1 100644--- a/products/actions/backend/api/test/__snapshots__/test_action.ambr+++ b/products/actions/backend/api/test/__snapshots__/test_action.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -421,6 +422,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -506,6 +508,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1035,6 +1038,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1283,6 +1287,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1342,6 +1347,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambrindex b58942954050..c0cc01791854 100644--- a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr+++ b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -460,6 +461,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -516,6 +518,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1084,6 +1087,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1296,6 +1300,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr b/products/cdp/backend/api/test/__snapshots__/test_plugin.ambrindex 70cbba2a4a9a..476ef34639ae 100644--- a/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr+++ b/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -313,6 +314,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -681,6 +683,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1124,6 +1127,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambr b/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambrindex 83f81aae5bba..b9d87048a8a1 100644--- a/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambr+++ b/products/early_access_features/backend/test/__snapshots__/test_early_access_feature.ambr@@ -211,6 +211,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -394,6 +395,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -533,6 +535,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -722,6 +725,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -965,6 +969,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1052,6 +1057,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1193,6 +1199,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1280,6 +1287,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambrindex 666e99f7182c..1894f5ed43a4 100644--- a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr+++ b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr@@ -479,6 +479,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1306,6 +1307,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1632,6 +1634,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1671,6 +1674,7 @@T5."shortcut_position",T5."passkeys_enabled_for_2fa",T5."hide_mcp_hints",+ T5."ui_configuration",T5."onboarding_skipped_at",T5."onboarding_skipped_reason",T5."onboarding_skipped_organization_id",@@ -1779,6 +1783,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr b/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambrindex fa1a76ac7d7b..127677ce5fd1 100644--- a/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr+++ b/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr@@ -31,6 +31,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2346,6 +2347,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2475,6 +2477,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2748,6 +2751,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -2794,6 +2798,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/products/product_analytics/backend/api/test/__snapshots__/test_insight.ambr b/products/product_analytics/backend/api/test/__snapshots__/test_insight.ambrindex 8e6a331ed82e..a57f653cfc44 100644--- a/products/product_analytics/backend/api/test/__snapshots__/test_insight.ambr+++ b/products/product_analytics/backend/api/test/__snapshots__/test_insight.ambr@@ -441,6 +441,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -682,6 +683,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",@@ -1322,6 +1324,7 @@"posthog_user"."shortcut_position","posthog_user"."passkeys_enabled_for_2fa","posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration","posthog_user"."onboarding_skipped_at","posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex e4109b174f9e..70fe313cdcc1 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -46852,6 +46852,8 @@ export namespace Schemas {passkeys_enabled_for_2fa?: boolean | null;/** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */hide_mcp_hints?: boolean;+ /** Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown. */+ ui_configuration?: unknown;/** @nullable */readonly onboarding_skipped_at: string | null;readonly onboarding_skipped_reason: OnboardingSkippedReasonEnum | null;@@ -54656,6 +54658,8 @@ export namespace Schemas {passkeys_enabled_for_2fa?: boolean | null;/** When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions. */hide_mcp_hints?: boolean;+ /** Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown. */+ ui_configuration?: unknown;/** @nullable */readonly onboarding_skipped_at?: string | null;readonly onboarding_skipped_reason?: OnboardingSkippedReasonEnum | null;diff --git a/services/mcp/src/generated/core/api.ts b/services/mcp/src/generated/core/api.tsindex 8c894cd76506..e1ad6c4350a0 100644--- a/services/mcp/src/generated/core/api.ts+++ b/services/mcp/src/generated/core/api.ts@@ -884,4 +884,10 @@ export const UsersPartialUpdateBody = /* @__PURE__ */ zod.object({.describe('When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'),+ ui_configuration: zod+ .unknown()+ .optional()+ .describe(+ 'Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown.'+ ),})diff --git a/services/mcp/src/tools/generated/core.ts b/services/mcp/src/tools/generated/core.tsindex 4f75c3a51080..42a2fdda8f05 100644--- a/services/mcp/src/tools/generated/core.ts+++ b/services/mcp/src/tools/generated/core.ts@@ -586,6 +586,9 @@ const userSettingsUpdate = (): ToolBase<typeof UserSettingsUpdateSchema, Schemasif (params.hide_mcp_hints !== undefined) {body['hide_mcp_hints'] = params.hide_mcp_hints}+ if (params.ui_configuration !== undefined) {+ body['ui_configuration'] = params.ui_configuration+ }const result = await context.api.request<Schemas.User>({method: 'PATCH',path: `/api/users/${encodeURIComponent(String(params.uuid))}/`,diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/user-settings-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/user-settings-update.jsonindex 1635ef6ba886..6c8d56e8095c 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/user-settings-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/user-settings-update.json@@ -139,6 +139,9 @@}]},+ "ui_configuration": {+ "description": "Per-user UI customization, validated against the `UserUIConfiguration` schema. Currently covers sidebar section and item visibility. Send the complete object: it replaces the stored value wholesale. Null means no customization; absent keys mean the element is shown."+ },"uuid": {"description": "User UUID, or `@me` to target the authenticated user.","type": "string"