# agent_ui: Prevent mode selector tooltip from going off-screen \(\#41589\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ade0f1342cdfa7dd90c57f30286c88b418e370cd

Requested commit: ade0f1342cdfa7dd90c57f30286c88b418e370cd

Commit: ade0f1342cdfa7dd90c57f30286c88b418e370cd

Tree: 32918850dff3a56346b4b3b3918d2f05b38d965e

Author: Dijana Pavlovic

Committer: GitHub

## Message

```
agent_ui: Prevent mode selector tooltip from going off-screen (#41589)

Closes #41458 

Dynamically position mode selector tooltip to prevent clipping.

Position tooltip on the right when panel is docked left, otherwise on
the left. This ensures the tooltip remains visible regardless of panel
position.

**Note:** The tooltip currently vertically aligns with the bottom of the
menu rather than individual items. Would be great if it can be aligned
with the option it explains. But this doesn't seem trivial to me to
implement and not sure if it's important enough atm?

Before: 
<img width="431" height="248" alt="Screenshot 2025-10-30 at 22 21 09"
src="https://github.com/user-attachments/assets/073f5440-b1bf-420b-b12f-558928b627f1"
/>

After:
<img width="632" height="158" alt="Screenshot 2025-10-30 at 17 26 52"
src="https://github.com/user-attachments/assets/e999e390-bf23-435e-9df0-3126dbc14ecb"
/>
<img width="685" height="175" alt="Screenshot 2025-10-30 at 17 27 15"
src="https://github.com/user-attachments/assets/84efca94-7920-474b-bcf8-062c7b59a812"
/>


Release Notes:

- Improved the agent panel's mode selector by preventing it to go
off-screen in case the panel is docked to the left.
```

## Parents

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

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