Skip to content

fix(ui-core): blue chevron on active FilterSelect, align tree items - #33489

Closed
anuj-kumary wants to merge 9 commits into
mainfrom
fix/filter-select-active-icon-color
Closed

anuj-kumary wants to merge 9 commits into
mainfrom
fix/filter-select-active-icon-color

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Screenshot 2026-09-17 at 4 40 40 PM Screenshot 2026-09-17 at 4 40 20 PM Screenshot 2026-09-17 at 4 40 33 PM

Test plan

  • Open FilterSelect "Immediate" story → select items → verify chevron turns blue
  • Open FilterSelect "Bordered" story → select items → verify chevron turns blue
  • Open FilterSelect "Glossary Term Filter" story → select items → verify chevron turns blue
  • [x} Verify expand icon aligns with Select all checkbox
  • Verify footer divider spans full popover width
  • Verify no regressions on unselected state (grey chevron)

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no accepted new correctness or repository-rule findings since the previous review.

Summary

This PR updates FilterSelect and TreeSelect presentation and behavior.

  • Colors selected-state chevrons with the brand token.
  • Aligns tree content and extends TreeSelect with staged commits, custom triggers, controlled open state, search expansion handling, and portaled dropdown placement.
  • Adds a Storybook example for a staged glossary-term editor.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  T[TreeSelect trigger] --> O[Open portaled dropdown]
  O --> S[Search or select nodes]
  S --> M{Commit mode}
  M -->|Immediate| C[Notify onChange]
  M -->|Staged Apply| A[Commit draft and close]
  M -->|Staged Cancel or dismiss| R[Restore committed value]
Loading

Reviews (11) · Last reviewed commit: "Merge branch 'main' into fix/filter-sele..."

@github-actions

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 github-actions Bot added the UI UI specific issues label Sep 17, 2026
@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!

@anuj-kumary anuj-kumary self-assigned this Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit f99bdd197a5b9c316c36db941908e2472ec07c6d in Playwright run 35316164213, attempt 1.

✅ 269 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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) 30m 12s

⏱️ Max setup 3m 27s · max shard execution 14m 52s · max shard-job elapsed before upload 18m 20s · reporting 3s

