diff --git a/static/app/routes.tsx b/static/app/routes.tsx index 977acf9873017a..58fb3d72b8964f 100644 --- a/static/app/routes.tsx +++ b/static/app/routes.tsx @@ -1999,6 +1999,7 @@ function buildRoutes(): RouteObject[] { children: [ { index: true, + handle: {module: ModuleName.AGENTS}, component: make(() => import('sentry/views/insights/agents/views/overview')), }, ], @@ -2008,6 +2009,7 @@ function buildRoutes(): RouteObject[] { children: [ { index: true, + handle: {module: ModuleName.MCP}, component: make(() => import('sentry/views/insights/mcp/views/overview')), }, ], @@ -2080,6 +2082,7 @@ function buildRoutes(): RouteObject[] { }, { path: `${AGENTS_LANDING_SUB_PATH}/`, + component: make(() => import('sentry/views/insights/pages/agents/layout')), children: [ { index: true, diff --git a/static/app/views/insights/agents/views/overview.tsx b/static/app/views/insights/agents/views/overview.tsx index c9ece9c773d6c4..ad5c7cc7f694c1 100644 --- a/static/app/views/insights/agents/views/overview.tsx +++ b/static/app/views/insights/agents/views/overview.tsx @@ -52,8 +52,6 @@ import OverviewAgentsDurationChartWidget from 'sentry/views/insights/common/comp import OverviewAgentsRunsChartWidget from 'sentry/views/insights/common/components/widgets/overviewAgentsRunsChartWidget'; import {useSpans} from 'sentry/views/insights/common/queries/useDiscover'; import {useDefaultToAllProjects} from 'sentry/views/insights/common/utils/useDefaultToAllProjects'; -import {AgentsPageHeader} from 'sentry/views/insights/pages/agents/agentsPageHeader'; -import {getAIModuleTitle} from 'sentry/views/insights/pages/agents/settings'; import {ModuleName} from 'sentry/views/insights/types'; const TableControl = SegmentedControl; @@ -157,10 +155,6 @@ function AgentsOverviewPage() { return ( - {getAIModuleTitle(organization)}} - /> diff --git a/static/app/views/insights/mcp/views/overview.tsx b/static/app/views/insights/mcp/views/overview.tsx index fce70f9f05df6c..2bbd0d45bedaba 100644 --- a/static/app/views/insights/mcp/views/overview.tsx +++ b/static/app/views/insights/mcp/views/overview.tsx @@ -50,8 +50,6 @@ import McpTrafficByClientWidget from 'sentry/views/insights/mcp/components/mcpTr import McpTransportWidget from 'sentry/views/insights/mcp/components/mcpTransportWidget'; import {WidgetGrid} from 'sentry/views/insights/mcp/components/styles'; import {Onboarding} from 'sentry/views/insights/mcp/views/onboarding'; -import {AgentsPageHeader} from 'sentry/views/insights/pages/agents/agentsPageHeader'; -import {getAIModuleTitle} from 'sentry/views/insights/pages/agents/settings'; import {ModuleName} from 'sentry/views/insights/types'; const TableControl = SegmentedControl; @@ -197,10 +195,6 @@ function McpOverviewPage() { return ( - {getAIModuleTitle(organization)}} - /> diff --git a/static/app/views/insights/pages/agents/layout.tsx b/static/app/views/insights/pages/agents/layout.tsx new file mode 100644 index 00000000000000..3d0fc7d05381fc --- /dev/null +++ b/static/app/views/insights/pages/agents/layout.tsx @@ -0,0 +1,18 @@ +import {Fragment} from 'react'; +import {Outlet, useMatches} from 'react-router-dom'; + +import {AgentsPageHeader} from 'sentry/views/insights/pages/agents/agentsPageHeader'; +import {ModuleName} from 'sentry/views/insights/types'; + +function AgentsLayout() { + const handle = useMatches().at(-1)?.handle as {module?: ModuleName} | undefined; + + return ( + + {handle && 'module' in handle ? : null} + + + ); +} + +export default AgentsLayout;