Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions webview-ui/src/components/chat/ChatRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ interface ChatRowProps {
onFollowUpUnmount?: () => void
isFollowUpAnswered?: boolean
editable?: boolean
onBeginEdit?: (message: ClineMessage) => void
}

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
Expand Down Expand Up @@ -113,6 +114,7 @@ export const ChatRowContent = ({
onBatchFileResponse,
isFollowUpAnswered,
editable,
onBeginEdit,
}: ChatRowContentProps) => {
const { t } = useTranslation()

Expand Down Expand Up @@ -146,13 +148,15 @@ export const ChatRowContent = ({

// Handle edit button click
const handleEditClick = useCallback(() => {
if (onBeginEdit) {
onBeginEdit(message)
return
}
setIsEditing(true)
setEditedContent(message.text || "")
setEditImages(message.images || [])
setEditMode(mode || "code")
// Edit mode is now handled entirely in the frontend
// No need to notify the backend
}, [message.text, message.images, mode])
}, [onBeginEdit, message, mode])

// Handle cancel edit
const handleCancelEdit = useCallback(() => {
Expand Down
Loading
Loading