Skip to content

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

feat(today): deprecate the side panel info tab (#116204)

Adam Leith1029ea6b0fb9
diff --git a/frontend/src/layout/GlobalShortcuts.tsx b/frontend/src/layout/GlobalShortcuts.tsx
index 01013c48a413..5f56d9a70967 100644
--- a/frontend/src/layout/GlobalShortcuts.tsx
+++ b/frontend/src/layout/GlobalShortcuts.tsx
@@ -13,18 +13,15 @@ import { superpowersLogic } from 'lib/components/Superpowers/superpowersLogic'
import { removeProjectIdIfPresent } from 'lib/utils/kea-router'
import { urls } from 'scenes/urls'
-import { SidePanelTab } from '~/types'
-
import { navigation3000Logic } from './navigation-3000/navigationLogic'
+import { sidePanelLogic } from './navigation-3000/sidepanel/sidePanelLogic'
import { sidePanelStateLogic } from './navigation-3000/sidepanel/sidePanelStateLogic'
import { themeLogic } from './navigation-3000/themeLogic'
-import { sceneLayoutLogic } from './scenes/sceneLayoutLogic'
export function GlobalShortcuts(): null {
const { superpowersEnabled, user, excludedFromPostHogTeamCohort } = useValues(superpowersLogic)
const { setExcludedFromPostHogTeamCohort } = useActions(superpowersLogic)
const { shortcutMenuOpen } = useValues(shortcutLogic)
- const { scenePanelIsPresent } = useValues(sceneLayoutLogic)
const { setShortcutMenuOpen } = useActions(shortcutLogic)
const { toggleZenMode } = useActions(navigation3000Logic)
const { toggleCommand } = useActions(commandLogic)
@@ -35,8 +32,7 @@ export function GlobalShortcuts(): null {
const { openSidePanel, closeSidePanel } = useActions(sidePanelStateLogic)
const { sidePanelOpen } = useValues(sidePanelStateLogic)
- // Open Info tab if scene has panel content, otherwise default to PostHog AI
- const defaultTab = scenePanelIsPresent ? SidePanelTab.Info : SidePanelTab.Max
+ const { defaultTab } = useValues(sidePanelLogic)
useShortcut({
name: 'Search',
diff --git a/frontend/src/layout/navigation-3000/sidepanel/SidePanelNavigation.tsx b/frontend/src/layout/navigation-3000/sidepanel/SidePanelNavigation.tsx
index 70e81d0c31a5..ddf7d731ade5 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/SidePanelNavigation.tsx
+++ b/frontend/src/layout/navigation-3000/sidepanel/SidePanelNavigation.tsx
@@ -23,7 +23,9 @@ interface SidePanelNavigationProps {
export function SidePanelNavigation({ activeTab, onTabChange, children }: SidePanelNavigationProps): JSX.Element {
const { openSidePanel, closeSidePanel } = useActions(sidePanelStateLogic)
- const { visibleTabs } = useValues(sidePanelLogic)
+ const { visibleTabs, deprecatedTabs } = useValues(sidePanelLogic)
+ // The first deprecated tab takes the auto margin, which pushes it and the rest to the far end.
+ const firstDeprecatedTab = visibleTabs.find((tab) => deprecatedTabs.includes(tab))
return (
<Tabs.Root
@@ -39,7 +41,15 @@ export function SidePanelNavigation({ activeTab, onTabChange, children }: SidePa
{visibleTabs.map((tab) => {
const { Icon, label } = SIDE_PANEL_TABS[tab]!
return (
- <Tooltip key={tab} title={label} delayMs={100}>
+ <Tooltip
+ key={tab}
+ title={
+ deprecatedTabs.includes(tab)
+ ? `${label} (moving to the menus next to the page title)`
+ : label
+ }
+ delayMs={100}
+ >
<Tabs.Tab
value={tab}
render={(props) => (
@@ -47,7 +57,11 @@ export function SidePanelNavigation({ activeTab, onTabChange, children }: SidePa
{...props}
onClick={() => openSidePanel(tab as SidePanelTab)}
data-attr={`context-panel-tab-${tab}`}
- className="size-[33px] @[660px]/side-panel:w-auto hover:bg-transparent group justify-center @[660px]/side-panel:justify-normal"
+ className={cn(
+ 'size-[33px] @[660px]/side-panel:w-auto hover:bg-transparent group justify-center @[660px]/side-panel:justify-normal',
+ deprecatedTabs.includes(tab) && 'opacity-50 hover:opacity-100',
+ tab === firstDeprecatedTab && 'ml-auto'
+ )}
>
{tab === SidePanelTab.Max ? (
<IconSparkles
@@ -92,7 +106,7 @@ export function SidePanelNavigation({ activeTab, onTabChange, children }: SidePa
}
tooltipPlacement="bottom-end"
iconOnly
- className="group size-[33px] ml-auto"
+ className={cn('group size-[33px]', !firstDeprecatedTab && 'ml-auto')}
>
<IconX className="text-tertiary size-3 group-hover:text-primary z-10" />
</ButtonPrimitive>
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/info/SidePanelInfo.tsx b/frontend/src/layout/navigation-3000/sidepanel/panels/info/SidePanelInfo.tsx
index 1dce54353b5f..eb1a8b6b5d21 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/info/SidePanelInfo.tsx
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/info/SidePanelInfo.tsx
@@ -1,17 +1,21 @@
-import { useActions } from 'kea'
+import { useActions, useValues } from 'kea'
import { useEffect, useRef } from 'react'
import { IconInfo } from '@posthog/icons'
+import { LemonBanner } from '@posthog/lemon-ui'
import { sceneLayoutLogic } from '~/layout/scenes/sceneLayoutLogic'
+import { SidePanelTab } from '~/types'
import { SidePanelPaneHeader } from '../../components/SidePanelPaneHeader'
import { SidePanelContentContainer } from '../../SidePanelContentContainer'
+import { sidePanelLogic } from '../../sidePanelLogic'
export const SidePanelInfoIcon = IconInfo
export function SidePanelInfo(): JSX.Element {
const { registerScenePanelElement } = useActions(sceneLayoutLogic)
+ const { deprecatedTabs } = useValues(sidePanelLogic)
const ref = useRef<HTMLDivElement>(null)
useEffect(() => {
@@ -26,6 +30,11 @@ export function SidePanelInfo(): JSX.Element {
return (
<SidePanelContentContainer>
<SidePanelPaneHeader title="Actions" />
+ {deprecatedTabs.includes(SidePanelTab.Info) && (
+ <LemonBanner type="warning" className="mb-2">
+ This panel is going away. Its actions are moving to the menus next to the page title.
+ </LemonBanner>
+ )}
<div ref={ref} className="flex flex-col gap-2" />
</SidePanelContentContainer>
)
diff --git a/frontend/src/layout/navigation-3000/sidepanel/sidePanelLogic.tsx b/frontend/src/layout/navigation-3000/sidepanel/sidePanelLogic.tsx
index c6f1a6501c5d..d8ed2a2264dd 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/sidePanelLogic.tsx
+++ b/frontend/src/layout/navigation-3000/sidepanel/sidePanelLogic.tsx
@@ -75,6 +75,8 @@ export interface sidePanelLogicValues {
sidePanelOpen: boolean // sidePanelStateLogic
currentTeam: TeamPublicType | TeamType | null // teamLogic
hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ defaultTab: SidePanelTab
+ deprecatedTabs: SidePanelTab[]
enabledTabs: SidePanelTab[]
isAccessControlSettings: boolean
visibleTabs: SidePanelTab[]
@@ -109,10 +111,13 @@ export interface sidePanelLogicMeta {
hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean, // userLogic
isAccessControlSettings: boolean
) => SidePanelTab[]
+ deprecatedTabs: (featureFlags: FeatureFlagsSet) => SidePanelTab[]
+ defaultTab: (scenePanelIsPresent: boolean, deprecatedTabs: SidePanelTab[]) => SidePanelTab
visibleTabs: (
enabledTabs: SidePanelTab[],
sceneSidePanelContext: SidePanelSceneContext,
- featureFlags: FeatureFlagsSet
+ featureFlags: FeatureFlagsSet,
+ deprecatedTabs: SidePanelTab[]
) => SidePanelTab[]
}
}
@@ -234,13 +239,27 @@ export const sidePanelLogic = kea<sidePanelLogicType>([
},
],
+ /** Tabs on their way out. They stay usable, but sit at the end of the bar and never open by default. */
+ deprecatedTabs: [
+ (s) => [s.featureFlags],
+ (featureFlags: FeatureFlagsSet): SidePanelTab[] =>
+ featureFlags[FEATURE_FLAGS.TODAY_RAIL_NAV] ? [SidePanelTab.Info] : [],
+ ],
+ defaultTab: [
+ (s) => [s.scenePanelIsPresent, s.deprecatedTabs],
+ (scenePanelIsPresent: boolean, deprecatedTabs: SidePanelTab[]): SidePanelTab =>
+ scenePanelIsPresent && !deprecatedTabs.includes(SidePanelTab.Info)
+ ? SidePanelTab.Info
+ : SidePanelTab.Max,
+ ],
/** Tabs shown in the navigation bar */
visibleTabs: [
- (s) => [s.enabledTabs, s.sceneSidePanelContext, s.featureFlags],
+ (s) => [s.enabledTabs, s.sceneSidePanelContext, s.featureFlags, s.deprecatedTabs],
(
enabledTabs: SidePanelTab[],
sceneSidePanelContext: SidePanelSceneContext,
- featureFlags: FeatureFlagsSet
+ featureFlags: FeatureFlagsSet,
+ deprecatedTabs: SidePanelTab[]
): SidePanelTab[] => {
// Some tabs are openable programmatically but not shown in the nav bar
const hiddenTabs: SidePanelTab[] = sceneSidePanelContext.canvas_id
@@ -250,7 +269,11 @@ export const sidePanelLogic = kea<sidePanelLogicType>([
if (featureFlags[FEATURE_FLAGS.TODAY_RAIL_NAV]) {
hiddenTabs.push(SidePanelTab.Discussion, SidePanelTab.Notebooks)
}
- return enabledTabs.filter((tab) => !hiddenTabs.includes(tab))
+ const tabs = enabledTabs.filter((tab) => !hiddenTabs.includes(tab))
+ return [
+ ...tabs.filter((tab) => !deprecatedTabs.includes(tab)),
+ ...tabs.filter((tab) => deprecatedTabs.includes(tab)),
+ ]
},
],
}),
diff --git a/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx b/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx
index 5a66c336f4f4..6cadb09f012a 100644
--- a/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx
+++ b/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx
@@ -12,12 +12,11 @@ import { cn } from 'lib/utils/css-classes'
import { UseMaxToolOptions, useMaxTool } from 'scenes/max/useMaxTool'
import { sceneLogic } from 'scenes/sceneLogic'
+import { sidePanelLogic } from '~/layout/navigation-3000/sidepanel/sidePanelLogic'
import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
import { todayShellLogic } from '~/layout/today/todayShellLogic'
import { SidePanelTab } from '~/types'
-import { sceneLayoutLogic } from '../sceneLayoutLogic'
-
/**
* The click on the PostHog AI button is the only proof the handler ran. Every route into the
* panel captures `sidebar opened` afterwards, so a click without that follow-up event marks a
@@ -40,7 +39,7 @@ export function SceneTitlePanelButton({
buttonClassName?: string
maxButtonLabel?: string
}): JSX.Element | null {
- const { scenePanelIsPresent } = useValues(sceneLayoutLogic)
+ const { defaultTab } = useValues(sidePanelLogic)
const { openSidePanel } = useActions(sidePanelStateLogic)
const { sidePanelOpen } = useValues(sidePanelStateLogic)
@@ -51,9 +50,6 @@ export function SceneTitlePanelButton({
const sceneMenuBarEnabled = !!featureFlags[FEATURE_FLAGS.SCENE_MENU_BAR]
const { todayRailEnabled, phoneLayout } = useValues(todayShellLogic)
- // Open Info tab if scene has panel content, otherwise default to PostHog AI
- const defaultTab = scenePanelIsPresent ? SidePanelTab.Info : SidePanelTab.Max
-
if (sidePanelOpen || (todayRailEnabled && phoneLayout)) {
return null
}