diff --git a/web/app/components/main-nav/__tests__/index.spec.tsx b/web/app/components/main-nav/__tests__/index.spec.tsx index 4a67158c27e..0a10b872ae8 100644 --- a/web/app/components/main-nav/__tests__/index.spec.tsx +++ b/web/app/components/main-nav/__tests__/index.spec.tsx @@ -677,6 +677,8 @@ describe('MainNav', () => { expect(screen.getByRole('complementary')).toHaveClass('p-1') expect(screen.getByTestId('snippet-detail-top')).toHaveAttribute('data-expand', 'false') expect(screen.queryByTestId('snippet-sidebar-content')).not.toBeInTheDocument() + expect(screen.getByLabelText('Snippet collapsed preview')).toBeInTheDocument() + expect(screen.getByLabelText('1 input fields')).toBeInTheDocument() expect(localStorage.getItem(DETAIL_SIDEBAR_STORAGE_KEY)).toBe('collapse') }) diff --git a/web/app/components/main-nav/index.tsx b/web/app/components/main-nav/index.tsx index a629498a7ed..eed12052b87 100644 --- a/web/app/components/main-nav/index.tsx +++ b/web/app/components/main-nav/index.tsx @@ -52,6 +52,41 @@ function SecondarySidebarHelpMenu({ ) } +function SnippetCollapsedPreview({ + inputFieldCount, +}: { + inputFieldCount: number +}) { + return ( +
+ + + ) +} + const isDatasetDetailPathname = (pathname: string) => { const [section, datasetId, subSection, action] = pathname.split('/').filter(Boolean) @@ -304,16 +339,18 @@ const MainNav = ({ ? : showDeploymentDetailNavigation ? - : detailNavigationVisibleExpanded && snippetNavigation.snippet && snippetNavigation.onFieldsChange - ? ( - - ) - : null + : detailNavigationVisibleExpanded + ? snippetNavigation.snippet && snippetNavigation.onFieldsChange + ? ( + + ) + : null + : : ( <>