acp thread view: Floating editing message controls (#36283)

Prevents layout shift when focusing the editor

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
Agus Zubiaga 2025-08-18 09:50:29 -03:00 committed by GitHub
parent 58f7006898
commit e2db434920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 105 additions and 136 deletions

View file

@ -71,6 +71,7 @@ impl MessageEditor {
project: Entity<Project>,
thread_store: Entity<ThreadStore>,
text_thread_store: Entity<TextThreadStore>,
placeholder: impl Into<Arc<str>>,
mode: EditorMode,
window: &mut Window,
cx: &mut Context<Self>,
@ -94,7 +95,7 @@ impl MessageEditor {
let buffer = cx.new(|cx| MultiBuffer::singleton(buffer, cx));
let mut editor = Editor::new(mode, buffer, None, window, cx);
editor.set_placeholder_text("Message the agent @ to include files", cx);
editor.set_placeholder_text(placeholder, cx);
editor.set_show_indent_guides(false, cx);
editor.set_soft_wrap();
editor.set_use_modal_editing(true);
@ -1276,6 +1277,7 @@ mod tests {
project.clone(),
thread_store.clone(),
text_thread_store.clone(),
"Test",
EditorMode::AutoHeight {
min_lines: 1,
max_lines: None,
@ -1473,6 +1475,7 @@ mod tests {
project.clone(),
thread_store.clone(),
text_thread_store.clone(),
"Test",
EditorMode::AutoHeight {
max_lines: None,
min_lines: 1,