Skip to content

Removed useBreadcrumb hook#28969

Merged
Rohit0301 merged 9 commits into
mainfrom
removed-breadcrumb-hook
Jun 12, 2026
Merged

Removed useBreadcrumb hook#28969
Rohit0301 merged 9 commits into
mainfrom
removed-breadcrumb-hook

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Screenshot 2026-06-11 at 7 59 21 PM Screenshot 2026-06-11 at 7 59 31 PM Screenshot 2026-06-11 at 7 59 37 PM Screenshot 2026-06-11 at 7 59 41 PM Screenshot 2026-06-11 at 7 59 47 PM Screenshot 2026-06-11 at 8 00 19 PM

Fixes 4502

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.

Summary by Gitar

  • Refactored UI navigation:
    • Removed the custom useBreadcrumbs hook across multiple components.
    • Replaced useBreadcrumbs with the standard HeaderBreadcrumb component for better consistency.
    • Updated HeaderBreadcrumb to default showHome prop to true.
  • Cleanup:
    • Removed the unused useBreadcrumbs.tsx utility file.
    • Explicitly set showHome={false} in DataAssetsHeader to maintain existing behavior where required.
  • CSS and Layout updates:
    • Added tw:mb-3 margin to HeaderBreadcrumb and updated container classes in ContextCenter components to remove redundant spacing.

This will update automatically on new commits.

@Rohit0301 Rohit0301 self-assigned this Jun 11, 2026
@Rohit0301 Rohit0301 requested a review from a team as a code owner June 11, 2026 14:24
@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 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (13 flaky)

✅ 4301 passed · ❌ 0 failed · 🟡 13 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 299 0 2 4
🟡 Shard 2 809 0 3 9
🟡 Shard 3 809 0 3 8
🟡 Shard 4 848 0 2 12
🟡 Shard 5 733 0 1 47
🟡 Shard 6 803 0 2 8
🟡 13 flaky test(s) (passed on retry)
  • Features/DescriptionSuggestion.spec.ts › should edit and accept a suggested table column description (shard 1, 1 retry)
  • Pages/Roles.spec.ts › Roles page should work properly (shard 1, 2 retries)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › EditAll User: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with TEST_CASE.EDIT_ALL can see edit action on test case (shard 2, 1 retry)
  • Features/KnowledgeCenterList.spec.ts › Knowledge Center List - Verify Recently Viewed widget (shard 3, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 2 retries)
  • Pages/CustomProperties.spec.ts › String (shard 4, 1 retry)
  • Pages/DataProductAndSubdomains.spec.ts › Add assets to data product and verify count (shard 4, 1 retry)
  • Pages/Entity.spec.ts › User as Owner with unsorted list (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)

📦 Download artifacts

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

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.43% (67058/107396) 43.93% (37117/84480) 45.81% (11469/25033)

@sonarqubecloud

Copy link
Copy Markdown

@Rohit0301 Rohit0301 merged commit 1c6f22f into main Jun 12, 2026
50 checks passed
@Rohit0301 Rohit0301 deleted the removed-breadcrumb-hook branch June 12, 2026 12:08
@gitar-bot

gitar-bot Bot commented Jun 12, 2026

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

Refactors UI navigation by removing the redundant useBreadcrumbs hook in favor of the consistent HeaderBreadcrumb component. Resolves findings regarding default prop behavior and stale JSDoc documentation.

✅ 2 resolved
Bug: Flipping showHome default to true changes existing breadcrumb consumers

📄 openmetadata-ui/src/main/resources/ui/src/components/common/HeaderBreadcrumb/HeaderBreadcrumb.component.tsx:29 📄 openmetadata-ui/src/main/resources/ui/src/components/common/HeaderBreadcrumb/HeaderBreadcrumb.component.tsx:44-58 📄 openmetadata-ui/src/main/resources/ui/src/pages/AuditLogsPage/AuditLogsPage.tsx
HeaderBreadcrumb previously defaulted showHome = false. This PR changes the default to showHome = true (HeaderBreadcrumb.component.tsx:29) so the migrated pages (DataProductListPage, DataProductsDetailsPage, DomainDetails, DomainListPage) keep the Home crumb that the deleted useBreadcrumbs hook prepended automatically.

However, this default flip is global and affects pre-existing consumers that did NOT pass showHome and therefore relied on the old false default:

  • DataAssetsHeader.component.tsx — used on virtually every entity detail page (tables, dashboards, pipelines, etc.). It does not pass showHome, so it now suddenly renders a leading Home icon crumb where it previously rendered none. This is a visible, wide-reaching UI regression not mentioned in this refactor PR.

Note that AuditLogsPage.tsx was given an explicit showHome={false} in this same PR to preserve its behavior, which confirms the default change is behaviorally significant. To avoid the unintended change for DataAssetsHeader (and any other implicit consumer), either keep the default as false and pass showHome explicitly on the migrated pages, or add an explicit showHome={false} to DataAssetsHeader.

Quality: showHome JSDoc still says "Defaults to false" after default change

📄 openmetadata-ui/src/main/resources/ui/src/components/common/HeaderBreadcrumb/HeaderBreadcrumb.component.tsx:29
The default value of showHome was changed to true in HeaderBreadcrumb.component.tsx, but the prop documentation in HeaderBreadcrumb.interface.ts still states "Defaults to false." Update the comment to avoid misleading future callers.

Options

Display: compact → Showing less information.

Comment with these commands to change:

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.

2 participants