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): move the context panel button to the phone header (#111200)

Shy Alter36259e3a58f4
diff --git a/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx b/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx
index 93004b6e9331..5a66c336f4f4 100644
--- a/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx
+++ b/frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx
@@ -49,12 +49,12 @@ export function SceneTitlePanelButton({
const { featureFlags } = useValues(featureFlagLogic)
const sceneMenuBarEnabled = !!featureFlags[FEATURE_FLAGS.SCENE_MENU_BAR]
- const { todayRailEnabled } = useValues(todayShellLogic)
+ 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) {
+ if (sidePanelOpen || (todayRailEnabled && phoneLayout)) {
return null
}
diff --git a/frontend/src/layout/today/TodayPhoneHeader.tsx b/frontend/src/layout/today/TodayPhoneHeader.tsx
index 7ff3c782a7da..6d7191c9b6b4 100644
--- a/frontend/src/layout/today/TodayPhoneHeader.tsx
+++ b/frontend/src/layout/today/TodayPhoneHeader.tsx
@@ -1,10 +1,13 @@
import { useActions, useValues } from 'kea'
import { useEffect, useState } from 'react'
-import { IconChevronLeft } from '@posthog/icons'
+import { IconChevronLeft, IconSidePanel } from '@posthog/icons'
import { Button, Text } from '@posthog/quill'
+import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
import { breadcrumbsLogic } from '~/layout/navigation/Breadcrumbs/breadcrumbsLogic'
+import { sceneLayoutLogic } from '~/layout/scenes/sceneLayoutLogic'
+import { SidePanelTab } from '~/types'
import { todayShellLogic } from './todayShellLogic'
@@ -12,7 +15,9 @@ const TITLE_SCROLL_THRESHOLD = 56
export function TodayPhoneHeader(): JSX.Element {
const { sceneBreadcrumbs } = useValues(breadcrumbsLogic)
+ const { scenePanelIsPresent } = useValues(sceneLayoutLogic)
const { goBackOnPhone } = useActions(todayShellLogic)
+ const { openSidePanel } = useActions(sidePanelStateLogic)
const [scrolled, setScrolled] = useState(false)
const title = [...sceneBreadcrumbs].reverse().find((breadcrumb) => !!breadcrumb.name)?.name
@@ -46,6 +51,15 @@ export function TodayPhoneHeader(): JSX.Element {
>
{title}
</Text>
+ <Button
+ size="icon-lg"
+ className="rounded-full"
+ aria-label="Open context panel"
+ data-attr="today-phone-context-panel"
+ onClick={() => openSidePanel(scenePanelIsPresent ? SidePanelTab.Info : SidePanelTab.Max)}
+ >
+ <IconSidePanel />
+ </Button>
</header>
)
}