agent: Cancel pending in-edit user message upon new message submit (#29565)
Previously, if you clicked on a user message to edit it, and then, while the user message has the editor pending, sent a new message via the textarea, the whole thread would be grayed out because we hadn't dismissed the to-be-edited pending user message. That's now fixed. Release Notes: - agent: Fixed a bug that would make the whole thread be grayed out upon sending a new message while a user message had a pending edit.
This commit is contained in:
parent
bbc66748dd
commit
bbe8d6a654
4 changed files with 24 additions and 1 deletions
|
@ -1866,6 +1866,14 @@ impl Thread {
|
|||
canceled
|
||||
}
|
||||
|
||||
/// Signals that any in-progress editing should be canceled.
|
||||
///
|
||||
/// This method is used to notify listeners (like ActiveThread) that
|
||||
/// they should cancel any editing operations.
|
||||
pub fn cancel_editing(&mut self, cx: &mut Context<Self>) {
|
||||
cx.emit(ThreadEvent::CancelEditing);
|
||||
}
|
||||
|
||||
pub fn feedback(&self) -> Option<ThreadFeedback> {
|
||||
self.feedback
|
||||
}
|
||||
|
@ -2384,6 +2392,7 @@ pub enum ThreadEvent {
|
|||
},
|
||||
CheckpointChanged,
|
||||
ToolConfirmationNeeded,
|
||||
CancelEditing,
|
||||
}
|
||||
|
||||
impl EventEmitter<ThreadEvent> for Thread {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue