Skip to content

fix(ui): match the classic sidebar to its pre-migration look with core NavItem lg/solid - #35522

Closed
shah-harshit wants to merge 5 commits into
mainfrom
shah-harshit/sidebar-messed-up-fix
Closed

shah-harshit wants to merge 5 commits into
mainfrom
shah-harshit/sidebar-messed-up-fix

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#7509

#35253 moved the classic left sidebar onto core NavItemBase. Its default md size and light current-item style made the classic sidebar look different from the pre-migration one (sandbox): labels were 16px semibold, "Data Marketplace" wrapped, rows were packed tightly, and the current item and open groups lost their solid brand treatment. This PR makes the classic sidebar match sandbox using only core component APIs. AI mode uses a separate sidebar and is untouched.

Core (NavItemBase), additive. Existing sm and md output is unchanged:

  • New size="lg" for roomy primary navigation: 56px rows (p-3.5), 28px icons, 14px/500 labels (600 when current), rounded-xl. At lg, collapsible children keep their icon and sit flush (px-4 py-2.5, 48px rows) inside the open group.
  • New variant="solid":
    • resting items are transparent, so they sit on the sidebar surface (the default variant keeps bg-primary);
    • resting icons and labels share one mid-gray (fg-tertiary / text-tertiary, #535862), as the old sidebar did, instead of the default's lighter gray-400 icons and darker gray-700 labels;
    • the current item fills with bg-brand-solid and uses on-brand text and icon;
    • an open or child-selected group header fills with bg-brand-solid_hover, with square bottom corners when open;
    • resting items hover with a brand tint instead of gray.
  • collapsible-child indent is now per size (sm → pl-9, md → pl-10), so children line up with the parent label.

Classic LeftSidebar:

  • Drops the white tw:bg-surface that Migrate display, navigation, selection and numeric components to core #35253 added to the classic <aside>, so the rail shows the #f8f9fc page background as before.
  • Uses size="lg" variant="solid", with the old layout:
    • a 16px start inset, so items run flush to the rail end;
    • an 8px gap between rows;
    • an open group is wrapped in a 1px border-brand-subtle panel with no top border.
  • Logout renders as a NavItemBase (a link-less role="link"), so it matches Settings. react-aria activates it on Enter. In the collapsed rail it stays an icon Button.
  • Long labels still wrap rather than being cut off with "…" ("Column Bulk Operations"), so they stay readable without a tooltip.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Why core changes: NavItemBase has no className prop, and its only sizes (sm, md) give 16–20px icons, 28–40px rows, a light current state, and white resting items. The pre-migration look (28px icons, 56px rows, a solid brand current item, transparent items) can't be reached from the caller without overriding core styles, which the design system forbids. So it is added as an opt-in size="lg" and variant="solid". Both are additive: every existing sm/md/default usage renders identically. That includes the AI-mode shell, which doesn't use NavItemBase/NavList at all (verified below).

Tests:

Use cases covered

  • Classic expanded sidebar matches sandbox: label size and weight, row height and spacing, icon size, label offset, solid current item, solid open-group header with a bordered panel, and child rows with icons.
  • Logout opens the confirm dialog on click and on Enter.

Unit tests

  • nav-item.test.tsx (core):
    • child indent per size;
    • child icon shown only at lg;
    • solid current item uses bg-brand-solid (default keeps bg-brand-primary_alt), and solid resting items are transparent with text-tertiary labels.
  • LeftSidebar.test.tsx: Logout asks for confirmation on click and on Enter (9/9 passing).

Backend integration tests

  • Not applicable (no backend API changes).

Playwright (UI) tests

  • No spec changes. The visual baselines that include the classic expanded sidebar (landing-page, explore, ai-explore, glossary) are expected to change and need refreshing from CI renders.

Manual testing performed

  1. Ran this branch's UI (Vite) against a local stack, logged in, and opened the Govern group on /my-data.
  2. Measured the sidebar in the browser and compared it with sandbox (table below).

UI screen recording:

Not applicable — styling fix. Screenshots below.

Before (main) After (this PR) Sandbox (reference)
sidebar-before sidebar-after sidebar-sandbox

Measured (228px rail, Govern open)

Sandbox Main (before) This PR
Label 14px / 500 16px / 600 14px / 500
Current label 600, white 600, brand 600, white
Icon 28px 20px 28px
Row height / pitch 56 / 64px 40 / 44px 56 / 64px
Label x-offset 68px 48px 68px
Rest icon / label colour #535862 / #535862 #a4a7ae / #414651 #535862 / #535862
Rail / rest-item background #f8f9fc page bg / transparent white / white #f8f9fc page bg / transparent
Current item #1570ef solid light brand #1570ef solid
Open group solid header + bordered panel plain solid header + bordered panel
Group children icons, 48px rows, label x 71 no icons, 44px icons, 48px rows, label x 71
Long child label truncated wraps wraps (kept readable)

AI mode is unaffected

AI mode renders the ai-shell sidebar, which imports neither LeftSidebar nor NavItemBase/NavList. To check, I loaded both builds in AI mode at the same viewport and hashed the position, size, font, colour, and background of every sidebar element. Main and this PR are identical: 113 elements, hash -90309346.

AI mode — main AI mode — this PR
ai-mode-main ai-mode-branch

Collate (no Collate change needed)

Collate's classic mode renders this same OSS LeftSidebar. It overrides only the item list (LeftSidebarClassCollate), and Collate ships no styles for .app-sidebar or the sidebar menu. So this PR fixes Collate's classic sidebar too, with no Collate change.

To check, I ran Collate origin/main UI against this branch's OSS sources, and against OSS origin/main for the "before" shots:

  • Classic: the Collate-only items (Collate AI, Automations, SQL Studio) take the same 14px/500 labels at x 68, 56px rows, solid #1570ef current item, and transparent items on the #f8f9fc page background.
  • AI mode: the Collate ai-shell sidebar is identical before and after, at the same viewport: 176 elements, hash -1343543943.
Collate classic — before Collate classic — after Collate classic — devrel (reference)
collate-classic-before collate-classic-after devrel-classic

devrel still runs the pre-migration classic sidebar. Measured there: 14px/500 labels at x 67, 56px rows, 48px child rows, and a #f8f9fc rail. That is within 1px of this PR (x 68). Its "Data Marketplace" row shows the hover tint, which is the same light-brand hover the solid variant applies.

Collate AI mode — before Collate AI mode — after Collate AI mode — devrel (reference)
collate-ai-before collate-ai-after devrel-ai

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue via Fixes above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

🤖 Generated with Claude Code

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.
@shah-harshit shah-harshit added the UI UI specific issues label Oct 15, 2026
@shah-harshit shah-harshit added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Oct 15, 2026
@shah-harshit shah-harshit self-assigned this Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 932 → 933
- 1 added, 0 removed, 13 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/observability/data-quality/ThresholdPreview/ThresholdPreview.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/constant/config.ts
  openmetadata-ui/src/main/resources/ui/playwright/e2e/Utils/appMode.ts
  openmetadata-ui/src/main/resources/ui/playwright/e2e/fixtures/pages.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/entity/TableClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/codeEditor.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/dataQuality.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/testCases.ts
  openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.tsx
  openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/RunDetailsCard/RunDetailsCard.tsx
  … and 3 more

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 77%
77.76% (126548/162725) 64.41% (80030/124238) 65.64% (26706/40682)

@shah-harshit shah-harshit changed the title fix(ui): restore sidebar label size and row spacing on core NavItem fix(ui): match the classic sidebar to its pre-migration look with core NavItem lg/solid Oct 15, 2026
Add an lg size and a solid variant to core NavItemBase (28px icons, 56px
rows, brand-filled current item and open-group header, child icons at lg)
and use them in the classic LeftSidebar with the old 16px inset, 8px row
gap and bordered open-group panel. Logout renders as a nav item so it
matches Settings.
Drop the white bg-surface the core migration added to the classic aside
and keep solid-variant NavItemBase rest items transparent, so the rail
shows the #f8f9fc page background like the pre-migration sidebar.
The solid NavItemBase variant now renders resting icons and labels in
one mid-gray (fg-tertiary/text-tertiary), as the pre-migration classic
sidebar did, instead of core's lighter gray-400 icons and darker
gray-700 labels.
Comment on lines 238 to 241
<details
className="tw:rounded-xl tw:open:border tw:open:border-t-0 tw:open:border-brand-subtle"
open={openKeys.includes(item.key)}
onToggle={(event) => toggleGroup(item.key, event.currentTarget.open)}>

@gitar-bot gitar-bot Bot Oct 15, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Open-group panel doesn't clip square child fills at its rounded corners

The open <details> panel has tw:rounded-xl and a 1px border-brand-subtle, but it has no overflow-hidden. At lg size, its children use tw:rounded-none (nav-item.tsx:63). When the last child of an open group is current (bg-brand-solid) or hovered (bg-brand-primary_alt), its square fill paints past the panel's curved bottom corners, so they look clipped against the border. Add tw:overflow-hidden to the <details> so child backgrounds follow its radius. The focus outline is offset, so check that it stays visible, or round the last child's bottom corners instead.

Clip child backgrounds to the panel's rounded corners.:

className="tw:overflow-hidden tw:rounded-xl tw:open:border tw:open:border-t-0 tw:open:border-brand-subtle"

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 closed / 1 findings

🟡 Medium risk · New core sidebar sizing and solid styling, plus routing logout through a link control, could cause unexpected route or keyboard-activation behavior.

Matches the classic sidebar to its pre-migration look using new core NavItemBase size="lg" and variant="solid" options, with the rail on the page background and the solid current item and open-group treatment restored. Open-group panel doesn't clip square child fills at its rounded corners, so the last child's current or hovered background may paint past the curved bottom corners; consider adding overflow-hidden to the <details> panel and checking that the focus outline stays visible.

💡 Quality: Open-group panel doesn't clip square child fills at its rounded corners

📄 openmetadata-ui/src/main/resources/ui/src/components/MyData/LeftSidebar/LeftSidebar.component.tsx:238-241 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.tsx:63

The open <details> panel has tw:rounded-xl and a 1px border-brand-subtle, but it has no overflow-hidden. At lg size, its children use tw:rounded-none (nav-item.tsx:63). When the last child of an open group is current (bg-brand-solid) or hovered (bg-brand-primary_alt), its square fill paints past the panel's curved bottom corners, so they look clipped against the border. Add tw:overflow-hidden to the <details> so child backgrounds follow its radius. The focus outline is offset, so check that it stays visible, or round the last child's bottom corners instead.

Clip child backgrounds to the panel's rounded corners.
className="tw:overflow-hidden tw:rounded-xl tw:open:border tw:open:border-t-0 tw:open:border-brand-subtle"
🤖 Prompt for agents
Code Review: Matches the classic sidebar to its pre-migration look using new core `NavItemBase` `size="lg"` and `variant="solid"` options, with the rail on the page background and the solid current item and open-group treatment restored. Open-group panel doesn't clip square child fills at its rounded corners, so the last child's current or hovered background may paint past the curved bottom corners; consider adding `overflow-hidden` to the `<details>` panel and checking that the focus outline stays visible.

1. 💡 Quality: Open-group panel doesn't clip square child fills at its rounded corners
   Files: openmetadata-ui/src/main/resources/ui/src/components/MyData/LeftSidebar/LeftSidebar.component.tsx:238-241, openmetadata-ui-core-components/src/main/resources/ui/src/components/application/app-navigation/base-components/nav-item.tsx:63

   The open `<details>` panel has `tw:rounded-xl` and a 1px `border-brand-subtle`, but it has no `overflow-hidden`. At `lg` size, its children use `tw:rounded-none` (nav-item.tsx:63). When the last child of an open group is current (`bg-brand-solid`) or hovered (`bg-brand-primary_alt`), its square fill paints past the panel's curved bottom corners, so they look clipped against the border. Add `tw:overflow-hidden` to the `<details>` so child backgrounds follow its radius. The focus outline is offset, so check that it stays visible, or round the last child's bottom corners instead.

   Fix (Clip child backgrounds to the panel's rounded corners.):
   className="tw:overflow-hidden tw:rounded-xl tw:open:border tw:open:border-t-0 tw:open:border-brand-subtle"

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@shah-harshit

Copy link
Copy Markdown
Contributor Author

Combined into #35509; its commits are merged there and the description carries the sidebar details. Closing this one.

auto-merge was automatically disabled October 15, 2026 13:26

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants