Skip to content

feat(explore): redesign search export scope to export full tab results with accurate counts#27354

Open
harsh-vador wants to merge 6 commits intomainfrom
enhance-search-export
Open

feat(explore): redesign search export scope to export full tab results with accurate counts#27354
harsh-vador wants to merge 6 commits intomainfrom
enhance-search-export

Conversation

@harsh-vador
Copy link
Copy Markdown
Contributor

@harsh-vador harsh-vador commented Apr 14, 2026

Describe your changes:

Problem

The Search Export modal had two issues:

  1. Wrong scope for "Visible results": It exported only the current page (e.g., 15 rows) instead of all assets in the active tab (e.g., 2987 Tables matching the search)
  2. Wrong count displayed: The modal showed 10,000 (Elasticsearch's default hits.total cap) instead of the actual tab count (e.g., 2987)
  3. Misleading label and description: "Visible results" and "Export all assets matching this search across asset types" were ambiguous — users on the Tables tab couldn't tell which assets would be exported
  4. Playwright tests failing in AUT: Environments with >200k total assets disabled the Export button, breaking multiple tests

Changes

Export scope behaviour

  • Tab scope (formerly "Visible results"): Now exports all assets in the active tab matching the current search and filters — not just the current page. The from pagination offset is removed; size is set to the full tab count
  • All matching assets: Unchanged — exports across all asset types up to the 200k limit

Accurate count

handleOpenExportScopeModal now extracts the tab-specific count directly from the entityType aggregation buckets of the existing DATA_ASSET count query (zero extra API calls). Uses searchClassBase.getEntityTypeSearchIndexMapping() to map the active searchIndex to the correct aggregation bucket → doc_count

Dynamic label

The first export card now shows the active entity type name instead of the static "Visible results" (e.g., "Tables (2987 Results)", "Dashboards (90 Results)")

Screen.Recording.2026-04-14.at.5.10.36.PM.1.mov

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

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • 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.

@harsh-vador harsh-vador self-assigned this Apr 14, 2026
@harsh-vador harsh-vador requested a review from a team as a code owner April 14, 2026 11:20
@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Apr 14, 2026
@harsh-vador harsh-vador changed the title feat(explore): redesign search export scope to export full tab result… feat(explore): redesign search export scope to export full tab results with accurate counts Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.88% (59815/93624) 43.63% (31342/71830) 46.75% (9422/20152)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

🔴 Playwright Results — 2 failure(s), 20 flaky

✅ 3633 passed · ❌ 2 failed · 🟡 20 flaky · ⏭️ 85 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 479 0 1 4
🟡 Shard 2 642 0 3 7
🔴 Shard 3 648 1 3 2
🟡 Shard 4 621 0 5 22
🔴 Shard 5 611 1 0 42
🟡 Shard 6 632 0 8 8

Genuine Failures (failed on all attempts)

Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoContainText�[2m(�[22m�[32mexpected�[39m�[2m)�[22m failed

Locator: getByTestId('domain-link')
Expected substring: �[32m"PW Domain 7bf4e522"�[39m
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toContainText" with timeout 15000ms�[22m
�[2m  - waiting for getByTestId('domain-link')�[22m

Pages/Glossary.spec.ts › Add and Remove Assets (shard 5)
�[31mTest timeout of 180000ms exceeded.�[39m
🟡 20 flaky test(s) (passed on retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › Automated badge should appear on entity description with Automated source (shard 2, 1 retry)
  • Features/Glossary/GlossaryP3Tests.spec.ts › should handle multiple rapid API calls (shard 2, 1 retry)
  • Features/Permissions/GlossaryPermissions.spec.ts › Team-based permissions work correctly (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 4, 1 retry)
  • Pages/DataProductAndSubdomains.spec.ts › Add tags to data product via UI (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Rename domain with subdomains attached verifies subdomain accessibility (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Multiple consecutive domain renames preserve all associations (shard 4, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Data Model (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for table -> mlModel (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Inactive Announcement create & delete (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Tier Add, Update and Remove (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (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

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 15, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Redesigns search export scope to export full tab results with accurate counts, resolving issues where missing aggregation buckets caused zero-size exports and failed fetches displayed incorrect result totals.

✅ 2 resolved
Edge Case: Tab export sends size=0 when aggregation bucket is missing

📄 openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx:143 📄 openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx:182-188 📄 openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx:222-224
If the entityType aggregation is absent from the response (e.g., backend doesn't return it for the DATA_ASSET index with pageSize: 0) or the active tab's entity type has no matching bucket (e.g., zero results for that type), tabAssetsCount is set to 0 at line 188. This flows to visibleResultCount = 0 (line 143), and when the user selects tab-scope export, params.size = 0 is sent to the export API (line 223). This would silently produce an empty CSV with no user-facing indication that something went wrong.

Consider either disabling the tab-scope export option when visibleResultCount === 0, or adding a guard in handleExportScopeConfirm to prevent exporting with size=0.

Edge Case: Failed count fetch leaves tab scope showing 0 results

📄 openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx:143 📄 openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx:160 📄 openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx:189-191
When the searchQuery call in handleOpenExportScopeModal throws (catch block at line 189), tabAssetsCount remains undefined (from line 160), causing visibleResultCount to be 0. The modal will display the tab-scope card as "Selected Data Asset (0 Results)", which is misleading — the count is unknown, not zero. The "all" scope has the same issue but is less prominent since allAssetsCount being undefined is handled by the loading spinner. Consider setting a distinct state (e.g., undefined vs 0) so the UI can show a fallback like '—' instead of '0' when the count is genuinely unknown.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

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 To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant