Skip to content

Commit 08b8365

Browse files
committed
feat: improve edit message overlay positioning and interaction
- Move editing message card to same stacking context as text area - Add Escape key to exit edit mode - Add click-outside functionality to exit edit mode - Ensure edit overlay appears above action buttons and auto-approve checks
1 parent 8fee312 commit 08b8365

File tree

2 files changed

+231
-133
lines changed

2 files changed

+231
-133
lines changed

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ interface ChatRowProps {
6161
onFollowUpUnmount?: () => void
6262
isFollowUpAnswered?: boolean
6363
editable?: boolean
64+
onBeginEdit?: (message: ClineMessage) => void
6465
}
6566

6667
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
@@ -113,6 +114,7 @@ export const ChatRowContent = ({
113114
onBatchFileResponse,
114115
isFollowUpAnswered,
115116
editable,
117+
onBeginEdit,
116118
}: ChatRowContentProps) => {
117119
const { t } = useTranslation()
118120

@@ -146,13 +148,15 @@ export const ChatRowContent = ({
146148

147149
// Handle edit button click
148150
const handleEditClick = useCallback(() => {
151+
if (onBeginEdit) {
152+
onBeginEdit(message)
153+
return
154+
}
149155
setIsEditing(true)
150156
setEditedContent(message.text || "")
151157
setEditImages(message.images || [])
152158
setEditMode(mode || "code")
153-
// Edit mode is now handled entirely in the frontend
154-
// No need to notify the backend
155-
}, [message.text, message.images, mode])
159+
}, [onBeginEdit, message, mode])
156160

157161
// Handle cancel edit
158162
const handleCancelEdit = useCallback(() => {

0 commit comments

Comments
 (0)