🌐 160.91 requests/attempt · 1.54 app boots/UI scenario · 46.41% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 46.41% (convergence target: at most 15%).
  • Application boot ratio was 1.54 per UI scenario (416 boots / 271 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 143 0 0 0 0 0
✅ Shard chromium-02 126 0 0 0 0 0

📦 Download artifacts

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

@anuj-kumary
anuj-kumary changed the base branch from main to glossary-tree-select-component September 17, 2026 10:26
@anuj-kumary anuj-kumary added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Sep 17, 2026
Base automatically changed from glossary-tree-select-component to main September 17, 2026 13:43
@anuj-kumary
anuj-kumary force-pushed the fix/filter-select-active-icon-color branch from 93f2857 to 060002d Compare September 17, 2026 16:29
- Turn the dropdown chevron icon blue (text-fg-brand-primary) when there
  are active selections — applies to all FilterSelect trigger variants
  (button, input, chip) and FilterSelect.Tree triggers.
- Remove outer tw:px-3 from TreeSelect popover so the footer divider
  spans full width. Tree list container uses pl-[14px] to align expand
  icons with the Select all checkbox.
- Change TreeSelect inner content gap to gap-3 for near-perfect nested
  checkbox alignment with parent icon.
- Use distinct Glossary/GlossaryTerm icons in the story data.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
anuj-kumary and others added 2 commits September 18, 2026 00:10
…TreeSelect

Adds the pieces an icon-anchored picker needs, all opt-in so existing
callers are unaffected:

- `isOpen` / `onOpenChange` so a consumer can own the dropdown's open state
- `commitMode="staged"` — toggles are buffered and reported once on Apply,
  reusing FilterSelect's Clear all / Cancel / Apply (N) footer, so a
  selection costs one request rather than one per checkbox
- `renderTrigger` to render a consumer-owned trigger (an existing add/edit
  icon, say) in place of the built-in input/button

Three fixes the above surfaced:

- Portal the dropdown through react-aria's Popover rather than positioning
  it absolutely. The trigger routinely sits in a card or drawer that clips
  overflow, which cut the dropdown off.
- Select-all / clear-all now write the local selection instead of relying on
  the parent echoing `value` back — which an uncontrolled consumer never
  does, so those actions silently did nothing there.
- Escape closes the dropdown for every trigger variant, not just the input.

Adds a Widget Edit Popover story showing the card + edit-icon + staged-Apply
pattern the entity-page widgets use.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Only the Cancel button restored the draft to `value`. Clicking away,
pressing Escape, and the `close` callback handed to `renderTrigger` all
just closed the popover, leaving the uncommitted draft in the selection.
The trigger renders from that selection — the button variant's count badge,
the input variant's chips, and `selectedCount` in `renderTrigger` — so a
popover dismissed without Apply kept showing a selection the consumer had
never been told about, until it was reopened and the resync effect ran.

Routes all four paths through one `dismiss` helper that restores the draft
when staged. Immediate mode is unaffected: it has no draft, and its
single-select auto-close stays as it was.

Reported by gitar-bot on #33489, which caught three of the four paths; the
`renderTrigger` `close` callback had the same defect.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
anuj-kumary and others added 2 commits September 18, 2026 08:38
A search returns matches nested under their parents, but every row rendered
collapsed, so the hits were in the tree data and not in the DOM — typing a
term name looked like it matched nothing but the top level.

While a search is active the expanded set is derived from the results, so
every branch is open; clearing the search returns to whatever the user had
expanded manually. Reuses the parent-key walk that the selected-only view
already had, hoisted out of its hook.

The story's mock fetcher ignored `searchTerm` and could not show this, so it
now mirrors the server (`getHierarchy: true`): a search returns each glossary
with its matching terms already nested, grandchildren included.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The search expansion was derived from the results, so it was recomputed on
every render and a row the user collapsed sprang open again immediately.

It is now applied as state, once per result set, with the pre-search
expansion kept aside and restored when the search clears. Collapsing and
re-expanding during a search behave normally, and clearing the search no
longer leaves the search's branches open.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Keying the search expansion on `treeData` meant any update while the search
was active — a lazy child load, a later response — reset the expanded set and
reopened a row the user had deliberately collapsed.

Each parent is now opened once, as it first appears, tracked in a ref. A new
search term starts a fresh result set and opens its branches again.

Reported by greptile on #33489.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The dropdown was pinned to `bottom left`, so react-aria kept it on screen by
shifting it along the cross axis — detaching it from the trigger. Measure the
trigger against the viewport instead: anchor to its left edge while the panel
fits to the right, otherwise mirror to its right edge so it grows leftwards
and stays attached. Re-measured on resize.

Also moves the popover onto `Dropdown.Popover` for the shared raised surface
and tightens the loading / empty-state rows.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@gitar-bot

gitar-bot Bot commented Sep 18, 2026 •

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

🟢 Low risk

Adds controlled open state, staged commit behavior, and custom triggers to TreeSelect, while styling active FilterSelect chevrons blue and aligning tree items. Staged draft dismissal on outside-click and Escape is now addressed. No issues remain for merge.

✅ 2 closed
✅ Edge Case: Staged draft not discarded on outside-click / Escape dismiss

📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/tree-select/tree-select.tsx:437-447 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/tree-select/tree-select.tsx:557-561
In staged mode, handleCancel restores the draft to value via setSelection(toArray(value)), but the two other dismissal paths — the document pointerdown outside-click handler (line 437) and the Escape keydown handlers (lines 444 and 830) — only call setOpen(false)/setShowSelectedOnly(false) without restoring the draft. The doc says "Cancel restores value", yet dismissing via click-away or Escape leaves the uncommitted draft in selectedData. Since renderTrigger receives selectedCount: selectedData.length and the input/button variants render chips/badges from selectedData, a dismissed-without-Apply popover shows the stale draft (differing from the committed value) until it is reopened and the resync effect runs. Have the outside-click and Escape paths restore the draft in staged mode, mirroring handleCancel.

Closed: Quality: New i18n key label.tree-select added but never used

📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/tree-select/tree-select.tsx:539 📄 openmetadata-ui-core-components/src/main/resources/ui/src/locale/languages/en-us.json:39
This PR adds the label.tree-select key to all 20 locale files, but the Tree's accessible name still falls back to the hardcoded English string 'Tree select' (aria-label={label ?? placeholder ?? 'Tree select'}). The translated key is never referenced via t(), so screen-reader users on non-English locales still get an untranslated label, which conflicts with the requirement that accessible names come through i18n. Wire the fallback to the new key. (The label.remove-entity key added in the same commit is likewise unreferenced anywhere in the source.)

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@anuj-kumary
anuj-kumary added this pull request to the merge queue Sep 18, 2026
anuj-kumary added a commit that referenced this pull request Sep 18, 2026
This PR only consumes TreeSelect; the component itself is #33489's to change.
The dropdown width fix it carried will follow separately.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-18T08:33:36Z)

Blocked the queue: playwright-summary

@anuj-kumary

Copy link
Copy Markdown
Member Author

this changes are already added here so closing this - #33565

timothybrush pushed a commit to timothybrush/OpenMetadata that referenced this pull request Sep 19, 2026
…en-metadata#33565)

* fix(ui-core): blue chevron icon on active filter state, align tree items

- Turn the dropdown chevron icon blue (text-fg-brand-primary) when there
  are active selections — applies to all FilterSelect trigger variants
  (button, input, chip) and FilterSelect.Tree triggers.
- Remove outer tw:px-3 from TreeSelect popover so the footer divider
  spans full width. Tree list container uses pl-[14px] to align expand
  icons with the Select all checkbox.
- Change TreeSelect inner content gap to gap-3 for near-perfect nested
  checkbox alignment with parent icon.
- Use distinct Glossary/GlossaryTerm icons in the story data.

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

* feat(ui-core): controlled open, staged commit and custom trigger for TreeSelect

Adds the pieces an icon-anchored picker needs, all opt-in so existing
callers are unaffected:

- `isOpen` / `onOpenChange` so a consumer can own the dropdown's open state
- `commitMode="staged"` — toggles are buffered and reported once on Apply,
  reusing FilterSelect's Clear all / Cancel / Apply (N) footer, so a
  selection costs one request rather than one per checkbox
- `renderTrigger` to render a consumer-owned trigger (an existing add/edit
  icon, say) in place of the built-in input/button

Three fixes the above surfaced:

- Portal the dropdown through react-aria's Popover rather than positioning
  it absolutely. The trigger routinely sits in a card or drawer that clips
  overflow, which cut the dropdown off.
- Select-all / clear-all now write the local selection instead of relying on
  the parent echoing `value` back — which an uncontrolled consumer never
  does, so those actions silently did nothing there.
- Escape closes the dropdown for every trigger variant, not just the input.

Adds a Widget Edit Popover story showing the card + edit-icon + staged-Apply
pattern the entity-page widgets use.

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

* fix(ui-core): discard the staged draft on every non-Apply dismissal

Only the Cancel button restored the draft to `value`. Clicking away,
pressing Escape, and the `close` callback handed to `renderTrigger` all
just closed the popover, leaving the uncommitted draft in the selection.
The trigger renders from that selection — the button variant's count badge,
the input variant's chips, and `selectedCount` in `renderTrigger` — so a
popover dismissed without Apply kept showing a selection the consumer had
never been told about, until it was reopened and the resync effect ran.

Routes all four paths through one `dismiss` helper that restores the draft
when staged. Immediate mode is unaffected: it has no draft, and its
single-select auto-close stays as it was.

Reported by gitar-bot on open-metadata#33489, which caught three of the four paths; the
`renderTrigger` `close` callback had the same defect.

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

* fix(ui-core): reveal search matches by expanding every branch

A search returns matches nested under their parents, but every row rendered
collapsed, so the hits were in the tree data and not in the DOM — typing a
term name looked like it matched nothing but the top level.

While a search is active the expanded set is derived from the results, so
every branch is open; clearing the search returns to whatever the user had
expanded manually. Reuses the parent-key walk that the selected-only view
already had, hoisted out of its hook.

The story's mock fetcher ignored `searchTerm` and could not show this, so it
now mirrors the server (`getHierarchy: true`): a search returns each glossary
with its matching terms already nested, grandchildren included.

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

* fix(ui-core): let a row stay collapsed during an active search

The search expansion was derived from the results, so it was recomputed on
every render and a row the user collapsed sprang open again immediately.

It is now applied as state, once per result set, with the pre-search
expansion kept aside and restored when the search clears. Collapsing and
re-expanding during a search behave normally, and clearing the search no
longer leaves the search's branches open.

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

* fix(ui-core): open each search branch once instead of on every update

Keying the search expansion on `treeData` meant any update while the search
was active — a lazy child load, a later response — reset the expanded set and
reopened a row the user had deliberately collapsed.

Each parent is now opened once, as it first appears, tracked in a ref. A new
search term starts a fresh result set and opens its branches again.

Reported by greptile on open-metadata#33489.

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

* fix(ui-core): flip the tree-select dropdown when it would overflow right

The dropdown was pinned to `bottom left`, so react-aria kept it on screen by
shifting it along the cross axis — detaching it from the trigger. Measure the
trigger against the viewport instead: anchor to its left edge while the panel
fits to the right, otherwise mirror to its right edge so it grows leftwards
and stays attached. Re-measured on resize.

Also moves the popover onto `Dropdown.Popover` for the shared raised surface
and tightens the loading / empty-state rows.

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

* feat(ui): one glossary-term picker, anchored on the add/edit icon

Glossary terms were picked through two unrelated surfaces — an inline Ant
Design select that replaced the widget body, and a `selectable-list` popover
in the Explore panel. Both are replaced by a single `GlossaryTermPicker`
wrapping the core `TreeSelect`: the glossary hierarchy, lazy-loaded terms,
server-side search, and a staged Apply that costs one PATCH per selection
rather than one per checkbox.

- `GlossaryTermTreeSelect` becomes `GlossaryTermPicker` + `useGlossaryTreeData`,
  splitting the data source out of the component. Its props are a `Pick` of
  `TreeSelectProps` plus the `TagLabel` in/out pair, so they cannot drift from
  the core component.
- Glossaries are now checkable and carry an icon; ticking one selects its
  terms without ever being applied as a tag itself. A mutually exclusive
  glossary still gets no control, since exactly one of its terms may be chosen.
- `TagsContainerV2` hangs the picker off the existing add/edit icon (header in
  the new look, inline icon in the legacy layouts) and keeps the body showing
  the terms instead of swapping it for a select. Classification tags are
  untouched.
- `GlossaryTermsSection` — the Explore right panel, column detail panel and
  integration data-assets tab — moves to the same picker, which drops its
  mirrored editing state and the duplicated header markup.

Playwright: the old selectors (`#tagsForm_tags`, `saveAssociatedTag`,
`glossary-term-select-search-bar`, `.selectable-list-item`) no longer exist for
glossary terms, so the flows move onto a shared `glossaryPicker` helper.

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

* chore(playwright): auto-refresh impact-map.generated.json

* revert(ui-core): drop the tree-select changes, they belong to open-metadata#33489

This PR only consumes TreeSelect; the component itself is open-metadata#33489's to change.
The dropdown width fix it carried will follow separately.

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

* fix checkstyle

* fix(playwright): update glossary picker test selectors for new TreeSelect UI

Migrate remaining Playwright tests from old Ant Design glossary selectors
to the new core-components TreeSelect picker introduced in this PR.

- domain.ts: rewrite addTagsAndGlossaryToDomain to use openGlossaryPicker/
  toggleGlossaryTermInPicker/applyGlossaryPicker for glossary terms
- GlossaryMutualExclusivity.spec.ts: replace all .ant-select-tree-checkbox,
  .async-tree-select-list-dropdown, saveAssociatedTag, tag-${fqn} selectors
  with tree-node-${fqn}, data-selected attribute checks, and popover-scoped
  helpers

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

* fix(playwright): escape FQN special chars in selectionControl locator

Use getByTestId().or() instead of a raw CSS [data-testid] selector so
FQNs containing quotes, percent-signs, and dots are properly escaped.

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

* fix(playwright): display:contents popover visibility + dotted FQN search

- glossary.ts: the glossary-terms-popover div has display:contents (no
  bounding box), so toBeVisible() always fails. Wait for the treegrid
  inside it instead.
- domain.ts: pass the full FQN as the search term instead of splitting
  on dots — term names can contain dots, truncating the search value.

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

* fix(playwright): search for parent term in expandToGlossaryTermChildren

The prior glossary-name search filters the tree to only that glossary's
matching children. The parent term (a different name) isn't in those
results, so the { search: false } lookup fails. Always search for the
parent term too — the new TreeSelect search returns the glossary with the
matched term nested including its children.

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

* nit

* fix(playwright): update vice-versa test to use new picker selectors

Replace .async-tree-select-list-dropdown / .async-select-list-dropdown
CSS class selectors with the new data-testid based locators:
- glossary-term-picker-popover + [role="treegrid"] for the glossary picker
- selectable-list for the tag selector

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

* fix(playwright): retry trigger click in openGlossaryPicker for CI

In slower CI environments the first click on the react-aria trigger can
land before the component is fully interactive, so the popover never
opens. Retry the click with force:true after a 10s grace window.

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

* nit

* fix playwright failure

* chore(playwright): auto-refresh impact-map.generated.json

* fix the glossary playwright failure

* fix checkstyle issue

* chore(playwright): auto-refresh impact-map.generated.json

* cleanup

* Addressed bot comments

* chore(playwright): auto-refresh impact-map.generated.json

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants