Fix clicking in to agent message editor and tighten up vertical spacing (#32765)

* Adds `min_lines` to `EditorMode::AutoHeight` and use `min_lines: 4` in
agent message editor. This makes it so that clicks in the blank space
below the first line of the editor also focus it, instead of needing to
click the very first line.

* Removes the div wrapping the editor, as it was only there to set
`min_h_16()`. This also tightens up the min space given to the editor -
before it was not evenly dividing the number of lines.

* Further tightens up vertical spacing by using `gap_1` instead of
`gap_4` between editor and controls below

At 4 line min height (after on the left, before on the right):


![image](https://github.com/user-attachments/assets/e8eefb1b-9ea3-4f98-ad55-25f95760d61f)

At 5 lines, one more than min height (after on the left, before on the
right):


![image](https://github.com/user-attachments/assets/a6ba737c-6a56-4343-a55a-d264f2a06377)

Release Notes:

- Agent: Fixed clicking to focus the message editor to also work for
clicks below the last line.
This commit is contained in:
Michael Sloan 2025-06-15 12:45:44 -06:00 committed by GitHub
parent a994666888
commit 681c88d4e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 73 additions and 46 deletions

View file

@ -90,7 +90,7 @@ impl ChatPanel {
languages.clone(),
user_store.clone(),
None,
cx.new(|cx| Editor::auto_height(4, window, cx)),
cx.new(|cx| Editor::auto_height(1, 4, window, cx)),
window,
cx,
)