Skip to content

Chat: Click-to-edit past messages and ESC-to-cancel; match edit padding to queued editor #7788

@hannesrudolph

Description

@hannesrudolph

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)

Proposed Solution

  1. 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.
  1. ESC-to-cancel while editing
  • In ChatTextArea, when isEditMode=true, handle Escape to invoke onCancel. Either:
  1. 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

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.enhancementNew feature or requestproposal

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions