Repository navigation
fix(ui-core): blue chevron on active FilterSelect, align tree items - #33489
anuj-kumary wants to merge 9 commits into
Conversation
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 269 passed · ❌ 0 failed · 🟡 0 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) 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:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
93f2857 to
060002d
Compare
- 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]>
060002d to
5844b38
Compare
…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]>
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]>
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
Closed: Quality: New i18n key label.tree-select added but never used
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
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]>
🚦 Removed from the merge queue —
|
|
this changes are already added here so closing this - #33565 |
…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>
Summary
Test plan
🤖 Generated with Claude Code
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.
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]Reviews (11) · Last reviewed commit: "Merge branch 'main' into fix/filter-sele..."