Repository navigation
feat(ui): paginate glossary terms with cursor Prev/Next and paged expand-all - #32223
Conversation
|
| Count | Rule |
|---|---|
| 13 | react-hooks/exhaustive-deps |
| 5 | sonarjs/no-duplicate-string |
| 4 | sonarjs/cyclomatic-complexity |
| 3 | openmetadata-imports/no-rest-ui-imports |
| 3 | openmetadata-imports/no-impure-pure-utils |
| 2 | sonarjs/expression-complexity |
| 1 | openmetadata-imports/review-sequential-api-calls |
| 1 | sonarjs/cognitive-complexity |
| 1 | openmetadata-imports/no-internal-barrel-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:161:25 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:162:23 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:186:10 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (4) used in the expression (maximum allowed 3). |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:211:75 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 19 which is greater than 10 authorized.","cost":9,"secondaryLocations":[{"line":211,"column":74,"endLine":211,"endColum |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:313:34 |
react-hooks/exhaustive-deps |
React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:317:9 |
react-hooks/exhaustive-deps |
The 'fetchChildTerms' function makes the dependencies of useCallback Hook (at line 780) change on every render. To fix this, wrap the definition of 'fetchChildT |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:368:9 |
react-hooks/exhaustive-deps |
The 'fetchAllTerms' function makes the dependencies of useCallback Hook (at line 1152) change on every render. To fix this, wrap the definition of 'fetchAllTerm |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:372:6 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 16 which is greater than 10 authorized.","cost":6,"secondaryLocations":[{"line":372,"column":5,"endLine":372,"endColumn |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:436:31 |
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/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:468:9 |
react-hooks/exhaustive-deps |
The 'fetchExpadedTree' function makes the dependencies of useCallback Hook (at line 1152) change on every render. To fix this, wrap the definition of 'fetchExpa |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:602:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'fetchAllTerms', 'handlePagingChange', and 'setGlossaryChildTerms'. Either include them or remove the dependency |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:614:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'setGlossaryChildTerms'. Either include it or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:676:7 |
sonarjs/cognitive-complexity |
Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:676:7 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 12 which is greater than 10 authorized.","cost":2,"secondaryLocations":[{"line":676,"column":6,"endLine":676,"endColumn |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:752:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'setGlossaryChildTerms', 't', and 'updateGlossaryTermStatus'. Either include them or remove the dependency arra |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:792:29 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 14 which is greater than 10 authorized.","cost":4,"secondaryLocations":[{"line":792,"column":28,"endLine":792,"endColum |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1034:31 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 4 times. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1071:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'currentUser', 'onAddGlossaryTerm', 'onEditGlossaryTerm', and 't'. Either include them or remove the dependency arr |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1211:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'handleCheckboxChange' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1305:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'handleEditGlossary', 'handleSearchChange', 'permissions.EditAll', and 't'. Either include them or remove the depen |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1375:11 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (4) used in the expression (maximum allowed 3). |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1380:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has unnecessary dependencies: 'glossaryChildTerms', 'glossaryTerms', and 'setGlossaryChildTerms'. Either exclude them or remove the dependenc |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1453:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has an unnecessary dependency: 'movedGlossaryTerm'. Either exclude it or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx:1666:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'activeGlossary', 'fetchAllTerms', 'handlePagingChange', and 'previousGlossaryFQN'. Either include them or remove |
| 🟡 | src/components/common/RichTextEditor/RichTextEditorPreviewNew.tsx:93:37 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
| 🟡 | src/components/common/RichTextEditor/RichTextEditorPreviewNew.tsx:95:37 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
| 🟡 | src/rest/glossaryAPI.ts:17:1 |
openmetadata-imports/no-rest-ui-imports |
REST clients must not import UI or state-layer modules. Move shared request/response types to the interface layer. |
| 🟡 | src/rest/glossaryAPI.ts:18:1 |
openmetadata-imports/no-rest-ui-imports |
REST clients must not import UI or state-layer modules. Move shared request/response types to the interface layer. |
| 🟡 | src/rest/glossaryAPI.ts:19:1 |
openmetadata-imports/no-rest-ui-imports |
REST clients must not import UI or state-layer modules. Move shared request/response types to the interface layer. |
| 🟡 | src/rest/glossaryAPI.ts:35:1 |
openmetadata-imports/no-internal-barrel-imports |
Import the internal module directly instead of its index barrel so unrelated siblings do not enter the bundle graph. |
| 🟡 | src/utils/GlossaryPureUtils.ts:14:1 |
openmetadata-imports/no-impure-pure-utils |
Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer. |
| 🟡 | src/utils/GlossaryPureUtils.ts:15:1 |
openmetadata-imports/no-impure-pure-utils |
Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer. |
| 🟡 | src/utils/GlossaryPureUtils.ts:16:1 |
openmetadata-imports/no-impure-pure-utils |
Pure utilities must not depend on React, UI, state, hooks, pages, or REST clients. Move orchestration/rendering out or move shared types to a lower layer. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedCo-Authored-By: Claude Opus 4.8 <[email protected]>
Addresses the gitar-bot review finding: a parent with one nested term rendered '1 terms'. Pick label.count-term (singular) vs label.count-term-plural based on the count. Adds count-term across locales. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The large-glossary test asserted infinite-scroll behaviour (scroll to bottom, expect the directChildrenOf+after fetch, then 100 appended rows). Cursor pagination replaced infinite scroll, so that fetch never fires on scroll and the test timed out. Rewrite it to click Next (which triggers the directChildrenOf+after fetch), assert the page is replaced (still 50 rows, Previous now enabled), then Prev back to the first page. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Two defects flagged in review on the paginated glossary terms table: 1. buildTree promoted parentless descendants to roots. Progressive expand-all paginates all levels by name (backend orders by name,id), so a nested term can arrive on an earlier page than its parent term. buildTree then rendered that orphan as a top-level row, corrupting the hierarchy. Hold such orphans back until the page carrying their parent loads, at which point they attach correctly. 2. The Expand/Collapse-All control desynced on partial loads. The action was chosen by an expandedRowKeys === expandableKeys equality that a partially loaded tree never satisfies, and toggleExpandBtn was blindly flipped. So a second click (or one after a manual row collapse) re-ran the expand path, reset the accumulated pages, and hid the only Load More control. Drive the action, label, and icon off the explicit expand-all mode flag instead. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review ✅ Approved 6 resolved / 6 findingsCursor-based pagination replaces infinite scroll in the glossary-term table with paged expand-all loading (50 nested terms per page) and a "Load more" progress bar. Fixed search paging to use offset pagination correctly, eliminated redundant term-count recomputation, addressed grammatical singular/plural term-count labels, corrected tree construction to preserve 3rd-level terms, tightened parent-type validation in orphan hold-back logic, and fixed useCallback dependency list. No issues remain. ✅ 6 resolved✅ Bug: Search paging uses pageSize for offset but fixed limit
✅ Performance: countLoadedNestedTerms recomputed per row on every render
✅ Quality: Plural term counts won't grammatically handle count=1
✅ Bug: buildTree can drop 3rd-level terms when parent has no inline children
✅ Edge Case: Orphan hold-back relies on parent.type being GLOSSARY_TERM
...and 1 more resolved from earlier reviews OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes #29916
Rework the glossary terms table (GlossaryTermTab) off infinite scroll and
add nested-load affordances:
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Greptile Summary
The PR replaces infinite glossary-term scrolling with explicit cursor-based Previous/Next pagination and adds paged Expand All loading.
Confidence Score: 4/5
The PR is not yet safe to merge because changing search or status can leave a stale Expand All cursor that replaces filtered results with unfiltered tree data.
The filter-change path resets only ordinary pagination, while the expand-all mode, cursor, and accumulated terms survive and remain connected to the Load More action.
Files Needing Attention: openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Glossary term table] --> B{View mode} B -->|Normal listing| C[Cursor Previous/Next] B -->|Search| D[Offset pagination] B -->|Expand All| E[Fetch 50 terms] E --> F[Accumulate flat pages] F --> G[Rebuild hierarchy] G -->|Cursor remains| EReviews (10): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile