-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: add click-to-edit, ESC-to-cancel, and fix padding consistency for chat messages #7790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1172,9 +1172,10 @@ export const ChatRowContent = ({ | |||||||||||
| ) | ||||||||||||
| case "user_feedback": | ||||||||||||
| return ( | ||||||||||||
| <div className="bg-vscode-editor-background border rounded-xs p-1 overflow-hidden whitespace-pre-wrap"> | ||||||||||||
| <div | ||||||||||||
| className={`bg-vscode-editor-background border rounded-xs overflow-hidden whitespace-pre-wrap ${isEditing ? "p-0" : "p-1"}`}> | ||||||||||||
| {isEditing ? ( | ||||||||||||
| <div className="flex flex-col gap-2 p-2"> | ||||||||||||
| <div className="flex flex-col gap-2"> | ||||||||||||
| <ChatTextArea | ||||||||||||
| inputValue={editedContent} | ||||||||||||
| setInputValue={setEditedContent} | ||||||||||||
|
|
@@ -1195,7 +1196,15 @@ export const ChatRowContent = ({ | |||||||||||
| </div> | ||||||||||||
| ) : ( | ||||||||||||
| <div className="flex justify-between"> | ||||||||||||
| <div className="flex-grow px-2 py-1 wrap-anywhere"> | ||||||||||||
| <div | ||||||||||||
| className="flex-grow px-2 py-1 wrap-anywhere cursor-pointer hover:bg-vscode-list-hoverBackground rounded transition-colors" | ||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding an
Suggested change
|
||||||||||||
| onClick={(e) => { | ||||||||||||
| e.stopPropagation() | ||||||||||||
| if (!isStreaming) { | ||||||||||||
| handleEditClick() | ||||||||||||
| } | ||||||||||||
| }} | ||||||||||||
| title={t("chat:queuedMessages.clickToEdit")}> | ||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reuses the queued messages translation key. Would it be clearer to have a dedicated key like |
||||||||||||
| <Mention text={message.text} withShadow /> | ||||||||||||
| </div> | ||||||||||||
| <div className="flex"> | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clickable message text container now calls handleEditClick correctly. Consider adding accessibility attributes (e.g., role='button' and an appropriate aria-label) to improve keyboard navigation and screen reader support.