Jhodge/create tags#1
Closed
jesperhodge wants to merge 98 commits into
Closed
Conversation
Author
|
@mgwozdz-unicon I fixed the tests. They still need refactoring, they are messy; but that should not block this from going into QA. |
There was a problem hiding this comment.
Pull request overview
This PR replaces the legacy Paragon DataTable-based taxonomy tag list with a custom TanStack react-table “tree table” to support expanding rows and creating tags/subtags with an in-place “preview” update mode.
Changes:
- Introduces a new
src/taxonomy/tree-table/component set (TableView, body/row rendering, editable/create row UX). - Rebuilds tag list UI around a
TagTreeutility + new table columns/actions to create tags/subtags and preview changes without refetching. - Updates taxonomy tag list API usage (adds
full_depth_threshold) and adds a create-tag mutation hook.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/taxonomy/tree-table/types.ts | Adds shared table/type definitions for tree rows, columns, and UI state. |
| src/taxonomy/tree-table/messages.ts | Adds i18n messages for the new tree table UI. |
| src/taxonomy/tree-table/index.ts | Exports new tree-table components. |
| src/taxonomy/tree-table/TableView.tsx | Implements the table shell (headers, expand all, pagination, toast, error banner). |
| src/taxonomy/tree-table/TableView.scss | Adds layout/indent helpers for nested rows. |
| src/taxonomy/tree-table/TableBody.tsx | Renders root rows, loading/empty states, and delegates nested rendering. |
| src/taxonomy/tree-table/NestedRows.tsx | Recursively renders expanded child rows and inline “create subtag” row. |
| src/taxonomy/tree-table/EditableCell.tsx | Adds an inline editable input with validation display. |
| src/taxonomy/tree-table/CreateRow.tsx | Adds the inline “create row” UX (input + cancel/save + spinner). |
| src/taxonomy/taxonomy-detail/TaxonomyDetailPage.jsx | Passes maxDepth into the tag list table. |
| src/taxonomy/tag-list/tagTreeError.ts | Adds a custom error type for tag tree integrity errors. |
| src/taxonomy/tag-list/tagTree.ts | Implements a tree builder/editor to support preview-mode updates. |
| src/taxonomy/tag-list/tagTree.test.ts | Adds unit tests for TagTree behavior and integrity validation. |
| src/taxonomy/tag-list/tagColumns.tsx | Defines table columns including action menus for creating tags/subtags. |
| src/taxonomy/tag-list/mockData.ts | Adds large mock datasets for TagTree tests. |
| src/taxonomy/tag-list/messages.ts | Adds messages for creation success/error, validation, and expand labels. |
| src/taxonomy/tag-list/hooks.ts | Introduces table mode state machine + create/update actions wiring. |
| src/taxonomy/tag-list/constants.ts | Adds table mode constants and tag name validation regex. |
| src/taxonomy/tag-list/TagListTable.tsx | New TanStack-based TagListTable implementation integrating API/hooks/table. |
| src/taxonomy/tag-list/TagListTable.test.jsx | Updates and greatly expands UI tests for the new table behaviors. |
| src/taxonomy/tag-list/TagListTable.scss | Updates styling (e.g., alternating row background). |
| src/taxonomy/tag-list/TagListTable.jsx | Removes the old Paragon DataTable implementation. |
| src/taxonomy/tag-list/OptionalExpandLink.tsx | New expand/collapse control matching TanStack row expansion. |
| src/taxonomy/data/types.ts | Extends query options with an enabled flag for conditional fetching. |
| src/taxonomy/data/apiHooks.ts | Updates tag list query (depth param + enabled) and adds create-tag mutation hook. |
| src/taxonomy/data/api.ts | Extends tag list URL builder (full depth threshold) and adds create-tag URL. |
| package.json | Adds @tanstack/react-table dependency. |
| package-lock.json | Locks new TanStack table dependencies. |
💡 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.
| When the tag name field only contains whitespace | ||
| Then the “Save” button is disabled | ||
| */ | ||
| it.skip('should disable the Save button when the input only contains whitespace', async () => { |
Collaborator
There was a problem hiding this comment.
Why is this one skipped?
538d02e to
f193edb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This implements openedx/modular-learning#132, but excludes some of the ACs. Please refer to the following list to test the parts that have been implemented but don't expect the parts that are listed as not yet implemented - they will be done as a followup subtask or later.
Note that the table has been entirely re-created and doesn't use the Paragon table anymore, so the basic table functionality must work really well and needs to meet accessibility standards. However, I'm working on accessibility now, don't expect anything until this PR is out of draft.
Notes about early review and draft stage
Implemented
Not implemented - will not be part of this PR (some of this I'll do as a quick follow PR or subtask)
Supporting information
Ticket: openedx/modular-learning#132 including ACs
Figma: https://www.figma.com/design/yE6wmSFnokNM4FG1naasly/Content-Tagging-MVP?node-id=1221-84140&t=iIWCk9vLq0IcXmAk-0
Testing instructions
Other information
Include anything else that will help reviewers and consumers understand the change.