From abbafd56ef2d102e04eb994efdf5e10f32ca7cec Mon Sep 17 00:00:00 2001 From: twwu Date: Mon, 24 Mar 2025 18:31:21 +0800 Subject: [PATCH] chore: reorder class names for consistency and improved readability in various components --- .../base/segmented-control/index.tsx | 6 +++--- .../nodes/_base/components/collapse/index.tsx | 8 ++++---- .../nodes/_base/components/output-vars.tsx | 4 ++-- .../object-child-tree-panel/picker/field.tsx | 10 +++++----- .../object-child-tree-panel/picker/index.tsx | 8 ++++---- .../object-child-tree-panel/show/field.tsx | 12 +++++------ .../variable/var-reference-vars.tsx | 8 ++++---- .../json-schema-config-modal/code-editor.tsx | 12 +++++------ .../error-message.tsx | 4 ++-- .../json-schema-config-modal/index.tsx | 2 +- .../json-importer.tsx | 12 +++++------ .../json-schema-config.tsx | 20 +++++++++---------- .../generated-result.tsx | 16 +++++++-------- .../json-schema-generator/index.tsx | 2 +- .../json-schema-generator/prompt-editor.tsx | 20 +++++++++---------- .../visual-editor/add-field.tsx | 4 ++-- .../visual-editor/card.tsx | 8 ++++---- .../visual-editor/edit-card/actions.tsx | 12 +++++------ .../edit-card/advanced-actions.tsx | 2 +- .../edit-card/advanced-options.tsx | 16 +++++++-------- .../edit-card/required-switch.tsx | 4 ++-- .../visual-editor/edit-card/type-selector.tsx | 14 ++++++------- .../visual-editor/index.tsx | 2 +- .../visual-editor/schema-node.tsx | 4 ++-- .../nodes/llm/components/structure-output.tsx | 8 ++++---- .../components/workflow/nodes/llm/panel.tsx | 6 +++--- web/app/dev-preview/page.tsx | 4 ++-- 27 files changed, 114 insertions(+), 114 deletions(-) diff --git a/web/app/components/base/segmented-control/index.tsx b/web/app/components/base/segmented-control/index.tsx index e3e0f7f6ca..bd921e4243 100644 --- a/web/app/components/base/segmented-control/index.tsx +++ b/web/app/components/base/segmented-control/index.tsx @@ -41,7 +41,7 @@ export const SegmentedControl = ({ )} onClick={() => onChange(option.value)} > - + ({ {option.text} {!isLast && !isSelected && !isNextSelected && ( -
- +
+
)} diff --git a/web/app/components/workflow/nodes/_base/components/collapse/index.tsx b/web/app/components/workflow/nodes/_base/components/collapse/index.tsx index ac99bb9750..1c21e37c5e 100644 --- a/web/app/components/workflow/nodes/_base/components/collapse/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/collapse/index.tsx @@ -27,7 +27,7 @@ const Collapse = ({ return ( <> -
+
{ @@ -37,13 +37,13 @@ const Collapse = ({ } }} > -
+
{ !disabled && ( ) diff --git a/web/app/components/workflow/nodes/_base/components/output-vars.tsx b/web/app/components/workflow/nodes/_base/components/output-vars.tsx index 91c07c52db..cc9cebb080 100644 --- a/web/app/components/workflow/nodes/_base/components/output-vars.tsx +++ b/web/app/components/workflow/nodes/_base/components/output-vars.tsx @@ -46,9 +46,9 @@ export const VarItem: FC = ({ return (
-
+
{name}
-
{type}
+
{type}
diff --git a/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/field.tsx b/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/field.tsx index b01badca57..f90f30e7ce 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/field.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/field.tsx @@ -40,18 +40,18 @@ const Field: FC = ({
!readonly && onSelect?.([...valueSelector, name])} > -
+
{depth === MAX_DEPTH + 1 ? ( - - ) : (
{name}
)} + + ) : (
{name}
)}
{depth < MAX_DEPTH + 1 && ( -
{getFieldType(payload)}
+
{getFieldType(payload)}
)}
diff --git a/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/index.tsx b/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/index.tsx index 305d29aeea..302ed3ca75 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/picker/index.tsx @@ -42,18 +42,18 @@ export const PickerPanelMain: FC = ({ return (
{/* Root info */} -
+
{root.nodeName && ( <> -
{root.nodeName}
+
{root.nodeName}
.
)}
{root.attrName}
{/* It must be object */} -
object
+
object
{fieldNames.map(name => ( = ({ ...props }) => { return ( -
+
) diff --git a/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show/field.tsx b/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show/field.tsx index 9915f8248e..f886c1b776 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show/field.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/object-child-tree-panel/show/field.tsx @@ -33,20 +33,20 @@ const Field: FC = ({
-
+
{hasChildren && ( )} -
{name}
-
{getFieldType(payload)}
- {required &&
{t('app.structOutput.required')}
} +
{name}
+
{getFieldType(payload)}
+ {required &&
{t('app.structOutput.required')}
}
{payload.description && (
-
{payload.description}
+
{payload.description}
)}
diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx index 21dead08c0..9f0eb16446 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx @@ -136,7 +136,7 @@ const Item: FC = ({ className={cn( (isObj || isStructureOutput) ? ' pr-1' : 'pr-[18px]', isHovering && ((isObj || isStructureOutput) ? 'bg-primary-50' : 'bg-state-base-hover'), - 'relative w-full flex items-center h-6 pl-3 rounded-md cursor-pointer') + 'relative flex h-6 w-full cursor-pointer items-center rounded-md pl-3') } onClick={handleChosen} onMouseDown={e => e.preventDefault()} @@ -155,10 +155,10 @@ const Item: FC = ({
{itemData.variable.replace('conversation.', '')}
)}
-
{itemData.type}
+
{itemData.type}
{ (isObj || isStructureOutput) && ( - + ) }
@@ -338,7 +338,7 @@ const VarReferenceVars: FC = ({
)) }
- :
{t('workflow.common.noVar')}
} + :
{t('workflow.common.noVar')}
} ) } diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx index 789d75fa3b..d076f05f0a 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx @@ -76,8 +76,8 @@ const CodeEditor: FC = ({ return (
-
-
+
+
JSON
@@ -85,19 +85,19 @@ const CodeEditor: FC = ({ )}
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/error-message.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/error-message.tsx index a51980e20f..2685182f9f 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/error-message.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/error-message.tsx @@ -16,8 +16,8 @@ const ErrorMessage: FC = ({ 'flex gap-x-1 mt-1 p-2 rounded-lg border-[0.5px] border-components-panel-border bg-toast-error-bg', className, )}> - -
+ +
{message}
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/index.tsx index 864aade83f..d34836d5b2 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/index.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/index.tsx @@ -20,7 +20,7 @@ const JsonSchemaConfigModal: FC = ({ = ({ -
+
{/* Title */} -
-
- +
+
+
-
+
{t('workflow.nodes.llm.jsonSchema.import')}
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx index e1ae28e4aa..71cff8fe95 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx @@ -141,14 +141,14 @@ const JsonSchemaConfig: FC = ({ }, [currentTab, jsonSchema, json, onSave, onClose]) return ( -
+
{/* Header */} -
-
+
+
{t('workflow.nodes.llm.jsonSchema.title')}
-
- +
+
{/* Content */} @@ -173,7 +173,7 @@ const JsonSchemaConfig: FC = ({ />
-
+
{currentTab === SchemaView.VisualEditor && ( @@ -194,22 +194,22 @@ const JsonSchemaConfig: FC = ({ {validationError && }
{/* Footer */} -
+
{t('workflow.nodes.llm.jsonSchema.doc')} - +
- +