diff --git a/src/components/organisms/RightSidePanel.tsx b/src/components/organisms/RightSidePanel.tsx index 44bad7a3..daf11f3f 100644 --- a/src/components/organisms/RightSidePanel.tsx +++ b/src/components/organisms/RightSidePanel.tsx @@ -40,8 +40,14 @@ export const RightSidePanel: React.FC = ({ onFinishCapture const { browserSteps, updateBrowserTextStepLabel, deleteBrowserStep, addScreenshotStep, updateListTextFieldLabel } = useBrowserSteps(); const { socket } = useSocketStore(); - const handleTextLabelChange = (id: number, label: string) => { - setTextLabels(prevLabels => ({ ...prevLabels, [id]: label })); + const handleTextLabelChange = (id: number, label: string, listId?: number, fieldKey?: string) => { + if (listId !== undefined && fieldKey !== undefined) { + // This is a text field within a list step + updateListTextFieldLabel(listId, fieldKey, label); + } else { + // This is a standalone text step + setTextLabels(prevLabels => ({ ...prevLabels, [id]: label })); + } if (!label.trim()) { setErrors(prevErrors => ({ ...prevErrors, [id]: 'Label cannot be empty' })); } else {