diff --git a/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx b/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx index 1cba5f326..97639e6f1 100644 --- a/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx +++ b/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx @@ -6,16 +6,18 @@ import { SquaresFourIcon, TrayIcon, } from "@phosphor-icons/react"; +import { HOME_TAB_FLAG } from "@posthog/shared/constants"; import { ChannelsList } from "@posthog/ui/features/canvas/components/ChannelsList"; +import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag"; import { openSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings"; import { ProjectSwitcher } from "@posthog/ui/features/sidebar/components/ProjectSwitcher"; import { SidebarItem } from "@posthog/ui/features/sidebar/components/SidebarItem"; import { navigateToAgents, navigateToCanvas, - navigateToHome, navigateToInbox, navigateToSkills, + navigateToWebsiteHome, } from "@posthog/ui/router/navigationBridge"; import { useAppView } from "@posthog/ui/router/useAppView"; import { Box, Flex } from "@radix-ui/themes"; @@ -32,10 +34,13 @@ const NON_CANVAS_WEBSITE_PREFIXES = [ ]; // The global nav brought over from the Code app — a single icon+label row each, -// no rail. These are app-wide destinations (they leave the Channels space for -// the corresponding Code view); the channel tree below is channel browsing. +// no rail. Home points at the /website/home mirror so it stays in the Channels +// space (same shared HomeView, channels chrome kept); the other rows are +// app-wide destinations that leave the Channels space for the Code view. The +// channel tree below is channel browsing. function ChannelsNav() { const view = useAppView(); + const homeTabEnabled = useFeatureFlag(HOME_TAB_FLAG); // Active on the canvas surfaces: the channels index, a channel, or a canvas — // any /website route that isn't one of the cross-app mirrors above. const isCanvasActive = useRouterState({ @@ -49,18 +54,20 @@ function ChannelsNav() { }); return ( - - } - label="Home" - isActive={view.type === "home"} - onClick={navigateToHome} - /> + {homeTabEnabled && ( + + } + label="Home" + isActive={view.type === "home"} + onClick={navigateToWebsiteHome} + /> + )}