Skip to content

fixes: 28703 - Show total asset count for Advanced Search / filtered results on Explore page#28873

Open
satender-kumar-collate wants to merge 16 commits into
mainfrom
fix/28703
Open

fixes: 28703 - Show total asset count for Advanced Search / filtered results on Explore page#28873
satender-kumar-collate wants to merge 16 commits into
mainfrom
fix/28703

Conversation

@satender-kumar-collate

@satender-kumar-collate satender-kumar-collate commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #28703 - Shows total result count on the Explore page when searched or filtered for a particular item.

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:

image image image image

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

  • Explore UI enhancements:
    • Display total asset count in Explore when active filters or search queries are applied.
    • Added hasActiveFilters logic to track state of queryFilter, quickFilters, sqlQuery, and searchQueryParam.
    • Improved GlobalSearchBar to persist filters when clearing search queries.
  • Testing and infrastructure:
    • Added comprehensive Playwright E2E tests in AdvancedSearch.spec.ts for count visibility.
    • Added unit tests for SearchedData and ExploreV1 components to verify correct count rendering.
    • Updated admin.ts and UserClass.ts to use domcontentloaded wait strategy for better test reliability.
    • Updated jest.config.js to mock codemirror dependencies.

This will update automatically on new commits.

…tive (#28703)

- Render search-results-count in SearchedData when showResultCount=true
- Pass showResultCount={hasActiveFilters} from ExploreV1 so the count
  appears only when a search query, quick filter, or advanced search
  filter is active — hidden in bare browse mode
- Fix GlobalSearchBar clear button to navigate with search='' when on
  the Explore page, so clearing the search bar also resets the count
  and results back to browse mode
- Fix Playwright auth/teardown timeouts by using domcontentloaded
  instead of load strategy in UserClass.ts and admin.ts
- Add unit tests for SearchedData count visibility and ExploreV1
  showResultCount prop propagation
- Add E2E tests for count show/hide behaviour in AdvancedSearch.spec.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@satender-kumar-collate satender-kumar-collate requested a review from a team as a code owner June 9, 2026 13:34
@satender-kumar-collate satender-kumar-collate added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Jun 9, 2026

@chirag-madlani chirag-madlani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please attach screenshot / video with changes

Comment thread openmetadata-ui/src/main/resources/ui/jest.config.js
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (17 flaky)

✅ 4289 passed · ❌ 0 failed · 🟡 17 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 300 0 1 4
🟡 Shard 2 805 0 4 9
🟡 Shard 3 814 0 3 8
🟡 Shard 4 849 0 1 12
🟡 Shard 5 730 0 4 47
🟡 Shard 6 791 0 4 8
🟡 17 flaky test(s) (passed on retry)
  • Pages/Roles.spec.ts › Roles page should work properly (shard 1, 1 retry)
  • Features/ColumnBulkOperations.spec.ts › should not reset stats to zero while search request is loading (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot PATCH results (shard 2, 1 retry)
  • Features/DomainTierCertificationVoting.spec.ts › DataProduct - Certification assign, update, and remove (shard 2, 1 retry)
  • Features/OntologyExplorer.spec.ts › should display search input in graph toolbar (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/CustomizeWidgets.spec.ts › Data Products Widget (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Enum (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Inactive Announcement create & delete (shard 5, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/EntityDataSteward.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage service type filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Tier Add, Update and Remove (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

satender-kumar-collate and others added 2 commits June 12, 2026 14:34
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e blocks

The bad merge had folded column tag tests into the Explore Search Count
Visibility describe block and dropped required variable declarations.

- Restore Explore Search Count Visibility with its 3 correct tests
- Extract column tag tests into their own Advanced Search – Column Tag
  filter describe block with module-level variables and beforeAll setup
- Restore missing Column Tags == tag1 test that was dropped in the merge
- Add ClassificationClass and TagClass imports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Satender K and others added 2 commits June 12, 2026 15:58
The filter-checkbox-PersonalData.Personal element only appears when
entities tagged with that tag exist in the search aggregations, which
requires beforeAll setup not present in this describe block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Jun 12, 2026

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

Adds total asset count visibility for filtered Explore page results and cleans up dead code in ExploreV1. Please add cleanup logic to the Advanced Search Playwright tests to ensure entities are deleted after test execution.

💡 Quality: Column Tag describe creates entities but never deletes them

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1104-1118

The new 'Advanced Search – Column Tag filter' describe block creates a ClassificationClass, two TagClass tags, and two TableClass tables in beforeAll, but the block has no afterAll to delete them (there is no afterAll/delete() anywhere in the file). afterAction() only closes the admin API context; it does not remove the created entities. As a result every CI run leaks an orphaned classification, two tags, and two tables into the search index, which can pollute later runs (e.g. the global 'Is not null'/'Is null' column-tag assertions that scope by service) and grow the test database over time.

Suggested fix: add an afterAll that opens an admin context and deletes the two tables, the two tags, and the classification (recursive), mirroring the setup. Even though other blocks in this file rely on shared EntityDataClass fixtures for cleanup, this block owns dedicated entities and should clean them up itself.

Delete the tables, tags and classification created in beforeAll.
test.afterAll('Cleanup column tag entities', async ({ browser }) => {
  const { apiContext, afterAction } = await performAdminLogin(browser);
  await Promise.all([
    columnTagTable1.delete(apiContext),
    columnTagTable2.delete(apiContext),
  ]);
  await Promise.all([
    columnTag1.delete(apiContext),
    columnTag2.delete(apiContext),
  ]);
  await columnTagClassification.delete(apiContext);
  await afterAction();
});
✅ 1 resolved
Quality: Leftover commented-out SearchedData block in ExploreV1

📄 openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx:649-659
A duplicated, commented-out <SearchedData ... /> block (lines 649-659) was left directly above the live <SearchedData> render. It appears to be a leftover from iterating on the fix (the commented version still uses isFilterSelected as a boolean literal). Dead commented code adds noise and contradicts the self-documenting-code guideline. Remove the commented block.

🤖 Prompt for agents
Code Review: Adds total asset count visibility for filtered Explore page results and cleans up dead code in ExploreV1. Please add cleanup logic to the Advanced Search Playwright tests to ensure entities are deleted after test execution.

1. 💡 Quality: Column Tag describe creates entities but never deletes them
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AdvancedSearch.spec.ts:1104-1118

   The new 'Advanced Search – Column Tag filter' describe block creates a `ClassificationClass`, two `TagClass` tags, and two `TableClass` tables in `beforeAll`, but the block has no `afterAll` to delete them (there is no `afterAll`/`delete()` anywhere in the file). `afterAction()` only closes the admin API context; it does not remove the created entities. As a result every CI run leaks an orphaned classification, two tags, and two tables into the search index, which can pollute later runs (e.g. the global 'Is not null'/'Is null' column-tag assertions that scope by service) and grow the test database over time.
   
   Suggested fix: add an `afterAll` that opens an admin context and deletes the two tables, the two tags, and the classification (recursive), mirroring the setup. Even though other blocks in this file rely on shared `EntityDataClass` fixtures for cleanup, this block owns dedicated entities and should clean them up itself.

   Fix (Delete the tables, tags and classification created in beforeAll.):
   test.afterAll('Cleanup column tag entities', async ({ browser }) => {
     const { apiContext, afterAction } = await performAdminLogin(browser);
     await Promise.all([
       columnTagTable1.delete(apiContext),
       columnTagTable2.delete(apiContext),
     ]);
     await Promise.all([
       columnTag1.delete(apiContext),
       columnTag2.delete(apiContext),
     ]);
     await columnTagClassification.delete(apiContext);
     await afterAction();
   });

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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show total asset count for Advanced Search / filtered results on Explore page

2 participants