Skip to content

fix(ui): use Untitled-UI dropdowns for Add Assets drawer quick-filters - #29168

Merged
siddhant1 merged 3 commits into
mainfrom
sid/untitled-quick-filter-dropdown
Jun 18, 2026
Merged

siddhant1 merged 3 commits into
mainfrom
sid/untitled-quick-filter-dropdown

Conversation

@siddhant1

@siddhant1 siddhant1 commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

The Domains / Data Products → Add Assets drawer quick-filters (Entity Type, Owners, Tag, Tier, Service) are now fully interactive.

Screenshot 2026-06-18 at 7 29 31 PM Screenshot 2026-06-18 at 7 29 45 PM

Why: The Add Assets drawer is an Untitled-UI SlideoutMenu (react-aria Modal/Dialog). The quick filters used the Ant Design SearchDropdown, whose popup portals to document.body — outside the dialog subtree, where react-aria's inert attribute makes it non-interactive (clicks fall through to the content behind and the popup closes). z-index cannot override inert; the popup must live inside the dialog's layer.

What: Add a new QuickFilterDropdown built on the Untitled-UI PopoverTrigger/Popover (react-aria), whose popover renders in the dialog's own top layer — so it stays interactive with no AntD-over-drawer workaround (no getPopupContainer, no ConfigProvider). It reproduces the current filter UX: compact button trigger, an in-popover search box, a checkbox option list with counts, single/multi-select, a null-option row, and Clear/Apply (selection staged until Apply). ExploreQuickFilters renders it behind an untitledDropdown flag that only the Add Assets drawer passes (variant === 'drawer'); the Add Assets modal variant, the Explore page, the Glossary asset tab and Lineage controls keep the existing AntD SearchDropdown — zero change to those surfaces.

It reuses the existing data plumbing unchanged (ExploreQuickFilterField, option fetching, getQuickFilterQuery), so behavior matches today's filters.

Supersedes #29161 (same goal, this is the agreed final approach). No tracked GitHub issue — internal handoff; happy to open one if required.

Type of change:

  • Bug fix

High-level design:

Small, additive, drawer-scoped. One new consumer-app component composed from @openmetadata/ui-core-components primitives (PopoverTrigger, Popover, Button, Input, Checkbox) — no core-component changes. ExploreQuickFilters gains an optional untitledDropdown prop (defaults to false), so the 4 other call sites are untouched. react-aria nested Popover inside the SlideoutMenu dialog renders in the shared top layer — that's what keeps it interactive.

Rejected approaches (per review): routing the AntD popup into the dialog via getPopupContainer / a ConfigProvider drawer provider (keeps an AntD overlay in the Untitled drawer); the field-style MultiSelect/Autocomplete (wrong UX); enhancing the core Dropdown primitive (touches a shared core component).

Tests:

Use cases covered

  • Add Assets drawer (Domain / Data Product / Input-Output Ports): each quick filter opens, the search box filters options, multi/single/null select works with counts, Apply/Clear — fully interactive (the inert bug is gone because no AntD popup is rendered).
  • Modal variant (Glossary/Tags) and the Explore page behave exactly as before.

Unit tests

  • QuickFilterDropdown.test.tsx — fetch-on-open, stage-then-Apply emits the selected value, single-select keeps one value, null-option emits the null key, debounced search calls onSearch.

Backend / Ingestion integration tests

  • Not applicable.

Playwright (UI) tests

  • Added a shared, reusable drawer quick-filter behaviour matrix (playwright/utils/assetDrawerQuickFilter.ts) that, in a single drawer session, asserts: the popover is interactive and its search box filters options, Close discards the staged selection, selecting + Update narrows the asset list, and combining filters (Entity Type + Tier) intersects the results.
  • The matrix runs across every drawer surface: Domains.spec.ts (domain Add Assets), DataProductAndSubdomains.spec.ts (data-product Add Assets), and InputOutputPorts.spec.ts (input and output port drawers). Seeding/cleanup and the port-drawer context live in playwright/utils/inputOutputPorts.ts.
  • This replaces the previous visibility-only check in InputOutputPorts.spec.ts with a full interactivity regression guard for the document.body-portal inert bug.

