-
Notifications
You must be signed in to change notification settings - Fork 19k
feat(question-classifier): add drag-and-drop sorting for topics list #22066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(question-classifier): add drag-and-drop sorting for topics list #22066
Conversation
- Implement topic sorting functionality using react-sortablejs - Add draggable handle and visual feedback during sorting - Update node internals after sorting to ensure proper rendering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds drag-and-drop sorting for the question-classifier topics list using ReactSortable and ensures the node is re-rendered after reorder.
- Introduce
handleSortTopicinuse-config.tsto update the class list and callupdateNodeInternals. - Pass
handleSortTopicthroughpanel.tsxintoClassList. - Replace static list rendering in
class-list.tsxwithReactSortableand a draggable handle.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web/app/components/workflow/nodes/question-classifier/use-config.ts | Added handleSortTopic callback and useUpdateNodeInternals import to support reordering |
| web/app/components/workflow/nodes/question-classifier/panel.tsx | Passed new handleSortTopic prop to the topics list component |
| web/app/components/workflow/nodes/question-classifier/components/class-list.tsx | Swapped wrapper <div> for ReactSortable, added draggable handle, and related state imports |
Comments suppressed due to low confidence (1)
web/app/components/workflow/nodes/question-classifier/use-config.ts:171
- There are no tests covering the new
handleSortTopiclogic and re-render viaupdateNodeInternals. Consider adding unit or integration tests to verify that sorting updates the inputs and node internals correctly.
const handleSortTopic = useCallback((newTopics: (Topic & { id: string })[]) => {
web/app/components/workflow/nodes/question-classifier/components/class-list.tsx
Show resolved
Hide resolved
web/app/components/workflow/nodes/question-classifier/components/class-list.tsx
Outdated
Show resolved
Hide resolved
- Add className and headerClassName props to ClassItem for better styling control - Conditionally render drag handle based on readonly state and topic count - Update drag handle styling to only show when hovered and draggable
crazywoola
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have restored the UI with removing the extra padding and the handler.
* commit '390e4cc0bf203a979e13694ed99ec9fda6b42cc8': (143 commits) chore(version): bump to 1.6.0 (langgenius#22136) chore: fix schema editor can not hover item (langgenius#22155) fix: add the default value to the dark icon (langgenius#22149) feat: support ping method for MCP server (langgenius#22144) fix: mcp server card button display (langgenius#22141) feat: add support for dark icons in provider and tool entities (langgenius#22081) update worklow events logs. (langgenius#19871) chore: translate i18n files (langgenius#22132) feat: the frontend part of mcp (langgenius#22131) feat: add MCP support (langgenius#20716) Fix: Resolve issue with json_output (langgenius#22053) Chore: rm useless import and vars (langgenius#22108) feat: add redis fallback mechanism langgenius#21043 (langgenius#21044) optimize: batch embedding and qdrant write_consistency_factor parameter (langgenius#21776) chore: Update theme vars (langgenius#22113) feat(question-classifier): add drag-and-drop sorting for topics list (langgenius#22066) test: add comprehensive unit tests for encrypter module (langgenius#22102) fix: allow update plugin install settings (langgenius#22111) fix(Drawer): add overflow hidden to ensure copy button is always clickable (langgenius#21992) (langgenius#22103) Update clean_document_task.py (langgenius#22090) ... # Conflicts: # api/core/helper/code_executor/template_transformer.py # api/pyproject.toml # api/uv.lock
…anggenius#22066) Co-authored-by: crazywoola <[email protected]>
…anggenius#22066) Co-authored-by: crazywoola <[email protected]>
Summary
feat(question-classifier): add drag-and-drop sorting for topics list
fixes #22065
Screenshots
after-.mp4
Update
editor header also can be draggable
after-header-draggable.mp4
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods