Skip to content

Fixed context center breadcrumb home icon#29567

Merged
Rohit0301 merged 14 commits into
mainfrom
context-center-breadcrumb-fix
Jul 2, 2026
Merged

Fixed context center breadcrumb home icon#29567
Rohit0301 merged 14 commits into
mainfrom
context-center-breadcrumb-fix

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Greptile Summary

This PR centralizes the Context Center breadcrumb home icon/root item by moving its construction into ContextCenterClassBase.getContextCenterRootBreadcrumb(t) and auto-prepending it in ContextCenterHeader, so individual pages no longer need to pass it explicitly. It also replaces the inline style card prop with a getHeaderCardClassName() CSS class approach and conditionally shows the showHome breadcrumb icon only when not in embedded mode.

  • ContextCenterClassBase: removes getCardStyle() and getBreadcrumbClassName(), adds getHeaderCardClassName() and getContextCenterRootBreadcrumb(t), and introduces the ContextCenterBreadcrumbItem interface.
  • Header components (ArticleDetailHeader, ArticleVersionHeader, ContextCenterHeader): consume the new class-base methods; showHome is now !isEmbeddedMode().
  • Five page components (Archive, Articles, Dashboard, Documents, Memories): drop the now-redundant root breadcrumb item from their breadcrumbs prop.

Confidence Score: 5/5

Safe to merge — the refactoring is self-contained, all five affected page components are consistently updated, and the one test-file mock returns the wrong type but does not break any test at runtime.

All component and page changes are consistent and correctly remove the now-centralized root breadcrumb item. The only irregularity is in the test file where getHeaderCardClassName mock returns {} instead of '', which is harmless at runtime because classNames({}) produces an empty string, identical in effect.

ArticleDetailHeader.test.tsx — the getHeaderCardClassName mock return value is an object instead of a string.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/utils/ContextCenterClassBase.ts Adds ContextCenterBreadcrumbItem interface, replaces getCardStyle()/getBreadcrumbClassName() with getHeaderCardClassName(), and introduces getContextCenterRootBreadcrumb(t) to centralize the root breadcrumb construction.
openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ArticleDetailHeader/ArticleDetailHeader.component.tsx Uses getContextCenterRootBreadcrumb(t) for the first breadcrumb item, conditionally shows the home icon based on isEmbeddedMode(), and switches from inline style to className for card styling.
openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ArticleDetailHeader/ArticleDetailHeader.test.tsx Adds missing mocks for isEmbeddedMode and getContextCenterRootBreadcrumb; however, getHeaderCardClassName mock incorrectly returns {} (object) instead of '' (string).
openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ArticleVersionHeader/ArticleVersionHeader.component.tsx Same breadcrumb and card-style refactoring as ArticleDetailHeader; consistently applies getContextCenterRootBreadcrumb, isEmbeddedMode, and getHeaderCardClassName.
openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextCenterHeader/ContextCenterHeader.component.tsx Centralizes root breadcrumb prepending via resolvedBreadcrumbs, conditions showHome on !isEmbedded, and replaces style prop with classNames-based className approach.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Page Component\n(Archive / Articles / Dashboard / Documents / Memories)"]
    B["breadcrumbs prop\n[{ label: 'Archive' }, ...]"]
    C["ContextCenterHeader"]
    D["getContextCenterRootBreadcrumb(t)\n→ { label: 'Context Center', href: '/context-center' }"]
    E["resolvedBreadcrumbs\n= [root, ...breadcrumbs]"]
    F["isEmbeddedMode()"]
    G["showHome = !isEmbedded"]
    H["HeaderBreadcrumb\nitems=resolvedBreadcrumbs, showHome=!isEmbedded"]

    A -->|"passes"| B
    B --> C
    C --> D
    D --> E
    C --> F
    F --> G
    E --> H
    G --> H
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["Page Component\n(Archive / Articles / Dashboard / Documents / Memories)"]
    B["breadcrumbs prop\n[{ label: 'Archive' }, ...]"]
    C["ContextCenterHeader"]
    D["getContextCenterRootBreadcrumb(t)\n→ { label: 'Context Center', href: '/context-center' }"]
    E["resolvedBreadcrumbs\n= [root, ...breadcrumbs]"]
    F["isEmbeddedMode()"]
    G["showHome = !isEmbedded"]
    H["HeaderBreadcrumb\nitems=resolvedBreadcrumbs, showHome=!isEmbedded"]

    A -->|"passes"| B
    B --> C
    C --> D
    D --> E
    C --> F
    F --> G
    E --> H
    G --> H
Loading

Comments Outside Diff (2)

  1. openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ArticleDetailHeader/ArticleDetailHeader.test.tsx, line 55-68 (link)

    P1 Missing mocks for new contextCenterClassBase methods

    The mock object for contextCenterClassBase no longer includes isEmbeddedMode or getContextCenterRootBreadcrumb, both of which are now called at the top of the component. When any test renders ArticleDetailHeader, JavaScript will find undefined for those properties and immediately throw TypeError: contextCenterClassBase.isEmbeddedMode is not a function before the component can mount, causing every test in this suite to fail.

  2. openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ArticleDetailHeader/ArticleDetailHeader.test.tsx, line 55-68 (link)

    P1 Missing mocks for new contextCenterClassBase methods cause every test to fail

    The component now calls contextCenterClassBase.isEmbeddedMode() unconditionally at the top of the component body (before useMemo) and contextCenterClassBase.getContextCenterRootBreadcrumb(t) inside useMemo. Neither is present in the mock object, so every test throws TypeError: contextCenterClassBase.isEmbeddedMode is not a function before the component can mount. Add the two missing mock entries: isEmbeddedMode: jest.fn(() => false) and getContextCenterRootBreadcrumb: jest.fn(() => ({ label: 'label.context-center', href: '/context-center' })).

Reviews (13): Last reviewed commit: "Merge branch 'main' into context-center-..." | Re-trigger Greptile

@Rohit0301 Rohit0301 self-assigned this Jun 29, 2026
@Rohit0301 Rohit0301 requested a review from a team as a code owner June 29, 2026 11:08
@Rohit0301 Rohit0301 added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Jun 29, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (51 flaky)

✅ 4435 passed · ❌ 0 failed · 🟡 51 flaky · ⏭️ 37 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 424 0 6 16
🟡 Shard 2 796 0 12 8
🟡 Shard 3 802 0 7 7
🟡 Shard 4 807 0 3 5
🟡 Shard 5 840 0 15 0
🟡 Shard 6 766 0 8 1
🟡 51 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the Worksheet entity item action after rules disabled (shard 1, 1 retry)
  • Features/DescriptionSuggestion.spec.ts › should add and accept a requested topic schema field description (shard 1, 1 retry)
  • Features/Glossary/GlossaryPagination.spec.ts › should filter by InReview status (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 2 retries)
  • Flow/SearchRBAC.spec.ts › User without permission (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › a dashboard-scoped user sees dashboards but never tables (shard 1, 2 retries)
  • Features/BulkEditEntity.spec.ts › Database (shard 2, 1 retry)
  • Features/BulkEditEntity.spec.ts › Database Schema (shard 2, 1 retry)
  • Features/BulkEditOperationBadges.spec.ts › Database service bulk edit search filters rows and clear restores them (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Database service (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Database Schema (shard 2, 2 retries)
  • Features/BulkImport.spec.ts › Keyboard Delete selection (shard 2, 1 retry)
  • Features/Container.spec.ts › Container page should show Schema and Children count (shard 2, 1 retry)
  • Features/Container.spec.ts › expand / collapse should not appear after updating nested fields for container (shard 2, 1 retry)
  • Features/Container.spec.ts › Copy column link button should copy the column URL to clipboard (shard 2, 1 retry)
  • Features/Container.spec.ts › Copy column link should have valid URL format (shard 2, 1 retry)
  • Features/ContextCenterPermission.spec.ts › user with editAll permission can see restore action but not delete action on an archived document, and can restore it (shard 2, 2 retries)
  • Features/DataQuality/ColumnLevelTests.spec.ts › Column Values To Be Unique (shard 2, 1 retry)
  • Features/LandingPageWidgets/FollowingWidget.spec.ts › Check followed entity present in following widget (shard 3, 1 retry)
  • Features/Permissions/EntityPermissions.spec.ts › Topic deny common operations permissions (shard 3, 1 retry)
  • Features/Permissions/EntityPermissions.spec.ts › File allow common operations permissions (shard 3, 1 retry)
  • Features/RecentlyViewed.spec.ts › Check Store Procedure in recently viewed (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 3, 1 retry)
  • Features/Table.spec.ts › should persist page size (shard 3, 1 retry)
  • Flow/IngestionBot.spec.ts › Ingestion bot should be able to access domain specific domain (shard 4, 1 retry)
  • Flow/NestedChildrenUpdates.spec.ts › should add and remove tags to nested column immediately without refresh (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Timestamp (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Team as Owner Add, Update and Remove (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Update displayName (shard 5, 1 retry)
  • ... and 21 more

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@gitar-bot

gitar-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Centralizes root breadcrumb construction and adds conditional home icon support for embedded mode. All findings related to test coverage and logic gaps have been resolved.

✅ 1 resolved
Quality: resolvedBreadcrumbs silently drops first item via slice(1)

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextCenterHeader/ContextCenterHeader.component.tsx:45-48
resolvedBreadcrumbs = [getContextCenterRootBreadcrumb(t), ...breadcrumbs.slice(1)] assumes the caller's first breadcrumb is always the context-center root. This holds for all current callers (verified across ContextCenterArticlesPage, DocumentsPage, MemoriesPage, DashboardPage, ArchivePage), so there is no bug today. However the assumption is implicit and fragile: a future caller that passes a breadcrumbs array whose first element is a real (non-root) crumb would have it silently discarded. Consider documenting this contract or making the substitution explicit (e.g. always prepend the root and let callers omit it) to avoid a subtle regression later.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Rohit0301 and others added 2 commits June 30, 2026 15:22
…nter/ArticleDetailHeader/ArticleDetailHeader.test.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
chirag-madlani
chirag-madlani previously approved these changes Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.15% (70847/112172) 46% (40914/88925) 47.46% (12646/26644)

@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 1 resolved / 2 findings

Centralizes Context Center breadcrumb construction into the base class to remove redundant definitions across pages. Please address the missing isEmbeddedMode and getContextCenterRootBreadcrumb test mocks to prevent component render failures.

💡 Quality: Hardcoded download filename string literal

📄 openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:327

downloadBlob(blob, 'context-center-documents.zip') uses a hardcoded literal. If this filename is meant to be user-facing/localizable, it should come through the useTranslation hook per the project's no-string-literals policy. If it is a purely technical constant, consider extracting it to a named constant for clarity. Verified the backend bulk endpoints (delete/move) set BulkResponse.request to id.toString(), so the new getSuccessfulIds() string-filter logic correctly extracts ids — no correctness issue there.

✅ 1 resolved
Quality: resolvedBreadcrumbs silently drops first item via slice(1)

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextCenterHeader/ContextCenterHeader.component.tsx:45-48
resolvedBreadcrumbs = [getContextCenterRootBreadcrumb(t), ...breadcrumbs.slice(1)] assumes the caller's first breadcrumb is always the context-center root. This holds for all current callers (verified across ContextCenterArticlesPage, DocumentsPage, MemoriesPage, DashboardPage, ArchivePage), so there is no bug today. However the assumption is implicit and fragile: a future caller that passes a breadcrumbs array whose first element is a real (non-root) crumb would have it silently discarded. Consider documenting this contract or making the substitution explicit (e.g. always prepend the root and let callers omit it) to avoid a subtle regression later.

🤖 Prompt for agents
Code Review: Centralizes Context Center breadcrumb construction into the base class to remove redundant definitions across pages. Please address the missing `isEmbeddedMode` and `getContextCenterRootBreadcrumb` test mocks to prevent component render failures.

1. 💡 Quality: Hardcoded download filename string literal
   Files: openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:327

   `downloadBlob(blob, 'context-center-documents.zip')` uses a hardcoded literal. If this filename is meant to be user-facing/localizable, it should come through the `useTranslation` hook per the project's no-string-literals policy. If it is a purely technical constant, consider extracting it to a named constant for clarity. Verified the backend bulk endpoints (delete/move) set `BulkResponse.request` to `id.toString()`, so the new `getSuccessfulIds()` string-filter logic correctly extracts ids — no correctness issue there.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants