# agent_ui: Fix message editor not expanding after sending a message \(\#52545\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/bd5aa7753ecf4728e2f9501b49e1574663f5fe84)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: bd5aa7753ecf4728e2f9501b49e1574663f5fe84

Requested commit: bd5aa7753ecf4728e2f9501b49e1574663f5fe84

Commit: bd5aa7753ecf4728e2f9501b49e1574663f5fe84

Tree: 4160c4602aa58f96ec58b42093f6be401575c948

Author: João Soares

Committer: GitHub

## Message

```
agent_ui: Fix message editor not expanding after sending a message (#52545)

Context

Tracks the previous `v2_empty_state` so `set_mode()` only fires on
actual state transitions, not every render frame.

Closes #52424

## Demo
### Before:


https://github.com/user-attachments/assets/76b61861-cebc-44ce-b483-596eeed19bb1

### After:




https://github.com/user-attachments/assets/9da9f3bc-2fc0-4182-8712-4f42d108650b



<!-- Videos/screenshots showing before and after go here -->

## How to review

1. `crates/agent_ui/src/conversation_view/thread_view.rs` — adds a
`was_v2_empty_state` field to gate the `set_mode()` call in
`render_message_editor()` so it only runs on transitions
2. `crates/agent_ui/src/agent_panel.rs` — test verifying that manually
setting the editor to Full mode survives a render cycle without being
reset back to AutoHeight

## Self-review checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed agent chat input box not expanding after sending a message
(#52424)

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
```

## Parents

- [4f9f088fc1f7d81eb65864d6fa02b486b4755352](https://git.cafe/gitcafe/zed/commit/4f9f088fc1f7d81eb65864d6fa02b486b4755352?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/bd5aa7753ecf4728e2f9501b49e1574663f5fe84?format=markdown)
