forked from cline/cline
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.New issue. Needs quick review to confirm validity and assign labels.enhancementNew feature or requestNew feature or requestproposal
Description
Problem Description
- Editing past messages requires clicking the pencil icon; clicking the message text does nothing.
- While editing a past message, pressing ESC does not cancel the edit.
- Edit textarea padding is inconsistent with the queued-message editor.
Who/When/Impact
- Affects all users who frequently tweak past prompts.
- Every time a user wants to quickly edit a previous message, they must aim for the pencil icon and cannot use ESC to cancel.
- Adds friction to a common action and small visual inconsistency.
Current Behavior (verified in code)
- Past message edit is triggered only via handleEditClick(). The message text container renders non-clickable content at ChatRow.tsx.
- During edit, cancel is available only via the cancel button wired to handleCancelEdit(). ESC is not handled by the editor (onKeyDown()); the shared hook is unused (useEscapeKey()).
- Queued messages already support both click-to-edit and ESC cancel: textarea onKeyDown (ESC) and click-to-edit container.
- Padding mismatch: Past edit view wraps the editor in a padded container p-2 wrapper and the textarea adds px-2 plus pr-9 for overlay icons. The queued editor uses px-2, leading to visually different left/right spacing.
Proposed Solution
- Click-to-edit for past messages
- Make the message text area clickable and call handleEditClick() from that container in ChatRow.tsx. Ensure e.stopPropagation() where needed to avoid toggling expanders.
- ESC-to-cancel while editing
- In ChatTextArea, when isEditMode=true, handle Escape to invoke onCancel. Either:
- Use the shared useEscapeKey() scoped to edit mode, or
- Add an ESC branch inside onKeyDown() that calls onCancel().
- Padding parity with queued editor
- Align left/right padding to match the queued editor’s px-2.
- Options:
- Reduce/remove the outer p-2 wrapper during edit, OR
- Keep the send/cancel overlay space but balance left/right by adjusting px-2 and/or pr-9.
Acceptance Criteria
- Given a past user message, when I click anywhere on its text content, then it enters edit mode with the caret at the end and any images preserved.
- Given I am editing a past message, when I press ESC, then the edit cancels and the original content/images/mode are restored without sending.
- Given I am editing a past message, the edit textarea’s left/right padding visually matches the queued-message editor.
- Enter (without Shift) still saves; the pencil and trash buttons still work; queued-message editor behavior remains unchanged.
Additional Context
- Please also match left/right padding of the past-message editor to the queued editor (see provided screenshot in the request).
- Labels requested: proposal, enhancement
Metadata
Metadata
Assignees
Labels
Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.New issue. Needs quick review to confirm validity and assign labels.enhancementNew feature or requestNew feature or requestproposal
Type
Projects
Status
Done