Skip to content

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

Merged
danilo-leal merged 3 commits intozed-industries:mainfrom
Dnreikronos:fix/agent-chat-input-not-expanding
Mar 27, 2026
Merged

agent_ui: Fix message editor not expanding after sending a message#52545
danilo-leal merged 3 commits intozed-industries:mainfrom
Dnreikronos:fix/agent-chat-input-not-expanding

Conversation

@Dnreikronos
Copy link
Copy Markdown
Contributor

Context

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

Closes #52424

Demo

Before:

before_fix_agent.mp4

After:

after_fix_agebt.mp4

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

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 27, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, osyvokon and probably-neb and removed request for a team March 27, 2026 01:23
Copy link
Copy Markdown
Member

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I pushed a couple of commits simplifying this a bit as we could treat this completely out of the render and treat it on a dedicated method called from the constructor and event handlers.

@danilo-leal danilo-leal merged commit bd5aa77 into zed-industries:main Mar 27, 2026
30 checks passed
MrSubidubi added a commit that referenced this pull request Mar 30, 2026
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] 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

Closes #52132.

*This PR previously also fixes the "expanded message editor not taking
up full height" part, but #52545 has already fixed that. Yet it seems to
leave a new issue (that was previously not revealed) behind, as
follows.*

This PR fixes the `Full + ExcludeOverscrollMargin` editor mode (which
the agent panel message editor uses in expanded mode), which could
jitter while typing because render-time layout and scroll-position
updates were clamping against different effective
`scroll_beyond_last_line` policies. This PR fixes that inconsistency so
the expanded editor stays stable while typing, and adds a regression
test covering `ExcludeOverscrollMargin` scroll clamping.


https://github.com/user-attachments/assets/86abf04d-c1a1-419b-96d0-8ca097c0acb0


https://github.com/user-attachments/assets/03dbdc3c-f58e-4378-8c6a-4bda1ae425c8

Release Notes:

- Fixed the expanded Agent Panel message editor so it no longer jitters
while typing.

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
@Prashant-S29
Copy link
Copy Markdown

Referencing this issue #52616

The issue still exists. I am on the latest stable version, and it's still there.

Zed: v0.230.2+stable.212.53a3365bcf6b1aa17389b21456b6010f294f788f (Zed) 
OS: Linux Wayland ubuntu 24.04
Memory: 15 GiB
Architecture: x86_64
GPU: AMD Radeon Graphics (RADV RENOIR) || radv || Mesa 25.2.8-0ubuntu0.24.04.1

@Dnreikronos
Copy link
Copy Markdown
Contributor Author

Referencing this issue #52616

The issue still exists. I am on the latest stable version, and it's still there.

Zed: v0.230.2+stable.212.53a3365bcf6b1aa17389b21456b6010f294f788f (Zed) 
OS: Linux Wayland ubuntu 24.04
Memory: 15 GiB
Architecture: x86_64
GPU: AMD Radeon Graphics (RADV RENOIR) || radv || Mesa 25.2.8-0ubuntu0.24.04.1

The fix landed in main on March 27 but wasn't backported to v0.230.x, so v0.230.2 doesn't include it. Should be in the next release.doesn't include it. Should be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Chat Box doesn't Resize/Expand properly

4 participants