agent: Preserve chat box text on 'New From Summary' (#33220)
CC: @danilo-leal Do you have thoughts on this? I found myself typing chat messages after a long thread and then deciding I would be better served by restarting from a summary -- and then "poof" the contents of my chat box was lost. Release Notes: - agent: "New From Summary" now preserves any unsent content in the chat box.
This commit is contained in:
parent
bd8471bb40
commit
980917bb7c
2 changed files with 28 additions and 0 deletions
|
@ -240,6 +240,21 @@ impl MessageEditor {
|
|||
&self.context_store
|
||||
}
|
||||
|
||||
pub fn get_text(&self, cx: &App) -> String {
|
||||
self.editor.read(cx).text(cx)
|
||||
}
|
||||
|
||||
pub fn set_text(
|
||||
&mut self,
|
||||
text: impl Into<Arc<str>>,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
self.editor.update(cx, |editor, cx| {
|
||||
editor.set_text(text, window, cx);
|
||||
});
|
||||
}
|
||||
|
||||
pub fn expand_message_editor(
|
||||
&mut self,
|
||||
_: &ExpandMessageEditor,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue