Skip to content

agent_ui: Don't reset cursor position when editing queued messages#52210

Merged
danilo-leal merged 2 commits intomainfrom
queue-edit-cursor-position
Mar 23, 2026
Merged

agent_ui: Don't reset cursor position when editing queued messages#52210
danilo-leal merged 2 commits intomainfrom
queue-edit-cursor-position

Conversation

@danilo-leal
Copy link
Copy Markdown
Member

Context

When typing on the read-only queued message editor, we push the content to the main, editable message editor. However, the cursor position was being reset when that happened. This PR fixes that by tracking the cursor offset when doing that, also accounting for the case where there could be pre-existing content in the message editor.

How to Review

  • Queue a message in the agent panel
  • Place your cursor somewhere in the middle of your queued message and type something
  • See how the cursor position is preserved once it goes down to the main message editor

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:

  • Agent: Fix cursor position being reset when editing queued messages.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 23, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Mar 23, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, maxbrunsfeld and rtfeldman and removed request for a team March 23, 2026 13:53
Copy link
Copy Markdown
Collaborator

@maxbrunsfeld maxbrunsfeld left a comment

Choose a reason for hiding this comment

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

This looks good - just left one suggestion.

@danilo-leal danilo-leal merged commit 3225e53 into main Mar 23, 2026
31 checks passed
@danilo-leal danilo-leal deleted the queue-edit-cursor-position branch March 23, 2026 23:12
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 staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants