From 14822e00c6f92fa4d863bcf9afb8210ae8e70842 Mon Sep 17 00:00:00 2001 From: Harshit Shah Date: Thu, 15 Oct 2026 15:20:29 +0530 Subject: [PATCH 1/5] fix(ui): restore sidebar label size and row spacing on core NavItem Render left sidebar items at core's sm size (14px labels) so labels no longer read oversized or wrap, space rows to a 40px pitch, give the Settings/Logout footer the same row spacing, and make NavItemBase's collapsible-child indent size-aware so sm children line up with the parent label. --- .../base-components/nav-item.test.tsx | 33 +++++++++++++++++++ .../base-components/nav-item.tsx | 6 +++- .../LeftSidebar/LeftSidebar.component.tsx | 10 ++++-- 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.test.tsx diff --git a/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.test.tsx b/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.test.tsx new file mode 100644 index 000000000000..beb439144d9c --- /dev/null +++ b/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.test.tsx @@ -0,0 +1,33 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { render, screen } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; +import { NavItemBase, type NavItemSize } from './nav-item'; + +describe('NavItemBase', () => { + it.each<[NavItemSize, string]>([ + ['sm', 'tw:pl-9'], + ['md', 'tw:pl-10'], + ])( + 'indents a %s collapsible child to line up with its parent label', + (size, indent) => { + render( + + Child + + ); + + expect(screen.getByRole('link', { name: 'Child' })).toHaveClass(indent); + } + ); +}); diff --git a/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.tsx b/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.tsx index 21805ae12670..a8f622e8d53e 100644 --- a/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.tsx +++ b/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.tsx @@ -19,12 +19,15 @@ export type NavItemSize = 'sm' | 'md'; const sizeStyles = sortCx({ sm: { padding: 'tw:py-1', + // Lines child labels up with the parent label: px-3 + icon + mr-2. + childIndent: 'tw:pl-9', icon: 'tw:size-4', label: 'tw:text-sm tw:font-normal', labelCurrent: 'tw:font-semibold', }, md: { padding: 'tw:py-2', + childIndent: 'tw:pl-10', icon: 'tw:size-5', label: 'tw:text-md tw:font-semibold', labelCurrent: '', @@ -137,7 +140,8 @@ export const NavItemBase = ({ { dataTestId={item.dataTestId} href={item.redirect_url} icon={item.icon} + size="sm" truncate={false} type={parentKey ? 'collapsible-child' : 'link'} onClick={() => navigateToItem(item, parentKey)}> @@ -240,6 +241,7 @@ const LeftSidebar = () => { selectedKeys.includes(child.key) )} icon={item.icon} + size="sm" truncate={false} type="collapsible"> {t(item.title)} @@ -247,7 +249,7 @@ const LeftSidebar = () => {