Tbain/253 add tags count#2
Conversation
There was a problem hiding this comment.
Pull request overview
Adds tag usage counts to the Taxonomy tag list table UI by requesting count data from the tags API and rendering it as an additional table column.
Changes:
- Add a new “Usage Count” column to the tag list table and render non-zero counts in a Paragon
<Bubble>. - Update tag list API URL generation to request count fields (
include_counts=true). - Update tag list table mocks to include
usage_countin test responses.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/taxonomy/tree-table/reactTableMeta.d.ts | Adds a global @tanstack/react-table TableMeta module augmentation for table meta helpers. |
| src/taxonomy/tag-list/tagColumns.tsx | Introduces the new “Usage Count” column and bubble-based cell renderer. |
| src/taxonomy/tag-list/messages.ts | Adds i18n message for the new column header. |
| src/taxonomy/tag-list/TagListTable.test.jsx | Updates mocked API payloads to include usage_count values. |
| src/taxonomy/data/api.ts | Appends include_counts=true to tag list URL generation (non-paginated branch). |
Comments suppressed due to low confidence (1)
src/taxonomy/data/api.ts:70
include_countsis only added whenpageIndex === null. If/when the paginated branch is used, usage counts will silently disappear because the query param isn’t included. Consider addinginclude_countsto the paginatedmakeUrlcall as well so both code paths return consistent data.
tagList: (taxonomyId: number, pageIndex: number | null, pageSize: number | null, fullDepthThreshold?: number) => {
if (pageIndex === null) {
return makeUrl(`${taxonomyId}/tags/`, { full_depth_threshold: fullDepthThreshold || 0, include_counts: 'true' });
}
return makeUrl(`${taxonomyId}/tags/`, {
page: (pageIndex ?? 0) + 1,
page_size: pageSize ?? 10,
full_depth_threshold: fullDepthThreshold || 0,
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| depth: number; | ||
| childCount: number; | ||
| descendantCount: number; | ||
| usageCount: number; |
There was a problem hiding this comment.
TagListRowData declares usageCount as required, but the underlying TagData/TagTreeNode types mark usageCount as optional. Since this file casts row.original into TagListRowData, the required type can hide missing data and makes the ?? 0 fallback look redundant. Consider making usageCount optional here (or aligning the types) so the UI fallback is accurately reflected in the type system.
| usageCount: number; | |
| usageCount?: number; |
| const count = asTagListRowData(row).usageCount ?? 0 | ||
| return (count > 0 && <Bubble expandable={true}> | ||
| {count} | ||
| </Bubble>) |
There was a problem hiding this comment.
UsageCountDisplay formatting is inconsistent with the surrounding TypeScript code (indentation and missing semicolons). Please reformat to match the file’s style so linting/formatters don’t produce noisy diffs later.
| const count = asTagListRowData(row).usageCount ?? 0 | |
| return (count > 0 && <Bubble expandable={true}> | |
| {count} | |
| </Bubble>) | |
| const count = asTagListRowData(row).usageCount ?? 0; | |
| return ( | |
| count > 0 && ( | |
| <Bubble expandable> | |
| {count} | |
| </Bubble> | |
| ) | |
| ); |
|
|
||
|
|
There was a problem hiding this comment.
There are a couple of extra blank lines added between the imports and getApiBaseUrl that don’t appear to serve a purpose and may trip linting/style checks. Please remove the unnecessary empty lines.
jesperhodge
left a comment
There was a problem hiding this comment.
Looks great to me! I figured out why the table doesn't show the updated tag count right away, see my comment.
Great work
|
There's 2 problems with commit lint - one going back to my changes, one new. |
jesperhodge
left a comment
There was a problem hiding this comment.
Looks great, please just delete this one file and ping me for the commit history fix, then I'll approve
| @@ -0,0 +1,8 @@ | |||
| import type { RowData } from '@tanstack/react-table'; | |||
There was a problem hiding this comment.
Please just remove the file and push. For some reason my own deletion was not registered in git, apparently.
Co-authored-by: abdullahwaheed <42172960+abdullahwaheed@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2d662a2 to
5aece56
Compare
…os pages Adds new generic components for gating certain features based on acceptance or acknowledgement of user agreements. It adds one alert that can be displayed where a feature (such as uploading) is blocked based on user agreeement, and it adds a wrapper component that disables the components inside it till the agreement has been accepted.
…enedx#2960) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…oad to force data refresh
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…sing include_counts param
…logic on page load to force data refresh
… issues causing UT failiures
…edx#2954) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…oring into tbain/253_add_tags_count # Conflicts: # package-lock.json # package.json # src/taxonomy/data/api.ts # src/taxonomy/data/apiHooks.ts # src/taxonomy/tag-list/TagListTable.test.jsx # src/taxonomy/tag-list/TagListTable.tsx # src/taxonomy/tag-list/tagColumns.tsx
a19347f to
9dabba6
Compare
…openedx#2905) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 6. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5...v6) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: validate authz perms with studio instead of LMS * refactor: remove utils.ts and unused util
Co-authored-by: abdullahwaheed <42172960+abdullahwaheed@users.noreply.github.com>
…openedx#2963) -------- Co-authored-by: Kyle McCormick <me@kyle.app>
Adds the Settings tab to the course info sidebar, which shows links to some course settings pages.
…oring into tbain/253_add_tags_count
Description
This implements openedx/modular-learning#253 , the task to add tag usage counts to the tags table under the taxonomies table. The corresponding backend piece is where the aggregation work is done will be in a seperate PR to openedx-core. There are some UX changes that differ from the figmas; namely the figmas show a Cyan/Teal bubble body with black text. The Paragon element we're using does not support this color per se without having to customize it, so were going ahead with using the standard "primary" variant of the bubble tag to keep with Paragon standards, and also this provides better color contrast in support of visual accessibility.
Supporting information
Github issue with AC: openedx/modular-learning#253
Paragon Bubble Tag element used to implement this feature: https://paragon-openedx.netlify.app/components/bubble
Figma Mockup(s): https://www.figma.com/design/yE6wmSFnokNM4FG1naasly/Content-Tagging-MVP?node-id=40000158-73422&t=mL0Gi7JcDX2CL2NM-0
Testing instructions
Refer to the AC in the Github Issue as well as reference the Figma mockups for look and feel guidance.
Other information
Include anything else that will help reviewers and consumers understand the change.