Hide Insights tab on Home page when V2 navigation is enabled

When alertingNavigationV2 feature flag is enabled, remove the Insights
tab from the Home page since Insights is now available as a dedicated
section in the sidebar navigation.

Changes:
- Add check for alertingNavigationV2 feature flag in Home.tsx
- When V2 is enabled, insightsEnabled is false (no tab on Home)
- When V2 is disabled (legacy), keep current behavior (show tab if available)
- Insights content remains accessible via sidebar Insights menu in V2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro Fraenkel
2026-01-12 15:24:18 +01:00
co-authored by Claude Sonnet 4.5
parent 5b228fd7fa
commit 6395a753d8
@@ -1,6 +1,7 @@
import { useMemo, useState } from 'react';
import { t } from '@grafana/i18n';
import { config } from '@grafana/runtime';
import { Box, Stack, Tab, TabContent, TabsBar } from '@grafana/ui';
import { AlertingPageWrapper } from '../components/AlertingPageWrapper';
@@ -14,7 +15,9 @@ import { PluginIntegrations } from './PluginIntegrations';
import SyntheticMonitoringCard from './SyntheticMonitoringCard';
function Home() {
const insightsEnabled = insightsIsAvailable() || isLocalDevEnv();
// When V2 navigation is enabled, don't show Insights tab on Home page
// (Insights is available via the sidebar Insights menu instead)
const insightsEnabled = (insightsIsAvailable() || isLocalDevEnv()) && !config.featureToggles.alertingNavigationV2;
const [activeTab, setActiveTab] = useState<'insights' | 'overview'>(insightsEnabled ? 'insights' : 'overview');
// Memoize the scene so it's only created once and properly initialized