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.

chore(navigation): remove zen mode (#125072)

Fernando Gomes9d14a231cf23
diff --git a/frontend/src/layout/GlobalShortcuts.tsx b/frontend/src/layout/GlobalShortcuts.tsx
index 5f56d9a70967..cc325bc36906 100644
--- a/frontend/src/layout/GlobalShortcuts.tsx
+++ b/frontend/src/layout/GlobalShortcuts.tsx
@@ -13,7 +13,6 @@ import { superpowersLogic } from 'lib/components/Superpowers/superpowersLogic'
import { removeProjectIdIfPresent } from 'lib/utils/kea-router'
import { urls } from 'scenes/urls'
-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'
@@ -23,7 +22,6 @@ export function GlobalShortcuts(): null {
const { setExcludedFromPostHogTeamCohort } = useActions(superpowersLogic)
const { shortcutMenuOpen } = useValues(shortcutLogic)
const { setShortcutMenuOpen } = useActions(shortcutLogic)
- const { toggleZenMode } = useActions(navigation3000Logic)
const { toggleCommand } = useActions(commandLogic)
const { toggleHelpMenu } = useActions(helpMenuLogic)
const { toggleAccountMenu, toggleProjectSwitcher, toggleOrgSwitcher } = useActions(newAccountMenuLogic)
@@ -80,14 +78,6 @@ export function GlobalShortcuts(): null {
disabled: !user?.is_staff,
})
- useShortcut({
- name: 'ZenMode',
- keybind: [keyBinds.zenMode],
- intent: 'Toggle zen mode',
- interaction: 'function',
- callback: () => toggleZenMode('shortcut'),
- })
-
useShortcut({
name: 'SQLEditor',
keybind: [keyBinds.sqlEditor],
diff --git a/frontend/src/layout/navigation-3000/Navigation.scss b/frontend/src/layout/navigation-3000/Navigation.scss
index a6062528b8b1..4c7bbbab184a 100644
--- a/frontend/src/layout/navigation-3000/Navigation.scss
+++ b/frontend/src/layout/navigation-3000/Navigation.scss
@@ -16,12 +16,12 @@
--scene-padding: 1rem;
--scene-padding-bottom: 4rem;
- // Height of the MinimalNavigation top bar (orgless/zen modes). The settings
+ // Height of the MinimalNavigation top bar (orgless mode). The settings
// scene's viewport-fixed nav clears it via --settings-nav-top below.
--minimal-navigation-height: 3.5rem;
// Top offset for the settings scene's viewport-fixed nav. Defaults to the
- // scene padding (full app layout); the minimal/zen wrapper overrides it to
+ // scene padding (full app layout); the minimal wrapper overrides it to
// also clear the MinimalNavigation bar so the nav doesn't overlap the logo.
--settings-nav-top: var(--scene-padding);
diff --git a/frontend/src/layout/navigation-3000/Navigation.tsx b/frontend/src/layout/navigation-3000/Navigation.tsx
index 8cf160385db9..39112e72f596 100644
--- a/frontend/src/layout/navigation-3000/Navigation.tsx
+++ b/frontend/src/layout/navigation-3000/Navigation.tsx
@@ -16,7 +16,6 @@ import { EmbeddedLayout } from './layout-modes/EmbeddedLayout'
import { MinimalLayout } from './layout-modes/MinimalLayout'
import { TodayFramedLayout } from './layout-modes/TodayFramedLayout'
import { TodayPhoneLayout } from './layout-modes/TodayPhoneLayout'
-import { ZenLayout } from './layout-modes/ZenLayout'
import { resolveLayoutMode } from './layoutMode'
import { navigation3000Logic } from './navigationLogic'
@@ -65,8 +64,6 @@ export function Navigation({
return <BareLayout>{children}</BareLayout>
case 'minimal':
return <MinimalLayout sceneConfig={sceneConfig}>{children}</MinimalLayout>
- case 'zen':
- return <ZenLayout>{children}</ZenLayout>
case 'embedded':
return <EmbeddedLayout>{children}</EmbeddedLayout>
case 'classic':
diff --git a/frontend/src/layout/navigation-3000/components/MinimalNavigation.tsx b/frontend/src/layout/navigation-3000/components/MinimalNavigation.tsx
index a9236a734fbc..c2f66ecf4b12 100644
--- a/frontend/src/layout/navigation-3000/components/MinimalNavigation.tsx
+++ b/frontend/src/layout/navigation-3000/components/MinimalNavigation.tsx
@@ -6,42 +6,22 @@ import { LemonButton, ProfilePicture } from '@posthog/lemon-ui'
import { AccountMenu } from 'lib/components/Account/AccountMenu'
import { ProjectMenu } from 'lib/components/Account/ProjectMenu'
import { organizationLogic } from 'scenes/organizationLogic'
-import { sceneLogic } from 'scenes/sceneLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
-import { iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'
-import { FileSystemIconType } from '~/queries/schema/schema-general'
-
-import { navigation3000Logic } from '../navigationLogic'
-import { ZenModeButton } from './ZenModeButton'
-
export function MinimalNavigation(): JSX.Element {
const { user } = useValues(userLogic)
const { currentOrganization } = useValues(organizationLogic)
const { hasOnboardedAnyProduct, currentTeam } = useValues(teamLogic)
- const { titleAndIcon } = useValues(sceneLogic)
- const { zenMode } = useValues(navigation3000Logic)
const shouldShowOnboarding = !hasOnboardedAnyProduct && !currentTeam?.ingested_event
const logoUrl = shouldShowOnboarding ? urls.onboarding() : urls.projectRoot()
- const iconType: FileSystemIconType | undefined = ['loading', 'blank'].includes(titleAndIcon.iconType)
- ? undefined
- : (titleAndIcon.iconType as FileSystemIconType)
-
return (
<nav className="flex items-center gap-2 p-2 border-b min-h-[var(--minimal-navigation-height)]">
<LemonButton noPadding icon={<IconLogomark className="text-3xl mx-2" />} to={logoUrl} />
- {zenMode && (
- <span className="font-semibold text-base flex items-center gap-2">
- {iconType ? iconForType(iconType) : null}
- {titleAndIcon.title}
- </span>
- )}
<div className="flex items-center justify-end gap-2 flex-1">
- <ZenModeButton />
{(currentOrganization?.teams?.length ?? 0) > 1 ? (
<ProjectMenu
buttonProps={{
diff --git a/frontend/src/layout/navigation-3000/components/ZenModeButton.tsx b/frontend/src/layout/navigation-3000/components/ZenModeButton.tsx
deleted file mode 100644
index ef5ea65e275a..000000000000
--- a/frontend/src/layout/navigation-3000/components/ZenModeButton.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { useActions, useValues } from 'kea'
-
-import { IconX } from '@posthog/icons'
-import { LemonButton } from '@posthog/lemon-ui'
-
-import { navigation3000Logic } from '../navigationLogic'
-
-export function ZenModeButton(): JSX.Element | null {
- const { zenMode } = useValues(navigation3000Logic)
- const { setZenMode } = useActions(navigation3000Logic)
-
- if (!zenMode) {
- return null
- }
-
- return (
- <LemonButton
- type="secondary"
- size="small"
- icon={<IconX />}
- onClick={() => setZenMode(false, 'exit_button')}
- tooltip="Exit zen mode"
- >
- Exit zen mode
- </LemonButton>
- )
-}
diff --git a/frontend/src/layout/navigation-3000/layout-modes/ZenLayout.tsx b/frontend/src/layout/navigation-3000/layout-modes/ZenLayout.tsx
deleted file mode 100644
index 512d35eec959..000000000000
--- a/frontend/src/layout/navigation-3000/layout-modes/ZenLayout.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { ReactNode } from 'react'
-
-import { MinimalNavigation } from '../components/MinimalNavigation'
-import { SimpleLayoutFrame } from '../components/SimpleLayoutFrame'
-
-export function ZenLayout({ children }: { children: ReactNode }): JSX.Element {
- return (
- <SimpleLayoutFrame nav={<MinimalNavigation />} mainClassName="@container/main-content p-4">
- {children}
- </SimpleLayoutFrame>
- )
-}
diff --git a/frontend/src/layout/navigation-3000/layoutMode.test.ts b/frontend/src/layout/navigation-3000/layoutMode.test.ts
index 000298da0c5d..aeb1eb418af9 100644
--- a/frontend/src/layout/navigation-3000/layoutMode.test.ts
+++ b/frontend/src/layout/navigation-3000/layoutMode.test.ts
@@ -4,7 +4,6 @@ describe('resolveLayoutMode', () => {
it.each([
['none', false, false, 'bare'],
['minimal', false, false, 'minimal'],
- ['zen', false, false, 'zen'],
['embedded', false, false, 'embedded'],
['full', false, false, 'classic'],
['full', false, true, 'classic'],
diff --git a/frontend/src/layout/navigation-3000/layoutMode.ts b/frontend/src/layout/navigation-3000/layoutMode.ts
index f0d36ff2badb..1fc261d11881 100644
--- a/frontend/src/layout/navigation-3000/layoutMode.ts
+++ b/frontend/src/layout/navigation-3000/layoutMode.ts
@@ -1,7 +1,7 @@
import type { Navigation3000Mode } from './navigationLogic'
/** The page layout. Splits `Navigation3000Mode`'s `full` into classic and the two Today forms. */
-export type LayoutMode = 'bare' | 'minimal' | 'zen' | 'embedded' | 'classic' | 'today-framed' | 'today-phone'
+export type LayoutMode = 'bare' | 'minimal' | 'embedded' | 'classic' | 'today-framed' | 'today-phone'
export function resolveLayoutMode({
mode,
@@ -17,8 +17,6 @@ export function resolveLayoutMode({
return 'bare'
case 'minimal':
return 'minimal'
- case 'zen':
- return 'zen'
case 'embedded':
return 'embedded'
case 'full':
diff --git a/frontend/src/layout/navigation-3000/navigationLogic.tsx b/frontend/src/layout/navigation-3000/navigationLogic.tsx
index b36f83441574..2073c25d9c9c 100644
--- a/frontend/src/layout/navigation-3000/navigationLogic.tsx
+++ b/frontend/src/layout/navigation-3000/navigationLogic.tsx
@@ -1,7 +1,4 @@
-import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
-import { router } from 'kea-router'
-import { subscriptions } from 'kea-subscriptions'
-import posthog from 'posthog-js'
+import { MakeLogicType, connect, kea, path, selectors } from 'kea'
import { isEmbeddedPageFrame } from 'lib/utils/embeddedPageFrame'
import { organizationLogic } from 'scenes/organizationLogic'
@@ -13,9 +10,7 @@ import type { SceneConfig } from '../../scenes/sceneTypes'
import type { ProjectType } from '../../types'
import { navigationLogic } from '../navigation/navigationLogic'
-export type Navigation3000Mode = 'none' | 'minimal' | 'zen' | 'embedded' | 'full'
-
-export type ZenModeTrigger = 'shortcut' | 'account_menu' | 'help_menu' | 'exit_button' | 'url'
+export type Navigation3000Mode = 'none' | 'minimal' | 'embedded' | 'full'
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface navigation3000LogicValues {
@@ -25,33 +20,15 @@ export interface navigation3000LogicValues {
activeSceneId: string | null // sceneLogic
sceneConfig: SceneConfig | null // sceneLogic
mode: Navigation3000Mode
- zenMode: boolean
- zenModeFromUrl: boolean
-}
-
-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
-export interface navigation3000LogicActions {
- setZenMode: (
- zenMode: boolean,
- trigger: ZenModeTrigger
- ) => {
- trigger: ZenModeTrigger
- zenMode: boolean
- }
- toggleZenMode: (trigger: ZenModeTrigger) => {
- trigger: ZenModeTrigger
- }
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface navigation3000LogicMeta {
__keaTypeGenInternalSelectorTypes: {
- zenModeFromUrl: (searchParams: Record<string, any>) => boolean
mode: (
sceneConfig: SceneConfig | null,
isCurrentOrganizationUnavailable: boolean,
currentProject: ProjectType | null,
- zenMode: boolean,
activeSceneId: string | null
) => Navigation3000Mode
}
@@ -59,7 +36,7 @@ export interface navigation3000LogicMeta {
export type navigation3000LogicType = MakeLogicType<
navigation3000LogicValues,
- navigation3000LogicActions,
+ {},
Record<string, any>,
navigation3000LogicMeta
>
@@ -78,52 +55,19 @@ export const navigation3000Logic = kea<navigation3000LogicType>([
['currentProject'],
],
})),
- actions({
- setZenMode: (zenMode: boolean, trigger: ZenModeTrigger) => ({ zenMode, trigger }),
- toggleZenMode: (trigger: ZenModeTrigger) => ({ trigger }),
- }),
- reducers({
- zenMode: [
- false,
- { persist: true },
- {
- setZenMode: (_, { zenMode }) => zenMode,
- },
- ],
- }),
- listeners(({ actions, values }) => ({
- setZenMode: ({ zenMode, trigger }) => {
- posthog.capture('zen mode toggled', { enabled: zenMode, trigger })
- },
- toggleZenMode: ({ trigger }) => {
- actions.setZenMode(!values.zenMode, trigger)
- },
- })),
selectors({
- zenModeFromUrl: [
- () => [router.selectors.searchParams],
- (searchParams: Record<string, any>): boolean => {
- // Enable zen mode via ?zen or ?zen=true or ?zen=1
- const zenParam = searchParams?.zen
- return zenParam !== undefined && zenParam !== 'false' && zenParam !== '0'
- },
- ],
mode: [
- (s) => [s.sceneConfig, s.isCurrentOrganizationUnavailable, s.currentProject, s.zenMode, s.activeSceneId],
+ (s) => [s.sceneConfig, s.isCurrentOrganizationUnavailable, s.currentProject, s.activeSceneId],
(
sceneConfig: null | import('scenes/sceneTypes').SceneConfig,
isCurrentOrganizationUnavailable: boolean,
currentProject: import('~/types').ProjectType | null,
- zenMode: boolean,
activeSceneId: string | null
): Navigation3000Mode => {
// An embedded page frame sits inside another app page, so it shows the scene alone.
if (isEmbeddedPageFrame()) {
return 'embedded'
}
- if (zenMode) {
- return 'zen'
- }
// My tickets stays open on a project pending deletion, so hide the links into the rest of the app.
if (isCurrentOrganizationUnavailable || currentProject?.is_pending_deletion) {
return 'minimal'
@@ -136,13 +80,4 @@ export const navigation3000Logic = kea<navigation3000LogicType>([
},
],
}),
- subscriptions(({ actions, values }) => ({
- zenModeFromUrl: (zenModeFromUrl: boolean) => {
- // Enable zen mode when URL parameter is present (e.g., ?zen or ?zen=true)
- // Only enable, never disable from URL - user can manually disable
- if (zenModeFromUrl && !values.zenMode) {
- actions.setZenMode(true, 'url')
- }
- },
- })),
])
diff --git a/frontend/src/layout/scenes/components/SceneTitleSection.tsx b/frontend/src/layout/scenes/components/SceneTitleSection.tsx
index eb95db02ab94..e65a558cebcc 100644
--- a/frontend/src/layout/scenes/components/SceneTitleSection.tsx
+++ b/frontend/src/layout/scenes/components/SceneTitleSection.tsx
@@ -17,7 +17,6 @@ import { AnimatedSparkles } from 'scenes/max/components/AnimatedSparkles'
import { UseMaxToolOptions } from 'scenes/max/useMaxTool'
import { sceneLogic } from 'scenes/sceneLogic'
-import { navigation3000Logic } from '~/layout/navigation-3000/navigationLogic'
import { breadcrumbsLogic } from '~/layout/navigation/Breadcrumbs/breadcrumbsLogic'
import { todayShellLogic } from '~/layout/today/todayShellLogic'
import { FileSystemIconType } from '~/queries/schema/schema-general'
@@ -141,11 +140,7 @@ export type SceneMainTitleProps = {
}
export function SceneTitleSection(props: SceneMainTitleProps): JSX.Element | null {
- const { zenMode } = useValues(navigation3000Logic)
const { todayRailEnabled } = useValues(todayShellLogic)
- if (zenMode) {
- return null
- }
return todayRailEnabled ? <QuillSceneTitleSection {...props} /> : <LemonSceneTitleSection {...props} />
}
diff --git a/frontend/src/lib/components/Account/AccountMenu.tsx b/frontend/src/lib/components/Account/AccountMenu.tsx
index 3d4a77612076..9e2a8577c1c2 100644
--- a/frontend/src/lib/components/Account/AccountMenu.tsx
+++ b/frontend/src/lib/components/Account/AccountMenu.tsx
@@ -7,7 +7,6 @@ import {
IconCopy,
IconDatabase,
IconDay,
- IconExpand45,
IconFeatures,
IconGear,
IconLaptop,
@@ -55,7 +54,6 @@ import { inviteLogic } from 'scenes/settings/organization/inviteLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
-import { navigation3000Logic } from '~/layout/navigation-3000/navigationLogic'
import { AccessLevelIndicator } from '~/layout/navigation/AccessLevelIndicator'
import { getTreeItemsGames } from '~/products'
import { UserTheme } from '~/types'
@@ -149,7 +147,6 @@ export function AccountMenu({ trigger, ...props }: AccountMenuProps): JSX.Elemen
const { reportAccountOwnerClicked } = useActions(eventUsageLogic)
const { logout } = useActions(userLogic)
const { setShortcutMenuOpen } = useActions(shortcutLogic)
- const { toggleZenMode } = useActions(navigation3000Logic)
return (
<DropdownMenu>
@@ -309,19 +306,6 @@ export function AccountMenu({ trigger, ...props }: AccountMenuProps): JSX.Elemen
<ThemeMenu />
- <DropdownMenuItem asChild>
- <ButtonPrimitive
- tooltip="Hide navigation and focus on content"
- tooltipPlacement="right"
- onClick={() => toggleZenMode('account_menu')}
- menuItem
- >
- <IconExpand45 />
- Zen mode
- <KeyboardShortcut command option z className="ml-auto" />
- </ButtonPrimitive>
- </DropdownMenuItem>
-
<DropdownMenuItem asChild>
<ButtonPrimitive
tooltip="Open shortcut menu"
diff --git a/frontend/src/lib/components/Shortcuts/shortcuts.ts b/frontend/src/lib/components/Shortcuts/shortcuts.ts
index a286b78fd211..9ada671cf5eb 100644
--- a/frontend/src/lib/components/Shortcuts/shortcuts.ts
+++ b/frontend/src/lib/components/Shortcuts/shortcuts.ts
@@ -34,7 +34,6 @@ export const keyBinds: Record<string, string[]> = {
tab7: [...baseModifier, '7'],
tab8: [...baseModifier, '8'],
tab9: [...baseModifier, '9'],
- zenMode: [...baseModifier, 'z'],
newChat: ['g', 'then', 'n'],
allChats: ['g', 'then', '1'],
allProducts: ['g', 'then', '2'],
diff --git a/frontend/src/lib/components/Support/supportRouterLogic.ts b/frontend/src/lib/components/Support/supportRouterLogic.ts
index cc7c890e0339..f04cec5a1809 100644
--- a/frontend/src/lib/components/Support/supportRouterLogic.ts
+++ b/frontend/src/lib/components/Support/supportRouterLogic.ts
@@ -10,11 +10,7 @@ import { SUPPORT_KIND_TO_SUBJECT, supportLogic } from './supportLogic'
// Mirrors navigationLogic's `mode === 'full'` (the condition that mounts <SidePanel />), derived from
// sources supportLogic can't import without a billingLogic init cycle. Keep here, not in supportLogic.
-function shouldUseSidePanel(searchParams: Record<string, any>): boolean {
- const zenFromUrl = searchParams?.zen !== undefined && searchParams.zen !== 'false' && searchParams.zen !== '0'
- if (zenFromUrl) {
- return false
- }
+function shouldUseSidePanel(): boolean {
if (organizationLogic.findMounted()?.values.isCurrentOrganizationUnavailable) {
return false
}
@@ -27,12 +23,12 @@ export type supportRouterLogicType = MakeLogicType<{}, {}>
export const supportRouterLogic = kea<supportRouterLogicType>([
path(['lib', 'components', 'support', 'supportRouterLogic']),
urlToAction(() => ({
- '*': (_, searchParams, hashParams) => {
+ '*': (_, _searchParams, hashParams) => {
if (supportLogic.findMounted()?.values.isSupportFormOpen) {
return
}
- const target = shouldUseSidePanel(searchParams) ? 'sidePanel' : 'modal'
+ const target = shouldUseSidePanel() ? 'sidePanel' : 'modal'
const [panel, ...panelOptions] = (hashParams['panel'] ?? '').split(':')
diff --git a/frontend/src/scenes/hog-functions/email-templater/EmailTemplater.tsx b/frontend/src/scenes/hog-functions/email-templater/EmailTemplater.tsx
index b2f719f334d6..2b7d743727e2 100644
--- a/frontend/src/scenes/hog-functions/email-templater/EmailTemplater.tsx
+++ b/frontend/src/scenes/hog-functions/email-templater/EmailTemplater.tsx
@@ -1159,7 +1159,7 @@ function EmailTemplaterModal({
host={sceneTakeoverElement}
/>
) : (
- // No takeover host registered (minimal/zen layouts): keep the fullscreen modal.
+ // No takeover host registered (minimal layout): keep the fullscreen modal.
<LemonModal
isOpen={isModalOpen}
fullScreen