diff --git a/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx b/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx index 2cca4b3ea78928..5be456cfd5f3c2 100644 --- a/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx +++ b/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx @@ -32,13 +32,20 @@ const navigationTree: NavigationTreeDefinition = { title: i18n.translate('xpack.serverlessObservability.nav.discover', { defaultMessage: 'Discover', }), - link: 'discover', + link: 'observability-log-explorer', + // prevent this entry from ever becoming active, effectively falling through to the obs-log-explorer child + getIsActive: () => false, + // avoid duplicate "Discover" breadcrumbs + breadcrumbStatus: 'hidden', renderAs: 'item', children: [ { - // This is to show "observability-log-explorer" breadcrumbs when navigating from "discover" to "log explorer" - link: 'observability-log-explorer', - sideNavStatus: 'hidden', + link: 'discover', + children: [ + { + link: 'observability-log-explorer', + }, + ], }, ], }, diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group1/_url_state.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group1/_url_state.ts index c0dc9c0dd89f1e..0f8c9ffd547440 100644 --- a/x-pack/test_serverless/functional/test_suites/common/discover/group1/_url_state.ts +++ b/x-pack/test_serverless/functional/test_suites/common/discover/group1/_url_state.ts @@ -77,6 +77,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('Side nav', function () { + this.tags([ + 'skipSvlOblt', // the "Discover" side nav entry does something different in oblt + ]); + it('should sync Lens global state to Discover sidebar link and carry over the state when navigating to Discover', async () => { await PageObjects.common.navigateToApp('discover'); await PageObjects.common.navigateToApp('lens'); diff --git a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts index 892359f901ffe5..f899d6760db026 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts @@ -41,11 +41,15 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { }); await svlCommonNavigation.sidenav.expectSectionClosed('project_settings_project_nav'); - // navigate to discover - await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'discover' }); - await svlCommonNavigation.sidenav.expectLinkActive({ deepLinkId: 'discover' }); - await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ deepLinkId: 'discover' }); - expect(await browser.getCurrentUrl()).contain('/app/discover'); + // navigate to the logs explorer tab by default + await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observability-log-explorer' }); + await svlCommonNavigation.sidenav.expectLinkActive({ + deepLinkId: 'observability-log-explorer', + }); + await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ + deepLinkId: 'observability-log-explorer', + }); + expect(await browser.getCurrentUrl()).contain('/app/observability-log-explorer'); // check the aiops subsection await svlCommonNavigation.sidenav.openSection('observability_project_nav.aiops'); // open ai ops subsection