Skip to content

agent_ui: Add a menu for inserting context#47768

Merged
danilo-leal merged 4 commits intomainfrom
context-menu
Jan 27, 2026
Merged

agent_ui: Add a menu for inserting context#47768
danilo-leal merged 4 commits intomainfrom
context-menu

Conversation

@danilo-leal
Copy link
Member

This PR swaps the @ icon button in the message editor for a + one, which opens a dropdown that displays context options you can add to the agent. Aside from removing one step if you're wanting to add context first with the mouse (in comparison to just inserting @ in the message editor), this menu will also house skills you've created, whenever we get to support to that. It also works to surface images and selections in a bit more visible way as context options. So, effectivelly, this is a bit of foundation work for further features to come. Here's what it looks like:

Screenshot 2026-01-27 at 11  38@2x

Note that all the options you see in the menu should also be available through simply typing @ in the message editor.

Release Notes:

  • Agent: Added a menu for inserting context more easily with the mouse in the agent panel.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 27, 2026
@danilo-leal danilo-leal merged commit 37b8f66 into main Jan 27, 2026
29 checks passed
@danilo-leal danilo-leal deleted the context-menu branch January 27, 2026 18:37
smitbarmase added a commit that referenced this pull request Feb 2, 2026
…racters (#48179)

Closes ZED-4R9

Introduced in #47768

The `insert_context_prefix` function was using byte offsets to check if
the prefix already exists at the cursor. This caused a panic with
multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

- Fixed a crash in the Agent Panel when inserting context mentions with
emojis in the message editor.
github-actions bot pushed a commit that referenced this pull request Feb 2, 2026
…racters (#48179)

Closes ZED-4R9

Introduced in #47768

The `insert_context_prefix` function was using byte offsets to check if
the prefix already exists at the cursor. This caused a panic with
multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

- Fixed a crash in the Agent Panel when inserting context mentions with
emojis in the message editor.
zed-zippy bot added a commit that referenced this pull request Feb 2, 2026
…racters (#48179) (cherry-pick to preview) (#48180)

Cherry-pick of #48179 to preview

----
Closes ZED-4R9

Introduced in #47768

The `insert_context_prefix` function was using byte offsets to check if
the prefix already exists at the cursor. This caused a panic with
multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

- Fixed a crash in the Agent Panel when inserting context mentions with
emojis in the message editor.

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
adb-sh pushed a commit to adb-sh/zed that referenced this pull request Feb 5, 2026
…racters (zed-industries#48179)

Closes ZED-4R9

Introduced in zed-industries#47768

The `insert_context_prefix` function was using byte offsets to check if
the prefix already exists at the cursor. This caused a panic with
multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

- Fixed a crash in the Agent Panel when inserting context mentions with
emojis in the message editor.
yeskunall added a commit that referenced this pull request Feb 9, 2026
With #47768, all image pills automatically got
snapped to the end of the prompt message. This
behavior is unexpected as other pills (`@symbol`,
`@thread` et al) respect the cursor position.
yeskunall added a commit that referenced this pull request Feb 9, 2026
With #47768, all image pills automatically got snapped to the end of the
prompt message. This behavior is unexpected as other pills (`@symbol`,
`@thread` et al) respect the cursor position.

Closes #48731.

- [ ] Tests or screenshots needed?
- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- Insert images at cursor position in the Agent Panel
melocene pushed a commit to melocene/zed that referenced this pull request Feb 16, 2026
With zed-industries#47768, all image pills automatically got snapped to the end of the
prompt message. This behavior is unexpected as other pills (`@symbol`,
`@thread` et al) respect the cursor position.

Closes zed-industries#48731.

- [ ] Tests or screenshots needed?
- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- Insert images at cursor position in the Agent Panel
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.

1 participant