From 376d65012478f93148a55f70f00516c68d78271f Mon Sep 17 00:00:00 2001 From: Louai Boumediene <92324961+Louai-Zokerburg@users.noreply.github.com> Date: Sat, 4 Jul 2026 20:12:33 +0100 Subject: [PATCH] feat(web): land cloud users on chat while the rollout cap is open (#14043) --- packages/web/src/app/components/sidebar/platform/index.tsx | 1 + packages/web/src/app/components/sidebar/sidebar-header.tsx | 1 + packages/web/src/app/guards/default-route.tsx | 3 +++ packages/web/src/lib/route-utils.ts | 5 +++++ 4 files changed, 10 insertions(+) diff --git a/packages/web/src/app/components/sidebar/platform/index.tsx b/packages/web/src/app/components/sidebar/platform/index.tsx index 5bf8d547dafe..499683053d55 100644 --- a/packages/web/src/app/components/sidebar/platform/index.tsx +++ b/packages/web/src/app/components/sidebar/platform/index.tsx @@ -53,6 +53,7 @@ export function PlatformSidebar() { const { checkAccess } = useAuthorization(); const defaultRoute = determineDefaultRoute({ checkAccess, + chatEnabled: platform.plan.chatEnabled, }); const chevronRef = useRef(null); diff --git a/packages/web/src/app/components/sidebar/sidebar-header.tsx b/packages/web/src/app/components/sidebar/sidebar-header.tsx index f18d58b0f2e5..6e5f307615f9 100644 --- a/packages/web/src/app/components/sidebar/sidebar-header.tsx +++ b/packages/web/src/app/components/sidebar/sidebar-header.tsx @@ -47,6 +47,7 @@ export const AppSidebarHeader = () => { const { checkAccess } = useAuthorization(); const defaultRoute = determineDefaultRoute({ checkAccess, + chatEnabled: currentPlatform.plan.chatEnabled, }); const branding = flagsHooks.useWebsiteBranding(); diff --git a/packages/web/src/app/guards/default-route.tsx b/packages/web/src/app/guards/default-route.tsx index 0cbb7c6f6031..8916a611f9fe 100644 --- a/packages/web/src/app/guards/default-route.tsx +++ b/packages/web/src/app/guards/default-route.tsx @@ -1,6 +1,7 @@ import { Navigate, useLocation } from 'react-router-dom'; import { useAuthorization } from '@/hooks/authorization-hooks'; +import { platformHooks } from '@/hooks/platform-hooks'; import { authenticationSession } from '@/lib/authentication-session'; import { determineDefaultRoute } from '@/lib/route-utils'; @@ -25,10 +26,12 @@ export const DefaultRoute = () => { const AuthenticatedDefaultRoute = () => { const { checkAccess } = useAuthorization(); + const { platform } = platformHooks.useCurrentPlatform(); return ( diff --git a/packages/web/src/lib/route-utils.ts b/packages/web/src/lib/route-utils.ts index 70d89eaeaf1f..3929a6de283b 100644 --- a/packages/web/src/lib/route-utils.ts +++ b/packages/web/src/lib/route-utils.ts @@ -22,9 +22,14 @@ export const CHAT_ROUTE = '/chat'; export const determineDefaultRoute = ({ checkAccess, + chatEnabled, }: { checkAccess: (permission: Permission) => boolean; + chatEnabled?: boolean; }) => { + if (chatEnabled) { + return CHAT_ROUTE; + } if (checkAccess(Permission.READ_FLOW) || checkAccess(Permission.READ_TABLE)) { return authenticationSession.appendProjectRoutePrefix('/automations'); }