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): add a phone tab bar behind today-rail-nav (#111194)

Shy Alterc8c1f3aea0e2
diff --git a/frontend/src/layout/navigation-3000/Navigation.tsx b/frontend/src/layout/navigation-3000/Navigation.tsx
index 9e259a3c995e..64df3f5d3841 100644
--- a/frontend/src/layout/navigation-3000/Navigation.tsx
+++ b/frontend/src/layout/navigation-3000/Navigation.tsx
@@ -54,8 +54,10 @@ export function Navigation({
leftNavWidth: todayLeftNavWidth,
todayRailEnabled: todayRail,
sidebarVisible: todaySidebarVisible,
+ phoneLayout: todayPhoneLayout,
} = useValues(todayShellLogic)
const todayDrawerOpen = todayRail && mobileLayout && todaySidebarVisible
+ const todayPhone = todayRail && todayPhoneLayout
// SceneMenuBar (when enabled) replaces ProjectNotice's role of conveying project-level
// context above scene content, so we hide the notice for users on the new menu bar.
@@ -161,8 +163,9 @@ export function Navigation({
</a>
<div
className={cn('app-layout bg-surface-tertiary', {
- 'app-layout--mobile': mobileLayout && !todayRail,
+ 'app-layout--mobile': (mobileLayout && !todayRail) || todayPhone,
TodayAppLayout: todayRail,
+ 'TodayAppLayout--phone': todayPhone,
})}
style={
{
diff --git a/frontend/src/layout/today/TodayMoreSidebar.tsx b/frontend/src/layout/today/TodayMoreSidebar.tsx
new file mode 100644
index 000000000000..d7c75e40fb06
--- /dev/null
+++ b/frontend/src/layout/today/TodayMoreSidebar.tsx
@@ -0,0 +1,36 @@
+import { useActions } from 'kea'
+
+import { IconChevronRight } from '@posthog/icons'
+import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle } from '@posthog/quill'
+
+import { TODAY_MORE_ITEMS } from './todayRailItems'
+import { todayShellLogic } from './todayShellLogic'
+
+export function TodayMoreSidebar(): JSX.Element {
+ const { pickPane } = useActions(todayShellLogic)
+
+ return (
+ <div className="TodayPane">
+ <ItemGroup className="gap-1">
+ {TODAY_MORE_ITEMS.map(({ pane, label, icon, description }) => (
+ <Item
+ key={pane}
+ variant="outline"
+ render={<button type="button" className="w-full cursor-pointer text-left" />}
+ onClick={() => pickPane(pane)}
+ data-attr={`today-more-${pane}`}
+ >
+ <ItemMedia variant="icon">{icon}</ItemMedia>
+ <ItemContent>
+ <ItemTitle>{label}</ItemTitle>
+ <ItemDescription>{description}</ItemDescription>
+ </ItemContent>
+ <ItemActions>
+ <IconChevronRight className="size-4 text-muted-foreground" />
+ </ItemActions>
+ </Item>
+ ))}
+ </ItemGroup>
+ </div>
+ )
+}
diff --git a/frontend/src/layout/today/TodayRail.tsx b/frontend/src/layout/today/TodayRail.tsx
index 8a17ad02799b..7c15fb69777f 100644
--- a/frontend/src/layout/today/TodayRail.tsx
+++ b/frontend/src/layout/today/TodayRail.tsx
@@ -1,16 +1,7 @@
import { useActions, useValues } from 'kea'
import { ComponentProps } from 'react'
-import {
- IconBook,
- IconChat,
- IconGridMasonry,
- IconHome,
- IconSearch,
- IconSidebarClose,
- IconSidebarOpen,
- IconWrench,
-} from '@posthog/icons'
+import { IconSearch, IconSidebarClose, IconSidebarOpen } from '@posthog/icons'
import { Button, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill'
import { Logomark } from 'lib/brand'
@@ -21,16 +12,9 @@ import { commandLogic } from 'lib/components/Command/commandLogic'
import { UploadedLogo } from 'lib/lemon-ui/UploadedLogo/UploadedLogo'
import { organizationLogic } from 'scenes/organizationLogic'
+import { TODAY_RAIL_ITEMS } from './todayRailItems'
import { TodayRailTile } from './TodayRailTile'
-import { TODAY_RAIL_WIDTH, TodayRailPane, todayShellLogic } from './todayShellLogic'
-
-const RAIL_ITEMS: { pane: TodayRailPane; label: string; icon: JSX.Element }[] = [
- { pane: 'home', label: 'Home', icon: <IconHome /> },
- { pane: 'spaces', label: 'Spaces', icon: <IconChat /> },
- { pane: 'views', label: 'Views', icon: <IconGridMasonry /> },
- { pane: 'library', label: 'Library', icon: <IconBook /> },
- { pane: 'tools', label: 'Tools', icon: <IconWrench /> },
-]
+import { TODAY_RAIL_WIDTH, todayShellLogic } from './todayShellLogic'
function RailUtility({
label,
@@ -75,7 +59,7 @@ export function TodayRail(): JSX.Element {
<div className="mb-1 flex size-9 items-center justify-center" aria-hidden>
<Logomark className="h-auto w-6" />
</div>
- {RAIL_ITEMS.map(({ pane, label, icon }) => (
+ {TODAY_RAIL_ITEMS.map(({ pane, label, icon }) => (
<TodayRailTile
key={pane}
label={label}
diff --git a/frontend/src/layout/today/TodayShell.scss b/frontend/src/layout/today/TodayShell.scss
index 5c71de6ddfd7..f60c89838808 100644
--- a/frontend/src/layout/today/TodayShell.scss
+++ b/frontend/src/layout/today/TodayShell.scss
@@ -63,9 +63,59 @@
}
}
+.TodayAppLayout--phone {
+ --today-tab-bar-height: calc(76px + env(safe-area-inset-bottom));
+
+ padding-bottom: var(--today-tab-bar-height);
+}
+
+.TodayShell--phone {
+ display: contents;
+}
+
+body:has(.TodayAppLayout--phone) .Toastify__toast-container--bottom-right {
+ bottom: calc(84px + env(safe-area-inset-bottom));
+}
+
+.TodayShell__page {
+ position: fixed;
+ inset: 0 0 var(--today-tab-bar-height);
+ z-index: var(--z-layout-navbar);
+ height: auto;
+ visibility: hidden;
+ background: var(--today-paper);
+ opacity: 0;
+ transition:
+ transform 240ms var(--today-ease),
+ opacity 180ms var(--today-ease),
+ visibility 240ms;
+ transform: translateY(8px);
+
+ &[data-open='true'] {
+ visibility: visible;
+ opacity: 1;
+ transform: none;
+ }
+}
+
+.TodayTabBar {
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: var(--z-layout-navbar);
+ display: flex;
+ gap: 8px;
+ align-items: center;
+ height: var(--today-tab-bar-height);
+ padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
+ background: var(--today-paper);
+}
+
@media (prefers-reduced-motion: reduce) {
.TodayShell__scrim,
- .TodayShell__drawer {
+ .TodayShell__drawer,
+ .TodayShell__page {
transition: none;
}
}
diff --git a/frontend/src/layout/today/TodayShell.tsx b/frontend/src/layout/today/TodayShell.tsx
index ec1a2bfd9589..2d373b451fb6 100644
--- a/frontend/src/layout/today/TodayShell.tsx
+++ b/frontend/src/layout/today/TodayShell.tsx
@@ -3,7 +3,8 @@ import './TodayShell.scss'
import { useActions, useMountedLogic, useValues } from 'kea'
import { Suspense, useEffect, useRef } from 'react'
-import { Skeleton, ToastProvider } from '@posthog/quill'
+import { IconChevronLeft } from '@posthog/icons'
+import { Button, Heading, Skeleton, ToastProvider } from '@posthog/quill'
import 'scenes/project-homepage/today/Today.scss'
import { Resizer } from 'lib/components/Resizer/Resizer'
@@ -17,8 +18,15 @@ import { QuillSceneHeader } from '~/layout/scenes/components/QuillSceneHeader'
import { TodayPreviewCardProvider } from './TodayPreviewCardProvider'
import { TodayRail } from './TodayRail'
import { todayRecentsLogic } from './todayRecentsLogic'
-import { TODAY_RAIL_WIDTH, TODAY_SIDEBAR_CLOSE_THRESHOLD, clampSidebarWidth, todayShellLogic } from './todayShellLogic'
+import {
+ TODAY_MORE_PANES,
+ TODAY_RAIL_WIDTH,
+ TODAY_SIDEBAR_CLOSE_THRESHOLD,
+ clampSidebarWidth,
+ todayShellLogic,
+} from './todayShellLogic'
import { TodaySidebarFooter } from './TodaySidebarFooter'
+import { TodayTabBar } from './TodayTabBar'
const TodaySpacesPane = lazyWithRetry(() => import('./TodaySpacesPane').then((m) => ({ default: m.TodaySpacesPane })))
const TodayViewsSidebar = lazyWithRetry(() =>
@@ -27,6 +35,9 @@ const TodayViewsSidebar = lazyWithRetry(() =>
const TodayToolsSidebar = lazyWithRetry(() =>
import('./TodayToolsSidebar').then((m) => ({ default: m.TodayToolsSidebar }))
)
+const TodayMoreSidebar = lazyWithRetry(() =>
+ import('./TodayMoreSidebar').then((m) => ({ default: m.TodayMoreSidebar }))
+)
const TodayLibrarySidebar = lazyWithRetry(() =>
import('./TodayLibrarySidebar').then((m) => ({ default: m.TodayLibrarySidebar }))
)
@@ -34,14 +45,22 @@ const NewSpaceDialog = lazyWithRetry(() =>
import('products/tasks/frontend/spaces/NewSpaceDialog').then((m) => ({ default: m.NewSpaceDialog }))
)
-const PANE_LABELS = { home: 'Today', spaces: 'Spaces', views: 'Views', library: 'Library', tools: 'Tools' }
+const PANE_LABELS = {
+ home: 'Today',
+ spaces: 'Spaces',
+ views: 'Views',
+ library: 'Library',
+ tools: 'Tools',
+ more: 'More',
+}
/** The left navigation under the Today layout: the rail, then the sidebar for the pane the rail has open. */
export function TodayShell({ className }: { className?: string }): JSX.Element {
- const { activePane, mobileLayout, sidebarVisible, sidebarWidth } = useValues(todayShellLogic)
+ const { activePane, mobileLayout, phoneLayout, sidebarVisible, sidebarWidth } = useValues(todayShellLogic)
// Records the tools and sessions visited while other panes are open, so each pane's Recent group is ready.
useMountedLogic(todayRecentsLogic)
- const { setMobileSidebarOpen, setSidebarOpen, setSidebarWidth, toggleSidebar } = useActions(todayShellLogic)
+ const { pickPane, setMobileSidebarOpen, setSidebarOpen, setSidebarWidth, toggleSidebar } =
+ useActions(todayShellLogic)
const sidebarRef = useRef<HTMLDivElement | null>(null)
const drawerRef = useRef<HTMLElement | null>(null)
const returnFocusRef = useRef<HTMLElement | null>(null)
@@ -78,6 +97,26 @@ export function TodayShell({ className }: { className?: string }): JSX.Element {
}
}, [mobileLayout, sidebarVisible])
+ const paneContent = (
+ <Suspense fallback={<Skeleton className="m-4 h-24" />}>
+ {activePane === 'home' ? (
+ <TodayPreviewCardProvider>
+ <TodayHomeSidebar />
+ </TodayPreviewCardProvider>
+ ) : activePane === 'spaces' ? (
+ <TodaySpacesPane />
+ ) : activePane === 'views' ? (
+ <TodayViewsSidebar />
+ ) : activePane === 'library' ? (
+ <TodayLibrarySidebar />
+ ) : activePane === 'more' ? (
+ <TodayMoreSidebar />
+ ) : (
+ <TodayToolsSidebar />
+ )}
+ </Suspense>
+ )
+
const pane = (
<div className="TodayShell__pane">
<QuillSceneHeader
@@ -87,24 +126,55 @@ export function TodayShell({ className }: { className?: string }): JSX.Element {
</h2>
}
/>
- <Suspense fallback={<Skeleton className="m-4 h-24" />}>
- {activePane === 'home' ? (
- <TodayPreviewCardProvider>
- <TodayHomeSidebar />
- </TodayPreviewCardProvider>
- ) : activePane === 'spaces' ? (
- <TodaySpacesPane />
- ) : activePane === 'views' ? (
- <TodayViewsSidebar />
- ) : activePane === 'library' ? (
- <TodayLibrarySidebar />
- ) : (
- <TodayToolsSidebar />
- )}
- </Suspense>
+ {paneContent}
</div>
)
+ const newSpaceDialog = activePane === 'spaces' && (
+ <Suspense fallback={null}>
+ <NewSpaceDialog />
+ </Suspense>
+ )
+
+ if (phoneLayout) {
+ return (
+ <ToastProvider>
+ <div data-quill className={cn('Today TodayShell TodayShell--phone', className)}>
+ <aside
+ ref={drawerRef}
+ tabIndex={-1}
+ className="TodayShell__sidebar TodayShell__page outline-none"
+ data-open={sidebarVisible}
+ aria-label={PANE_LABELS[activePane]}
+ aria-hidden={!sidebarVisible}
+ {...(sidebarVisible ? {} : { inert: '' })}
+ >
+ <div className="flex min-h-14 shrink-0 items-end gap-1 px-4 pt-3">
+ {TODAY_MORE_PANES.includes(activePane) && (
+ <Button
+ size="icon-lg"
+ className="-ml-2 rounded-full"
+ aria-label="Back to More"
+ data-attr="today-more-back"
+ onClick={() => pickPane('more')}
+ >
+ <IconChevronLeft />
+ </Button>
+ )}
+ <Heading render={<h1 />} size="2xl" className="m-0 truncate leading-10">
+ {PANE_LABELS[activePane]}
+ </Heading>
+ </div>
+ <div className="TodayShell__pane">{paneContent}</div>
+ <TodaySidebarFooter />
+ </aside>
+ <TodayTabBar />
+ {newSpaceDialog}
+ </div>
+ </ToastProvider>
+ )
+ }
+
return (
<ToastProvider>
<div
@@ -153,11 +223,7 @@ export function TodayShell({ className }: { className?: string }): JSX.Element {
)
)}
{/* Mounted here so the sidebar and the spaces page open the same dialog. */}
- {activePane === 'spaces' && (
- <Suspense fallback={null}>
- <NewSpaceDialog />
- </Suspense>
- )}
+ {newSpaceDialog}
</div>
</ToastProvider>
)
diff --git a/frontend/src/layout/today/TodayTabBar.tsx b/frontend/src/layout/today/TodayTabBar.tsx
new file mode 100644
index 000000000000..5e3ad300522d
--- /dev/null
+++ b/frontend/src/layout/today/TodayTabBar.tsx
@@ -0,0 +1,55 @@
+import { useActions, useValues } from 'kea'
+
+import { IconSearch } from '@posthog/icons'
+import { Button, cn } from '@posthog/quill'
+
+import { commandLogic } from 'lib/components/Command/commandLogic'
+
+import { TODAY_TAB_BAR_ITEMS } from './todayRailItems'
+import { TODAY_MORE_PANES, todayShellLogic } from './todayShellLogic'
+
+export function TodayTabBar(): JSX.Element {
+ const { activePane } = useValues(todayShellLogic)
+ const { pickPane } = useActions(todayShellLogic)
+ const { toggleCommand } = useActions(commandLogic)
+
+ return (
+ <div className="TodayTabBar" data-quill>
+ <nav
+ aria-label="Main"
+ className="flex h-15 min-w-0 flex-1 rounded-full border border-[var(--border)] bg-[var(--card)] p-1 shadow-md"
+ >
+ {TODAY_TAB_BAR_ITEMS.map(({ pane, label, icon }) => {
+ const active = activePane === pane || (pane === 'more' && TODAY_MORE_PANES.includes(activePane))
+ return (
+ <button
+ key={pane}
+ type="button"
+ aria-current={active ? 'page' : undefined}
+ data-attr={`today-rail-${pane}`}
+ onClick={() => pickPane(pane)}
+ className={cn(
+ 'flex min-w-0 flex-1 cursor-pointer flex-col items-center justify-center gap-0.5 rounded-full text-[11px] leading-3 font-medium outline-none',
+ 'focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-inset [&_svg]:size-5.5',
+ active ? 'bg-[var(--fill-selected)] text-foreground' : 'text-muted-foreground'
+ )}
+ >
+ {icon}
+ <span className="max-w-full truncate">{label}</span>
+ </button>
+ )
+ })}
+ </nav>
+ <Button
+ variant="outline"
+ size="icon-lg"
+ aria-label="Search"
+ data-attr="today-rail-search"
+ onClick={() => toggleCommand('nav-search-button')}
+ className="size-15 shrink-0 rounded-full bg-[var(--card)] shadow-md [&_svg]:size-5.5"
+ >
+ <IconSearch />
+ </Button>
+ </div>
+ )
+}
diff --git a/frontend/src/layout/today/todayRailItems.tsx b/frontend/src/layout/today/todayRailItems.tsx
new file mode 100644
index 000000000000..9dd54518280f
--- /dev/null
+++ b/frontend/src/layout/today/todayRailItems.tsx
@@ -0,0 +1,27 @@
+import { IconBook, IconChat, IconEllipsis, IconGridMasonry, IconHome, IconWrench } from '@posthog/icons'
+
+import { TODAY_MORE_PANES, TodayRailPane } from './todayShellLogic'
+
+export interface TodayRailItem {
+ pane: TodayRailPane
+ label: string
+ icon: JSX.Element
+}
+
+export const TODAY_RAIL_ITEMS: TodayRailItem[] = [
+ { pane: 'home', label: 'Home', icon: <IconHome /> },
+ { pane: 'spaces', label: 'Spaces', icon: <IconChat /> },
+ { pane: 'views', label: 'Views', icon: <IconGridMasonry /> },
+ { pane: 'library', label: 'Library', icon: <IconBook /> },
+ { pane: 'tools', label: 'Tools', icon: <IconWrench /> },
+]
+
+export const TODAY_TAB_BAR_ITEMS: TodayRailItem[] = [
+ ...TODAY_RAIL_ITEMS.filter(({ pane }) => !TODAY_MORE_PANES.includes(pane)),
+ { pane: 'more', label: 'More', icon: <IconEllipsis /> },
+]
+
+export const TODAY_MORE_ITEMS: (TodayRailItem & { description: string })[] = [
+ { pane: 'library', label: 'Library', icon: <IconBook />, description: 'Saved insights, flags, cohorts and more' },
+ { pane: 'tools', label: 'Tools', icon: <IconWrench />, description: 'The SQL editor and product tools' },
+]
diff --git a/frontend/src/layout/today/todayShellLogic.test.ts b/frontend/src/layout/today/todayShellLogic.test.ts
index 5941b35b1bed..729342b89e99 100644
--- a/frontend/src/layout/today/todayShellLogic.test.ts
+++ b/frontend/src/layout/today/todayShellLogic.test.ts
@@ -114,4 +114,22 @@ describe('todayShellLogic', () => {
Object.defineProperty(window, 'innerWidth', { configurable: true, value: originalWidth })
}
})
+
+ it('on phone widths, drops the rail width and opens More without leaving the page', () => {
+ const originalWidth = window.innerWidth
+ Object.defineProperty(window, 'innerWidth', { configurable: true, value: 390 })
+ try {
+ const logic = todayShellLogic()
+ logic.mount()
+ expect(logic.values.leftNavWidth).toBe(0)
+
+ router.actions.push('/project/1/airplane')
+ logic.actions.pickPane('more')
+ expect(router.values.location.pathname).toBe('/project/1/airplane')
+ expect(logic.values.activePane).toBe('more')
+ expect(logic.values.sidebarVisible).toBe(true)
+ } finally {
+ Object.defineProperty(window, 'innerWidth', { configurable: true, value: originalWidth })
+ }
+ })
})
diff --git a/frontend/src/layout/today/todayShellLogic.ts b/frontend/src/layout/today/todayShellLogic.ts
index 31d68cd4cdc7..5818cca31dff 100644
--- a/frontend/src/layout/today/todayShellLogic.ts
+++ b/frontend/src/layout/today/todayShellLogic.ts
@@ -2,6 +2,7 @@ import { MakeLogicType, actions, connect, kea, listeners, path, reducers, select
import { router } from 'kea-router'
import type { LocationChangedPayload } from 'kea-router/lib/types'
import { subscriptions } from 'kea-subscriptions'
+import { windowValues } from 'kea-window-values'
import posthog from 'posthog-js'
import { FEATURE_FLAGS } from 'lib/constants'
@@ -13,9 +14,12 @@ import { urls } from 'scenes/urls'
import { navigationLogic } from '~/layout/navigation/navigationLogic'
-export type TodayRailPane = 'home' | 'spaces' | 'views' | 'library' | 'tools'
+export type TodayRailPane = 'home' | 'spaces' | 'views' | 'library' | 'tools' | 'more'
+
+export const TODAY_MORE_PANES: TodayRailPane[] = ['library', 'tools']
export const TODAY_RAIL_WIDTH = 60
+export const TODAY_PHONE_MAX_WIDTH = 768
export const TODAY_SIDEBAR_DEFAULT_WIDTH: number = 312
export const TODAY_SIDEBAR_MIN_WIDTH = 240
export const TODAY_SIDEBAR_MAX_WIDTH = 480
@@ -33,7 +37,7 @@ function isUnder(path: string, root: string): boolean {
return path === root || path.startsWith(`${root}/`)
}
-const RAIL_PANE_HOME: Record<TodayRailPane, () => string> = {
+const RAIL_PANE_HOME: Record<Exclude<TodayRailPane, 'more'>, () => string> = {
home: () => urls.projectHomepage(),
spaces: () => urls.ai(),
views: () => urls.viewsNew(),
@@ -74,6 +78,7 @@ export interface todayShellLogicValues {
activePane: TodayRailPane
leftNavWidth: number
mobileSidebarOpen: boolean
+ phoneLayout: boolean
pickedPane: TodayRailPane | null
routePane: TodayRailPane | null
sidebarOpen: boolean
@@ -126,8 +131,17 @@ export interface todayShellLogicActions {
export interface todayShellLogicMeta {
__keaTypeGenInternalSelectorTypes: {
routePane: (location: { hash: string; pathname: string; search: string }) => TodayRailPane | null
- activePane: (pickedPane: TodayRailPane | null, routePane: TodayRailPane | null) => TodayRailPane
- leftNavWidth: (sidebarOpen: boolean, sidebarWidth: number, mobileLayout: boolean) => number
+ activePane: (
+ pickedPane: TodayRailPane | null,
+ routePane: TodayRailPane | null,
+ phoneLayout: boolean
+ ) => TodayRailPane
+ leftNavWidth: (
+ sidebarOpen: boolean,
+ sidebarWidth: number,
+ mobileLayout: boolean,
+ phoneLayout: boolean
+ ) => number
sidebarVisible: (mobileLayout: boolean, mobileSidebarOpen: boolean, sidebarOpen: boolean) => boolean
todayRailEnabled: (featureFlags: FeatureFlagsSet) => boolean
}
@@ -153,6 +167,9 @@ export const todayShellLogic = kea<todayShellLogicType>([
setSidebarWidth: (width: number) => ({ width }),
toggleSidebar: true,
}),
+ windowValues(() => ({
+ phoneLayout: (window: Window) => window.innerWidth < TODAY_PHONE_MAX_WIDTH,
+ })),
reducers({
// The last pane picked on the rail, or reached through a route that belongs to one, stays open on other pages.
pickedPane: [
@@ -185,14 +202,14 @@ export const todayShellLogic = kea<todayShellLogicType>([
(location: { pathname: string }): TodayRailPane | null => railPaneForPath(location.pathname),
],
activePane: [
- (s) => [s.pickedPane, s.routePane],
- (pickedPane: TodayRailPane | null, routePane: TodayRailPane | null): TodayRailPane =>
- pickedPane ?? routePane ?? 'home',
+ (s) => [s.pickedPane, s.routePane, s.phoneLayout],
+ (pickedPane: TodayRailPane | null, routePane: TodayRailPane | null, phoneLayout: boolean): TodayRailPane =>
+ pickedPane === 'more' && !phoneLayout ? (routePane ?? 'home') : (pickedPane ?? routePane ?? 'home'),
],
leftNavWidth: [
- (s) => [s.sidebarOpen, s.sidebarWidth, s.mobileLayout],
- (sidebarOpen: boolean, sidebarWidth: number, mobileLayout: boolean): number =>
- TODAY_RAIL_WIDTH + (sidebarOpen && !mobileLayout ? sidebarWidth : 0),
+ (s) => [s.sidebarOpen, s.sidebarWidth, s.mobileLayout, s.phoneLayout],
+ (sidebarOpen: boolean, sidebarWidth: number, mobileLayout: boolean, phoneLayout: boolean): number =>
+ phoneLayout ? 0 : TODAY_RAIL_WIDTH + (sidebarOpen && !mobileLayout ? sidebarWidth : 0),
],
sidebarVisible: [
(s) => [s.mobileLayout, s.mobileSidebarOpen, s.sidebarOpen],
@@ -232,8 +249,10 @@ export const todayShellLogic = kea<todayShellLogicType>([
},
pickPane: ({ pane }) => {
// pinned: analytics event name and property. Renaming them breaks dashboards.
- posthog.capture('today rail pane picked', { pane })
- router.actions.push(RAIL_PANE_HOME[pane]())
+ posthog.capture('today rail pane picked', { pane, phone_layout: values.phoneLayout })
+ if (pane !== 'more') {
+ router.actions.push(RAIL_PANE_HOME[pane]())
+ }
if (values.mobileLayout) {
actions.setMobileSidebarOpen(true)
} else {
diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
index b56816cb1e18..e433d21102a0 100644
--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx
+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
@@ -921,6 +921,17 @@ export const NarrowWindowWithSidebar: Story = {
},
}
+export const PhoneWidth: Story = {
+ parameters: { testOptions: { viewport: { width: 390, height: 844 } } },
+}
+
+export const PhoneWidthMorePane: Story = {
+ parameters: { testOptions: { viewport: { width: 390, height: 844 } } },
+ play: async ({ canvasElement }) => {
+ await userEvent.click(await within(canvasElement).findByRole('button', { name: 'More' }))
+ },
+}
+
// The card opens on hover, which a static story can't hold, so these render its contents in the same frame.
const noop = (): void => {}