Manual testing performed

  • tsc --noEmit on the changed files — clean. UI checkstyle (organize-imports → eslint → prettier, plus license headers on the new playwright utils) — clean. Jest (40 tests across the new + existing Explore filter suites) — pass.

UI screen recording / screenshots:

Screenshots of the interactive Add Assets drawer filters (trigger + open popover with search and counts) are attached at the top of this description.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue (no tracked issue — see note above).
  • I have added tests (unit + Playwright) and listed them above.
  • For UI changes: I attached screenshots above.

🤖 Generated with Claude Code


Summary by Gitar

  • Logic fix:
    • Updated handleClear in QuickFilterDropdown to correctly reset nullOptionSelected in addition to clearing selectedOptions.
  • Component robustness:
    • Added key to QuickFilterDropdown rendering in ExploreQuickFilters to ensure proper React lifecycle management during filter state changes.
  • UI refinement:
    • Adjusted Space gap in ExploreQuickFilters from [8, 0] to [8, 8] to provide better vertical spacing for the new dropdown variant.

This will update automatically on new commits.

--|----------|
| openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.tsx | New react-aria popover dropdown component; two pre-flagged bugs remain unaddressed: handleClear does not reset nullOptionSelected, and debouncedOnSearch is never cancelled when deps change. |
| openmetadata-ui/src/main/resources/ui/src/components/Explore/ExploreQuickFilters.tsx | Adds untitledDropdown flag branching; field.value ?? [] creates an unstable reference causing QuickFilterDropdown's effect to fire on every loading re-render; row-gap change is applied globally rather than scoped to the new variant. |
| openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.test.tsx | Good unit coverage for open-on-fetch, stage-then-apply, single-select, null-option, and debounced search; the handleClear + nullOptionSelected bug is not exercised by any test case. |
| openmetadata-ui/src/main/resources/ui/src/components/DataAssets/AssetsSelectionModal/useAssetSelectionContent.tsx | Single-line change passing untitledDropdown={variant === 'drawer'}; correct and minimal. |
| openmetadata-ui/src/main/resources/ui/playwright/utils/assetDrawerQuickFilter.ts | New shared Playwright helper; covers open/search/apply/close/combine-filter scenarios; relies on ${option.label}-checkbox testid format matching lowercase entity type labels from the API. |
| openmetadata-ui/src/main/resources/ui/playwright/utils/inputOutputPorts.ts | Cleanly extracts createAssetRef, seed/cleanup helpers, and buildPortDrawerContext from the spec file; domain lifecycle is correctly left to the caller. |

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant QuickFilterDropdown
    participant ExploreQuickFilters
    participant API

    User->>QuickFilterDropdown: clicks trigger button
    QuickFilterDropdown->>ExploreQuickFilters: onGetInitialOptions(searchKey)
    ExploreQuickFilters->>API: getAggregationOptions(...)
    Note over ExploreQuickFilters: setIsOptionsLoading(true) re-render<br/>selectedKeys = new [] each time<br/>⚠️ useEffect fires → selectedOptions reset
    API-->>ExploreQuickFilters: aggregation buckets
    Note over ExploreQuickFilters: setOptions(result) re-render<br/>⚠️ useEffect fires again → selectedOptions reset
    User->>QuickFilterDropdown: checks options (staged internally)
    User->>QuickFilterDropdown: clicks Update
    QuickFilterDropdown->>ExploreQuickFilters: onChange(selectedValues, searchKey)
    ExploreQuickFilters->>ExploreQuickFilters: onFieldValueSelect updates field.value
    Note over QuickFilterDropdown: setIsOpen(false)<br/>useEffect syncs to new selectedKeys ✓
    User->>QuickFilterDropdown: clicks Close (no Apply)
    Note over QuickFilterDropdown: setIsOpen(false)<br/>useEffect resets staged state to selectedKeys ✓
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"}}}%%
sequenceDiagram
    participant User
    participant QuickFilterDropdown
    participant ExploreQuickFilters
    participant API

    User->>QuickFilterDropdown: clicks trigger button
    QuickFilterDropdown->>ExploreQuickFilters: onGetInitialOptions(searchKey)
    ExploreQuickFilters->>API: getAggregationOptions(...)
    Note over ExploreQuickFilters: setIsOptionsLoading(true) re-render<br/>selectedKeys = new [] each time<br/>⚠️ useEffect fires → selectedOptions reset
    API-->>ExploreQuickFilters: aggregation buckets
    Note over ExploreQuickFilters: setOptions(result) re-render<br/>⚠️ useEffect fires again → selectedOptions reset
    User->>QuickFilterDropdown: checks options (staged internally)
    User->>QuickFilterDropdown: clicks Update
    QuickFilterDropdown->>ExploreQuickFilters: onChange(selectedValues, searchKey)
    ExploreQuickFilters->>ExploreQuickFilters: onFieldValueSelect updates field.value
    Note over QuickFilterDropdown: setIsOpen(false)<br/>useEffect syncs to new selectedKeys ✓
    User->>QuickFilterDropdown: clicks Close (no Apply)
    Note over QuickFilterDropdown: setIsOpen(false)<br/>useEffect resets staged state to selectedKeys ✓
Loading

Reviews (2): Last reviewed commit: "test(ui): E2E coverage for Add-Assets dr..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Greptile Summary

This PR introduces QuickFilterDropdown, a react-aria PopoverTrigger/Popover-based replacement for the AntD SearchDropdown in the Add Assets drawer, fixing a non-interactive popover bug caused by react-aria's inert attribute on document.body-portaled overlays. The change is additive and flag-gated behind an untitledDropdown prop so all existing surfaces (Explore page, Glossary, Lineage) remain unchanged.

  • New component (QuickFilterDropdown.tsx): reproduces the full filter UX (search box, checkbox list with counts, staged selection, Clear All / Update, null-option row) using Untitled-UI primitives so the popover renders in the react-aria top layer inside the drawer.
  • Flag-gated activation (ExploreQuickFilters.tsx + useAssetSelectionContent.tsx): untitledDropdown={variant === 'drawer'} is the sole new call-site; existing call-sites pass no flag and render the unchanged AntD SearchDropdown.
  • Test coverage: unit tests for the new component (QuickFilterDropdown.test.tsx) and a shared Playwright behaviour matrix (assetDrawerQuickFilter.ts) exercised across Domains, Data Products, and Input/Output Port drawer surfaces.

Confidence Score: 4/5

Safe to merge for the drawer surfaces; three known issues flagged in earlier review threads remain unaddressed in the current code but do not affect the primary save flow or existing surfaces.

The core fix — replacing the AntD popup with a react-aria popover so filters work inside the SlideoutMenu — is correct and well-scoped. The three open issues (handleClear not resetting nullOptionSelected, debounced search not cancelling on prop change, unstable selectedKeys reference wiping staged selections during options load) affect filter UX quality but none cause data corruption or break the primary save flow. All existing surfaces are untouched by the flag-gate.

