Preserve agent message editor unsent text (#34150)
Closes https://github.com/zed-industries/zed/issues/33687 Release Notes: - agent: Preserve unsent chat message text when creating a new thread
This commit is contained in:
parent
8bc1396a55
commit
c30e28179a
1 changed files with 4 additions and 7 deletions
|
@ -770,13 +770,10 @@ impl AgentPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_thread(&mut self, action: &NewThread, window: &mut Window, cx: &mut Context<Self>) {
|
fn new_thread(&mut self, action: &NewThread, window: &mut Window, cx: &mut Context<Self>) {
|
||||||
// Preserve chat box text when using creating new thread from summary'
|
// Preserve chat box text when using creating new thread
|
||||||
let preserved_text = if action.from_thread_id.is_some() {
|
let preserved_text = self
|
||||||
self.active_message_editor()
|
.active_message_editor()
|
||||||
.map(|editor| editor.read(cx).get_text(cx).trim().to_string())
|
.map(|editor| editor.read(cx).get_text(cx).trim().to_string());
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
let thread = self
|
let thread = self
|
||||||
.thread_store
|
.thread_store
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue