From 769666abb237375bc03541ee0d785269f429aae4 Mon Sep 17 00:00:00 2001 From: Mminamiyama Date: Wed, 9 Jul 2025 18:46:10 +0800 Subject: [PATCH] feat(question-classifier): add drag handle styling and props - 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 --- .../question-classifier/components/class-item.tsx | 6 ++++++ .../question-classifier/components/class-list.tsx | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/question-classifier/components/class-item.tsx b/web/app/components/workflow/nodes/question-classifier/components/class-item.tsx index be4a6cb901..478ac925d6 100644 --- a/web/app/components/workflow/nodes/question-classifier/components/class-item.tsx +++ b/web/app/components/workflow/nodes/question-classifier/components/class-item.tsx @@ -11,6 +11,8 @@ import { uniqueId } from 'lodash-es' const i18nPrefix = 'workflow.nodes.questionClassifiers' type Props = { + className?: string + headerClassName?: string nodeId: string payload: Topic onChange: (payload: Topic) => void @@ -21,6 +23,8 @@ type Props = { } const ClassItem: FC = ({ + className, + headerClassName, nodeId, payload, onChange, @@ -49,6 +53,8 @@ const ClassItem: FC = ({ return ( = ({ > { list.map((item, index) => { + const canDrag = (() => { + if (readonly) + return false + + if (topicCount < 2) + return false + + return true + })() return (
-