QuickFilterDropdown.tsx warrants a follow-up pass for the three issues noted in prior review threads before this component is reused beyond the Add Assets drawer.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.tsx New react-aria popover dropdown. Three known bugs (flagged in prior review threads): handleClear omits nullOptionSelected reset, debouncedOnSearch is never cancelled when onSearch/searchKey change, and field.value ?? [] creates an unstable selectedKeys reference in the parent that fires the sync useEffect during the loading sequence.
openmetadata-ui/src/main/resources/ui/src/components/Explore/ExploreQuickFilters.tsx Adds untitledDropdown flag and key prop; Space gap changed from [8,0] to [8,8] globally (affects all surfaces, not just the drawer variant). Inline arrow function props for onChange/onSearch/onGetInitialOptions recreate on every render, feeding the debounce-cancel issue in the child.
openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.test.tsx Good unit coverage for open-on-fetch, stage-then-apply, single-select, null-option, and debounced search; the handleClear + nullOptionSelected bug is not exercised by any test case.
openmetadata-ui/src/main/resources/ui/src/components/DataAssets/AssetsSelectionModal/useAssetSelectionContent.tsx Single-line change passing untitledDropdown={variant === 'drawer'}; correct and minimal.
openmetadata-ui/src/main/resources/ui/playwright/utils/assetDrawerQuickFilter.ts New shared Playwright helper covering open/search/apply/close/combine-filter scenarios. The ${option.label}-checkbox testid strategy relies on entity type labels from the aggregation API being lowercase; this matches ES bucket-key conventions and is consistent with the component's data-testid attribute.
openmetadata-ui/src/main/resources/ui/playwright/utils/inputOutputPorts.ts Clean extraction of createAssetRef, seed/cleanup helpers, and buildPortDrawerContext; domain lifecycle correctly delegated to the caller.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant QFDropdown as QuickFilterDropdown
    participant EQF as ExploreQuickFilters
    participant API

    User->>QFDropdown: clicks trigger
    QFDropdown->>EQF: onGetInitialOptions(searchKey)
    EQF->>EQF: setIsOptionsLoading(true), setOptions([])
    EQF->>API: getAggregationOptions(...)
    API-->>EQF: aggregation buckets
    EQF->>EQF: setOptions(result), setIsOptionsLoading(false)
    EQF-->>QFDropdown: "isSuggestionsLoading=false, options=[...]"
    User->>QFDropdown: checks one or more options (staged)
    User->>QFDropdown: clicks Update
    QFDropdown->>EQF: onChange(selectedValues, searchKey)
    EQF->>EQF: onFieldValueSelect → updates field.value
    QFDropdown->>QFDropdown: setIsOpen(false)
    Note over QFDropdown: useEffect([selectedKeys, isOpen]) syncs staged state to new selectedKeys ✓
    User->>QFDropdown: clicks Close (without Update)
    QFDropdown->>QFDropdown: setIsOpen(false)
    Note over QFDropdown: useEffect fires → resets staged selections to current selectedKeys (discard) ✓
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"}}}%%
sequenceDiagram
    participant User
    participant QFDropdown as QuickFilterDropdown
    participant EQF as ExploreQuickFilters
    participant API

    User->>QFDropdown: clicks trigger
    QFDropdown->>EQF: onGetInitialOptions(searchKey)
    EQF->>EQF: setIsOptionsLoading(true), setOptions([])
    EQF->>API: getAggregationOptions(...)
    API-->>EQF: aggregation buckets
    EQF->>EQF: setOptions(result), setIsOptionsLoading(false)
    EQF-->>QFDropdown: "isSuggestionsLoading=false, options=[...]"
    User->>QFDropdown: checks one or more options (staged)
    User->>QFDropdown: clicks Update
    QFDropdown->>EQF: onChange(selectedValues, searchKey)
    EQF->>EQF: onFieldValueSelect → updates field.value
    QFDropdown->>QFDropdown: setIsOpen(false)
    Note over QFDropdown: useEffect([selectedKeys, isOpen]) syncs staged state to new selectedKeys ✓
    User->>QFDropdown: clicks Close (without Update)
    QFDropdown->>QFDropdown: setIsOpen(false)
    Note over QFDropdown: useEffect fires → resets staged selections to current selectedKeys (discard) ✓
Loading

Reviews (3): Last reviewed commit: "Merge branch 'main' into sid/untitled-qu..." | Re-trigger Greptile

@siddhant1
siddhant1 requested a review from a team as a code owner June 18, 2026 08:49
Copilot AI review requested due to automatic review settings June 18, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

The Domains / Data Products "Add Assets" drawer is an Untitled-UI SlideoutMenu
(react-aria Modal/Dialog). Its quick-filter dropdowns used the Ant Design
SearchDropdown, whose popup portals to document.body — outside the dialog
subtree, where react-aria's `inert` attribute makes it non-interactive (clicks
fall through and the popup closes). z-index cannot fix `inert`.

Add a QuickFilterDropdown built on the Untitled-UI PopoverTrigger/Popover
(react-aria) with a search box, a checkbox option list with counts,
single/multi-select, a null-option and Apply/Clear. Its popover renders in the
dialog's top layer and stays interactive without any AntD-over-drawer
workaround. ExploreQuickFilters renders it behind an `untitledDropdown` flag
that only the Add Assets drawer passes (variant === 'drawer'); the Modal
variant, Explore page, Glossary tab and Lineage controls keep the AntD
SearchDropdown unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@siddhant1 siddhant1 added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Jun 18, 2026
Add a shared drawer quick-filter behaviour matrix (interactive popover,
search-scoped options, discard-on-close, apply-narrows-list, combined
filters) and run it across the domain, data-product, and input/output
port Add-Assets drawers. Adds reusable helpers in
assetDrawerQuickFilter.ts and inputOutputPorts.ts.

Also bump the wrapped quick-filter row gutter (vertical 0 -> 8) so the
Untitled dropdowns have breathing room when they wrap.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@siddhant1
siddhant1 force-pushed the sid/untitled-quick-filter-dropdown branch from 0259f1a to 5b48157 Compare June 18, 2026 13:58
showSelectedCounts = false,
optionPageSize,
additionalActions,
untitledDropdown = false,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will go away, just adding a variant for sideout

Comment on lines +133 to +147
const assertCombineFilters = async (
page: Page,
ctx: DrawerQuickFilterContext,
tierLabel: string
) => {
await openQuickFilter(page, tierLabel);
await popover(page)
.getByTestId(/tier1-checkbox$/i)
.click();
await applyQuickFilter(page);

await scopeDrawerSearch(page, ctx.table.name);
await expectAssetVisible(page, ctx.table.fqn);
await scopeDrawerSearch(page, ctx.untieredTable.name);
await expectAssetHidden(page, ctx.untieredTable.fqn);

@gitar-bot gitar-bot Bot Jun 18, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: Drawer filter matrix leaves prior filter applied, weakening combine test

runDrawerQuickFilterMatrix runs assertApplyNarrowsList (which applies and Applies the Entity Type = table filter) and then immediately runs assertCombineFilters without ever clearing the Entity Type filter. By the time the combine step runs, the entity-type filter is still active, so the assertion that ctx.topic is hidden (line 148-149) is trivially satisfied by the leftover Entity Type = table filter rather than by the newly applied Tier filter — it does not actually prove the Tier filter intersects correctly. Only the tieredTable-visible / untieredTable-hidden pair (both tables) genuinely exercises the Tier filter. Consider clearing filters between steps, or having the combine step assert that removing the entity-type filter and applying only Tier still hides the topic, so the intersection behavior is meaningfully verified.

Document/clear filter state between matrix steps so the combine assertions are not masked by a leftover filter.:

// In assertCombineFilters, drop the trivially-true topic check or first clear
// the Entity Type filter so the Tier filter is the only thing under test:
await openQuickFilter(page, tierLabel);
await popover(page).getByTestId(/tier1-checkbox$/i).click();
await applyQuickFilter(page);

await scopeDrawerSearch(page, ctx.table.name);
await expectAssetVisible(page, ctx.table.fqn);
await scopeDrawerSearch(page, ctx.untieredTable.name);
await expectAssetHidden(page, ctx.untieredTable.fqn);

Was this helpful? React with 👍 / 👎

Comment on lines +264 to +278
await test.step('Create domain and varied assets', async () => {
await filterDomain.create(apiContext);
await tieredTable.create(apiContext);
await tieredTable.patch({
apiContext,
patchData: [
{
op: 'add',
path: '/tags/0',
value: {
tagFQN: 'Tier.Tier1',
source: 'Classification',
labelType: 'Manual',
},
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: Asset-seeding logic duplicated across three spec/util files

seedDrawerFilterAssets was extracted into inputOutputPorts.ts, but Domains.spec.ts and DataProductAndSubdomains.spec.ts re-inline nearly identical seeding code (create tieredTable/plainTable/filterTopic/filterDashboard, patch Tier.Tier1, apply domainPatch) plus matching inline teardown. The variations are small (Domains seeds assets without domain membership; the helper requires a DataProduct and always patches domain), so the helper isn't directly reusable as written. Consider generalizing the seeding helper (e.g. optional DataProduct, optional domain patch) and reusing it in all three call sites to avoid drift in the test fixtures over time. This is test-only quality cleanup, not a correctness issue.

Was this helpful? React with 👍 / 👎

label={translateWithNestedKeys(field.label, field.labelKeyOptions)}
options={dropdownOptions}
searchKey={field.key}
selectedKeys={field.value ?? []}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Unstable selectedKeys reference wipes staged selections during options load

field.value ?? [] creates a new array reference on every render when field.value is undefined (no filter applied yet). QuickFilterDropdown's useEffect depends on selectedKeys via reference equality, so it fires on every re-render triggered by the loading sequence (setIsOptionsLoading(true) → setOptions([]) → setOptions(result) → setIsOptionsLoading(false)). Each fire resets selectedOptions to [], erasing any checkbox selections the user made before the initial fetch completed. The race window is the full fetch duration (~100–500 ms on a typical network), during which any clicked option silently disappears.

A stable fallback reference fixes this without touching QuickFilterDropdown: define const EMPTY_OPTIONS: SearchDropdownOption[] = [] at module level, then use selectedKeys={field.value ?? EMPTY_OPTIONS} so Object.is sees the same reference across re-renders when no filter is applied.

@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.29% (66684/107037) 44.05% (37309/84689) 45.41% (11209/24683)

@chirag-madlani chirag-madlani added the To release Will cherry-pick this PR into the release branch label Jun 18, 2026
@siddhant1
siddhant1 enabled auto-merge (squash) June 18, 2026 14:53
@sonarqubecloud

Copy link
Copy Markdown

@siddhant1
siddhant1 merged commit b953555 into main Jun 18, 2026
54 of 59 checks passed
@siddhant1
siddhant1 deleted the sid/untitled-quick-filter-dropdown branch June 18, 2026 20:23
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (18 flaky)

✅ 4299 passed · ❌ 0 failed · 🟡 18 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 302 0 0 4
🟡 Shard 2 808 0 4 9
🟡 Shard 3 814 0 2 8
🟡 Shard 4 853 0 6 12
🟡 Shard 5 732 0 1 47
🟡 Shard 6 790 0 5 8
🟡 18 flaky test(s) (passed on retry)
  • Features/ContextCenter.spec.ts › searching documents filters the list to matching results (shard 2, 1 retry)
  • Features/DataQuality/ProfilerIngestionForm.spec.ts › DYNAMIC with smart sampling OFF and thresholds sends thresholds array (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/Glossary/GlossaryMiscOperations.spec.ts › should delete parent term and remove both parent and child tags from assets (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 3, 1 retry)
  • Features/Tasks/DomainFiltering.spec.ts › selecting All Domains removes domain filter from feed API call (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Timestamp (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Container (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate DataProduct Rule Any_In (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Domain Rbac (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 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/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)
  • Pages/LogsViewer.spec.ts › Logs page shows breadcrumb, summary, and log viewer or empty state after opening from bundle suite pipeline tab (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

@gitar-bot

gitar-bot Bot commented Jun 18, 2026

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

Adds interactive QuickFilterDropdown to the Add Assets drawer, resolving the react-aria inert bug by using top-layer popovers. Ensure the handleClear logic and debounced search cleanup are finalized to prevent state persistence issues.

💡 Quality: Drawer filter matrix leaves prior filter applied, weakening combine test

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/assetDrawerQuickFilter.ts:133-147

runDrawerQuickFilterMatrix runs assertApplyNarrowsList (which applies and Applies the Entity Type = table filter) and then immediately runs assertCombineFilters without ever clearing the Entity Type filter. By the time the combine step runs, the entity-type filter is still active, so the assertion that ctx.topic is hidden (line 148-149) is trivially satisfied by the leftover Entity Type = table filter rather than by the newly applied Tier filter — it does not actually prove the Tier filter intersects correctly. Only the tieredTable-visible / untieredTable-hidden pair (both tables) genuinely exercises the Tier filter. Consider clearing filters between steps, or having the combine step assert that removing the entity-type filter and applying only Tier still hides the topic, so the intersection behavior is meaningfully verified.

Document/clear filter state between matrix steps so the combine assertions are not masked by a leftover filter.
// In assertCombineFilters, drop the trivially-true topic check or first clear
// the Entity Type filter so the Tier filter is the only thing under test:
await openQuickFilter(page, tierLabel);
await popover(page).getByTestId(/tier1-checkbox$/i).click();
await applyQuickFilter(page);

await scopeDrawerSearch(page, ctx.table.name);
await expectAssetVisible(page, ctx.table.fqn);
await scopeDrawerSearch(page, ctx.untieredTable.name);
await expectAssetHidden(page, ctx.untieredTable.fqn);
💡 Quality: Asset-seeding logic duplicated across three spec/util files

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Domains.spec.ts:264-278 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataProductAndSubdomains.spec.ts:63-77 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/inputOutputPorts.ts:47-61

seedDrawerFilterAssets was extracted into inputOutputPorts.ts, but Domains.spec.ts and DataProductAndSubdomains.spec.ts re-inline nearly identical seeding code (create tieredTable/plainTable/filterTopic/filterDashboard, patch Tier.Tier1, apply domainPatch) plus matching inline teardown. The variations are small (Domains seeds assets without domain membership; the helper requires a DataProduct and always patches domain), so the helper isn't directly reusable as written. Consider generalizing the seeding helper (e.g. optional DataProduct, optional domain patch) and reusing it in all three call sites to avoid drift in the test fixtures over time. This is test-only quality cleanup, not a correctness issue.

✅ 2 resolved
✅ Quality: Debounced onSearch is never cancelled on close/unmount

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.tsx:62-65 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.tsx:99-110
debouncedOnSearch (500ms debounce) is created via useMemo but is never cancelled. If a user types in the search box and then immediately closes the popover (or the component unmounts), the pending debounced call still fires after the timeout, triggering onSearch -> getFilterOptions, which calls setOptions/setIsOptionsLoading on the parent. At best this is a wasted aggregation request; it can also produce a state update for a no-longer-visible filter. Cancel the debounced function on unmount (and optionally when the popover closes).

✅ Edge Case: Clear All does not reset the null-option selection

📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.tsx:93 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.tsx:135-148 📄 openmetadata-ui/src/main/resources/ui/src/components/Explore/QuickFilterDropdown.tsx:178-189
handleClear only clears the staged option list (setSelectedOptions([])) and never resets nullOptionSelected. The "Clear All" button is shown whenever selectedOptions.length > 1, independent of the null-option checkbox. So if a user has checked the "No " option plus two or more regular options and then clicks "Clear All", the null option stays checked and is still emitted by handleApply (values = [{ key: NULL_OPTION_KEY, ... }]). The user reasonably expects "Clear All" to clear everything, including the null row. Consider also resetting the null option in handleClear.

🤖 Prompt for agents
Code Review: Adds interactive `QuickFilterDropdown` to the Add Assets drawer, resolving the react-aria inert bug by using top-layer popovers. Ensure the `handleClear` logic and debounced search cleanup are finalized to prevent state persistence issues.

1. 💡 Quality: Drawer filter matrix leaves prior filter applied, weakening combine test
   Files: openmetadata-ui/src/main/resources/ui/playwright/utils/assetDrawerQuickFilter.ts:133-147

   `runDrawerQuickFilterMatrix` runs `assertApplyNarrowsList` (which applies and Applies the Entity Type = `table` filter) and then immediately runs `assertCombineFilters` without ever clearing the Entity Type filter. By the time the combine step runs, the entity-type filter is still active, so the assertion that `ctx.topic` is hidden (line 148-149) is trivially satisfied by the leftover Entity Type = table filter rather than by the newly applied Tier filter — it does not actually prove the Tier filter intersects correctly. Only the tieredTable-visible / untieredTable-hidden pair (both tables) genuinely exercises the Tier filter. Consider clearing filters between steps, or having the combine step assert that removing the entity-type filter and applying only Tier still hides the topic, so the intersection behavior is meaningfully verified.

   Fix (Document/clear filter state between matrix steps so the combine assertions are not masked by a leftover filter.):
   // In assertCombineFilters, drop the trivially-true topic check or first clear
   // the Entity Type filter so the Tier filter is the only thing under test:
   await openQuickFilter(page, tierLabel);
   await popover(page).getByTestId(/tier1-checkbox$/i).click();
   await applyQuickFilter(page);
   
   await scopeDrawerSearch(page, ctx.table.name);
   await expectAssetVisible(page, ctx.table.fqn);
   await scopeDrawerSearch(page, ctx.untieredTable.name);
   await expectAssetHidden(page, ctx.untieredTable.fqn);

2. 💡 Quality: Asset-seeding logic duplicated across three spec/util files
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Domains.spec.ts:264-278, openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataProductAndSubdomains.spec.ts:63-77, openmetadata-ui/src/main/resources/ui/playwright/utils/inputOutputPorts.ts:47-61

   `seedDrawerFilterAssets` was extracted into `inputOutputPorts.ts`, but `Domains.spec.ts` and `DataProductAndSubdomains.spec.ts` re-inline nearly identical seeding code (create tieredTable/plainTable/filterTopic/filterDashboard, patch `Tier.Tier1`, apply `domainPatch`) plus matching inline teardown. The variations are small (Domains seeds assets without domain membership; the helper requires a DataProduct and always patches domain), so the helper isn't directly reusable as written. Consider generalizing the seeding helper (e.g. optional DataProduct, optional domain patch) and reusing it in all three call sites to avoid drift in the test fixtures over time. This is test-only quality cleanup, not a correctness issue.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.13 branch.
Please cherry-pick the changes manually.
You can find more details here.

@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.12.12 branch.
Please cherry-pick the changes manually.
You can find more details here.

pmbrull pushed a commit that referenced this pull request Jun 18, 2026
#29168)

* fix(ui): use Untitled-UI dropdowns for Add Assets drawer quick-filters

The Domains / Data Products "Add Assets" drawer is an Untitled-UI SlideoutMenu
(react-aria Modal/Dialog). Its quick-filter dropdowns used the Ant Design
SearchDropdown, whose popup portals to document.body — outside the dialog
subtree, where react-aria's `inert` attribute makes it non-interactive (clicks
fall through and the popup closes). z-index cannot fix `inert`.

Add a QuickFilterDropdown built on the Untitled-UI PopoverTrigger/Popover
(react-aria) with a search box, a checkbox option list with counts,
single/multi-select, a null-option and Apply/Clear. Its popover renders in the
dialog's top layer and stays interactive without any AntD-over-drawer
workaround. ExploreQuickFilters renders it behind an `untitledDropdown` flag
that only the Add Assets drawer passes (variant === 'drawer'); the Modal
variant, Explore page, Glossary tab and Lineage controls keep the AntD
SearchDropdown unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* test(ui): E2E coverage for Add-Assets drawer quick filters

Add a shared drawer quick-filter behaviour matrix (interactive popover,
search-scoped options, discard-on-close, apply-narrows-list, combined
filters) and run it across the domain, data-product, and input/output
port Add-Assets drawers. Adds reusable helpers in
assetDrawerQuickFilter.ts and inputOutputPorts.ts.

Also bump the wrapped quick-filter row gutter (vertical 0 -> 8) so the
Untitled dropdowns have breathing room when they wrap.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
siddhant1 added a commit that referenced this pull request Jun 19, 2026
QuickFilterDropdown (cherry-picked via #29168) imported
getSelectedOptionLabelString from AdvancedSearchPureUtils, a module that
only exists on main (introduced by the un-backported refactor #28704,
"extract form/search etc pure utils"). On the 1.13 line that split never
happened, so the symbol still lives in AdvancedSearchUtils.

Re-point the import (component + test mock) to AdvancedSearchUtils to fix
the Collate 1.13 build failure:
"Could not resolve ../../utils/AdvancedSearchPureUtils".

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
harshach added a commit that referenced this pull request Jun 20, 2026
…ilter

Reproduced the failing "Add-Assets drawer quick filter - behaviour matrix"
tests (DataProductAndSubdomains, Domains, InputOutputPorts) locally: the
explore-page human-readable entity-type labels (getOptionLabelFormatter, added
for the redesign) leaked into the shared ExploreQuickFilters and therefore into
#29168's Untitled-UI drawer dropdown, which keys its option testids and trigger
text off the raw label. So `table` rendered as `Table`, breaking
`drop-down-menu table-checkbox` and the `toContainText('table')` trigger check.

Scope the human-label formatter to the explore page (untitledDropdown=false);
the drawer (untitledDropdown=true) keeps raw entity-type values, restoring its
pre-redesign behaviour. Explore-page labels are unchanged.

Verified locally against the :8585 sample-data backend: the drawer matrix now
clears the entity-type steps. (The Tier "combine" step fails only on this local
backend, whose search index has 10 stale custom tiers burying tier1 below the
size-limited aggregation; a fresh CI index surfaces tier1, as on main.)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

This branch was previously deployed

1 inactive deployment
test — 1fba8e73 Deployed Jun 18, 2026 by siddhant1 via playwright-ci-postgresql (6, 6) #51872
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants