# Add \`disable_ai\` check for "Agent Panel" \`MenuItem\` \(\#63580\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c8c07aea5cf82007e524d4fcb31572eb7eeabcd5

Requested commit: c8c07aea5cf82007e524d4fcb31572eb7eeabcd5

Commit: c8c07aea5cf82007e524d4fcb31572eb7eeabcd5

Tree: 94f5a9cadbad8b49e1ef1047c1add777e6667827

Author: shxmbles

Committer: GitHub

## Message

```
Add `disable_ai` check for "Agent Panel" `MenuItem` (#63580)

# Objective

- Removes Agent Panel menu item when AI disabled toggle is on.
- Fixes #63497

## Solution

- Use the global DisableAiSettings - disable_ai check in `app_menus.rs`.
To keep the order the same I
1. Check the disable AI setting
2. If true push to the `view_items` vec![]
3.  Extend the vec![] with the remaining Menu Items and Separators. 

## Testing

This can be tested visually:
 1. Open Zed with AI settings enabled 
 2. Click View when Zed is focused
3. Noting where Agent Panel is on the list and to make sure clicking it
opens up the Agent Panel.
 4. Open settings 
 5. Navigate to AI settings
 6. Toggle disable AI on
 7. Click View 
 
Expected: Agent Panel is gone from the menu. The opposite is also
expected.
 
- This was tested on macOS 26.6.2 (25G83).

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [] Tests cover the new/changed behavior 
To keep this PR simple, I did not add any testing to this, as there were
no tests in this file already.
- [x] Performance impact has been considered and is acceptable

## Showcase
<details>
  <summary>Click to view showcase</summary>




https://github.com/user-attachments/assets/50db44ac-6c11-4101-a064-fd4e3b285620



</details>

---

Release Notes:

- Fixed Agent Panel appearing in the "View" menu when disable AI
settings is on.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
```

## Parents

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

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