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:
Peter Tripp 2025-07-10 10:35:16 -04:00 committed by GitHub
parent 8bc1396a55
commit c30e28179a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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