Repository navigation
Consolidate glossary-term selection onto a single GlossaryTermPicker - #33680
Conversation
…icker Nine surfaces still selected glossary terms through the antd TreeAsyncSelectList or a flat core Autocomplete. They now all render the single GlossaryTermPicker, so hierarchy, lazy loading and per-glossary mutual exclusivity behave the same everywhere: - Add/Edit Glossary Term -> Related Terms - Glossary Term -> Related Terms row editor - Change Parent Hierarchy modal - Add Data Quality Test and Workflow Builder set-action (via TagSuggestion) - Knowledge Center Quick Link modal - Column Bulk Operations edit drawer - CSV bulk-edit grid (glossaryTerms and relatedTerms cells) The picker gains what those callers need: excludeFqns (a term cannot relate to or move under itself), selectGlossaries (a glossary root is a valid parent), disabled, and a GlossaryPickerValue payload that extends TagLabel with the entity it came from, which is how Change Parent gets an id and Related Terms drops a lookup. Dead paths removed with their callers: the TagsSelectForm glossary branch, the task-page TagSuggestion tree branch (no caller ever passed isTreeSelect), FieldTypes.TREE_ASYNC_SELECT_LIST and its renderer, and the Related Terms tab's preload fetch. TreeAsyncSelectList now has no importers. TagSuggestion also no longer fires a classification-tag fetch when it is rendering the glossary picker. Playwright follows the widgets: new pickGlossaryTermInField / removeGlossaryTermChip / glossaryFieldTrigger helpers, with DataQuality, Glossary, GlossaryAdvancedOperations, ColumnBulkOperationsTagsGlossary and the glossary/import utils moved onto them. Suppressions pruned (no-positional-locator 1202 -> 1198) and the corpus ratchet updated. Verified: ui-checkstyle:changed and lint:playwright clean, corpus test green, 19 jest suites / 397 tests pass. The Playwright specs are typechecked and linted but have not been executed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Conflict: ColumnGrid.component.tsx imports — this branch swapped TreeAsyncSelectList for GlossaryTermPicker while main moved the drawer import to atoms/drawer/useFormDrawer. Kept both. main's hardened openGlossaryPicker (bounded retry, issue #33640) merged cleanly alongside the field-picker helpers added here. Also drops the antd Form import and unlabelled mock buttons the two new tests introduced: main tightened tw-guard (no new antd imports) and jsx-a11y/control-has-associated-label, both of which now fail on them. The COMPONENT-field test asserts the element tree instead of rendering an antd Form, matching the style of the tests around it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Trim the multi-line comment blocks added by this branch down to a single line each, and collapse the pure re-indentation in useGlossaryTreeData by naming its return type. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…idth The CSV cell editor opens the picker with isOpen, but the input-variant trigger only focuses its search box on click, so nothing focused it and the cell could not be typed into. Forward autoFocus and use it there. The popover width was measured once on open, so the trigger reflowing underneath it — the inline-edit buttons mounting beside it in a grid cell — left the popover wider than its trigger. Observe the trigger instead. Drive the bulk-edit helper through the shared picker helpers so it waits for the popover rather than typing blind against a loose response match. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The popover node is `display: contents`, which has no layout box, so the visibility assertion added for it could never pass. Read the open state off the trigger's `data-treeselect-open` instead, and click the trigger when the editor mounted with the picker shut. Also let searchGlossaryPicker take the trigger, so the input variant is filled by locator rather than by whatever happens to hold focus. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Clicking the input-variant trigger only ever opens it, so a single click settles whichever state the grid left the mounted editor in, without the read-then-click race. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
csvAsyncJobs is scoped per user and every Playwright worker shares the admin identity, so in a full parallel run another worker's job reaching a terminal status re-expands the tray over this grid mid-fill. The existing helper only ran on the startCsvPreviewAndWaitForGrid path, which the bulk edit specs do not use. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
fillGlossaryTermDetails is shared by every bulk-edit entity through fillRowDetails, and clicking the picker trigger unmounted the grid's cell editor — breaking four flows that previously passed. Filling the input by locator is enough: its onFocus opens the tree. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
In a grid cell the picker is the editor, so "editor open, picker closed" is not a reachable-back state: TreeSelect's dismiss sets skipNextFocusOpen, so refocusing the input will not reopen it, and clicking the trigger unmounts the cell editor. Drop the local open state and keep it open for the life of the editor. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
❌ 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 impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
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! |
…tore Escape left skipNextFocusOpen armed indefinitely, so a keyboard user who tabbed away and back found the dropdown would not reopen. Arm it only when a restore is actually coming and drop it on the next frame. Also remove the unused data-treeselect-open attribute.
Code Review ✅ No issues found🟡 Medium risk · Broad glossary-picker migration and shared TreeSelect behavior changes affect many UI surfaces. Consolidates glossary-term selection onto a single 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 |
|
| Count | Rule |
|---|---|
| 27 | react-hooks/exhaustive-deps |
| 16 | openmetadata-imports/no-circular-imports |
| 3 | openmetadata-imports/review-sequential-api-calls |
| 2 | openmetadata-imports/no-lower-layer-page-imports |
| 1 | no-restricted-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/KnowledgeCenter/QuickLinkFormModal/QuickLinkFormModal.tsx:330:24 |
openmetadata-imports/review-sequential-api-calls |
Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent |
| 🟡 | src/components/Modals/ChangeParentHierarchy/ChangeParentHierarchy.component.tsx:135:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:100:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'columnData?.name'. Either include it or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:127:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'updateActiveTagDropdownKey'. Either include it or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:148:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has an unnecessary dependency: 'tags.tagType'. Either exclude it or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:164:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'tagType' and 'tags'. Either include them or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:307:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'sizeCap', 'tagType', and 'tags'. Either include them or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:327:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has an unnecessary dependency: 'getTagPlaceholder'. Either exclude it or remove the dependency array. Outer scope values like 'getTagPlacehol |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:360:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 't', 'tagType', and 'tags'. Either include them or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:374:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:407:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'handleAddClick' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:436:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:455:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'sizeCap', 'tagType', and 'tags'. Either include them or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:497:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'newLook'. Either include it or remove the dependency array. |
| 🟡 | src/components/Tag/TagsContainerV2/TagsContainerV2.tsx:535:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'columnData?.fqn' and 'entityFqn'. Either include them or remove the dependency array. |
| 🟡 | src/components/common/GlossaryTermPicker/useGlossaryTreeData.tsx:96:27 |
openmetadata-imports/review-sequential-api-calls |
Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent |
| 🟡 | src/components/common/GlossaryTermPicker/useGlossaryTreeData.tsx:113:38 |
openmetadata-imports/review-sequential-api-calls |
Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent |
| 🟡 | src/components/common/TagSuggestion/TagSuggestion.tsx:38:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/components/common/TagSuggestion/TagSuggestion.tsx:162:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'initialOptions' and 'isGlossary'. Either include them or remove the dependency array. If 'setOptions' needs the |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:1073:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'buildMultiOccurrenceRows', 'buildSingleOccurrenceRows', 'buildVariationRows', and 'getUniquePaths'. Either inc |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:1261:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'renderCoverageDescriptionCell' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:1529:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'renderGroupColumnNameCell', 'renderOccurrenceColumnNameCell', and 'renderStructChildColumnNameCell'. Either in |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:1601:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'columnGridListing'. Either include it or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:1780:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'buildColumnUpdatesByKey' and 'columnGridListing'. Either include them or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:1934:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'handleBulkUpdateCompleted' and 'handleBulkUpdateFailed'. Either include them or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:2010:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'columnGridListing'. Either include it or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:2132:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'columnGridListing'. Either include it or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:2241:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'columnGridListing'. Either include it or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:2353:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'columnGridListing'. Either include it or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:2386:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'columnGridListing'. Either include it or remove the dependency array. |
| 🟡 | src/pages/ColumnBulkOperations/ColumnGrid/ColumnGrid.component.tsx:2500:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has an unnecessary dependency: 'columnGridListing.allRows'. Either exclude it or remove the dependency array. |
| 🟡 | src/pages/TasksPage/shared/TagSuggestion.tsx:19:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:14:1 |
no-restricted-imports |
'@untitledui/icons' import is restricted from being used by a pattern. Import icons from @openmetadata/ui-core-components/icons, not directly from @untitledui/i |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:52:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:58:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:59:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:61:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:63:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:82:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:82:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/utils/CSV/CSVUtilsClassBase.tsx:100:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:39:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:48:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:53:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:56:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:58:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:60:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:68:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/formUtils.tsx:68:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
|



Describe your changes:
Fixes #
Glossary terms could be picked through several different widgets depending on where you were in the
product — a flat autocomplete in some places, an antd tree select in others, and a couple of
hand-rolled variants. They disagreed on hierarchy, on mutual exclusivity, and on the shape of the
value they produced.
This consolidates all of them onto a single
GlossaryTermPicker, which wraps the coreTreeSelectfrom@openmetadata/ui-core-componentsand speaksTagLabelat its edges.Type of change:
High-level design:
One component, one contract.
GlossaryTermPickeris the only glossary-term surface. It owns thetree fetching (
useGlossaryTreeData), lazy-loads terms per glossary, and preserves mutualexclusivity, which a flat autocomplete cannot express.
Its
onChangereports two things:termsis PATCH-safe —TagLabelisadditionalProperties: falseserver-side, sotoTagLabelstrips the UI-only fields before a selection can reach a request body.
nodeskeeps the sourceentity for the callers that need an id or the glossary/term distinction (related terms resolve ids
from it; the parent picker needs to know a row is a glossary rather than a term).
Two options cover the cases that previously justified a bespoke widget:
excludeFqns— hide a subtree, e.g. the term a relation is being added toselectGlossaries— let a glossary itself be the value, for pickers that choose a parentSurfaces migrated:
TagsContainerV2glossary branch,TagsSelectFormglossary branchcommon/TagSuggestion, Task page glossary-term suggestionFieldTypes.TREE_ASYNC_SELECT_LISTand itsformUtilsrenderer are removed — the form fields thatused it now render the picker directly through
FormField, which also lets antd stop injecting astring value into a component that takes
TagLabel[].Core
TreeSelectchanges (openmetadata-ui-core-components), all driven by this consolidation:--trigger-widthis notpublished for a bare
Popover+triggerRef, so the width is measured and observed)emptyBranchMessagerenders a real message for a glossary with no terms, rather than the generic"no data"
no longer re-opens a dropdown that was just dismissed
Tests:
Use cases covered
exclusive parent
Unit tests
GlossaryTermPicker.test.tsx— value seeding, the two-argumentonChange, dropping glossary rowsfrom a term selection, single-select normalisation, and that picker-only fields never reach the
reported
TagLabelAddGlossaryTermForm,RelatedTerms,TermsRowEditor,ChangeParentHierarchy,TagsSelectForm,TagSuggestion,QuickLinkFormModalandformUtilssuites for the new contractBackend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
parent, and confirmed the PATCH body carries only
TagLabelfieldsthe trigger width and closes with the drawer
UI screen recording / screenshots:
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code
The PR appears safe to merge because no accepted new issue or outstanding unresolved finding remains in the scoring set.
Summary
Consolidates glossary-term selection around
GlossaryTermPickerand extends the coreTreeSelectto support the resulting hierarchy, sizing, empty-branch, and dismissal behavior.TagLabelvalues while retaining source entities for ID-dependent callers.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Glossary APIs] --> B[useGlossaryTreeData] B --> C[GlossaryTermPicker] C --> D[Core TreeSelect] D --> E[Selected tree nodes] E --> F[toTagLabel] F --> G[PATCH-safe TagLabel values] E --> H[Source entities for ID-based callers]Reviews (5) · Last reviewed commit: "Merge branch 'main' into glossary-term-p..."