Repository navigation
fix(ui): show active Explore tab count from its own index, not the aggregate - #31093
mohityadav766 wants to merge 1 commit into
Conversation
…e aggregate Explore tab badges are read from a single index=dataAsset aggregation, while each tab's results come from that tab's own index — two different query builders whose totals can diverge. So the badge on the tab you're viewing could disagree with the list it shows (e.g. a column or schema search where the aggregate counted 1/87 but the tab's own index returned 7381/15). Use the active tab's own results total (searchResults.hits.total.value) for its badge so the count always matches the list in view; inactive tabs keep the aggregate estimate, and the active tab stays visible even at 0 results. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
Code Review ✅ ApprovedUpdates the active Explore tab to display its own results total instead of the aggregate count, ensuring the badge always matches the visible list. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
There was a problem hiding this comment.
Pull request overview
This PR fixes a UX/counting mismatch on the Explore page by ensuring the active tab’s badge count reflects the total hits from that tab’s own index (so the badge matches the results list), while keeping inactive tabs on the cross-index aggregate estimate.
Changes:
- Extend
generateTabItemsto accept the active tab’shits.total.valueand use it as the active badge/count source. - Update
ExplorePageV1to pass the active index total and keep the active tab visible even when its total is0. - Add unit tests covering the active-tab-total behavior and the fallback to aggregate counts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/utils/ExploreUtils.tsx | Add active-tab total support to tab item generation and use it for active badge/count. |
| openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx | Pass searchResults.hits.total.value into tab generation and keep active tab from being filtered out at 0 hits. |
| openmetadata-ui/src/main/resources/ui/src/utils/ExploreUtils.test.ts | Add unit tests validating active-tab count uses its own total and falls back to aggregate when missing. |
| <span> | ||
| {!isNil(searchHitCounts) | ||
| ? getCountBadge( | ||
| searchHitCounts[tabSearchIndex as ExploreSearchIndex], | ||
| '', | ||
| tabSearchIndex === searchIndex | ||
| ) | ||
| ? getCountBadge(tabCount, '', isActiveTab) | ||
| : getCountBadge()} | ||
| </span> |
|
|
✅ Playwright Results — workflow succeededValidated commit ✅ 549 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 1h 3m 39s ⏱️ Max setup 3m 7s · max shard execution 18m 31s · max shard-job elapsed before upload 22m 9s · reporting 5s 🌐 202.97 requests/attempt · 2.83 app boots/UI scenario · 9.54% common-shard skew Optimization targets still in progress:
🟡 1 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Superseded by the backend fix in #REPLACE. Discussed with the team: the aggregate's count of 1 is correct — searching a column's FQN should return that one column. The 7,381 is the bug (the permissive |
|
(correction: superseded by #31106) |



Describe your changes:
Fixes open-metadata/openmetadata-collate#3851
The Explore tab badges are populated from a single
index=dataAssetaggregation (itsentityTypebuckets), while each tab's result list is fetched from that tab's own index (e.g.tableColumn,databaseSchema). The two paths run through different query builders, so the number on the tab you're viewing can diverge from the list it shows:dataAssetaggregate counted 1 but thetableColumnindex returned 7,381Fix: for the active tab, use its own results total (
searchResults.hits.total.value) as the badge count, so the number always matches the list in view. Inactive tabs keep the aggregate estimate (their lists aren't visible to verify anyway), and the active tab stays visible even when its own total is 0.Supersedes #31019 — tightening the column search builder there regressed exact-FQN column lookups to 0 hits (Playwright
SearchRBAC › Table Column); the divergence is a UI counting concern, not a matching one.Type of change:
Tests:
Unit tests
generateTabItems: the active tab reports its own results total (not the aggregate), and falls back to the aggregate when no active total is available.🤖 Generated with Claude Code