# Dismiss agent panel when \`disable_ai\` is toggled to \`true\` \(\#38461\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 154b01c5fe55192d5f319c1858556f3246f49952

Requested commit: 154b01c5fe55192d5f319c1858556f3246f49952

Commit: 154b01c5fe55192d5f319c1858556f3246f49952

Tree: 96c0abb586f4832255b065381e739f3a7c059b7d

Author: Finn Evers

Committer: GitHub

## Message

```
Dismiss agent panel when `disable_ai` is toggled to `true` (#38461)

Closes https://github.com/zed-industries/zed/issues/38331

This fixes an issue where we would not dismiss the panel once the user
toggled the setting, leaving them in an awkward state where closing the
panel would become hard.

Also takes care of one more check for the `Fix with assistant` action
and consolidates some of the `AgentSettings` and `DisableAiSetting`
checks into one method to make the code more readable.

Release Notes:

- N/A
```

## Parents

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

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