# Prevent \`toggle_dock\` from opening assistant panel when it is disabled via settings \(\#27215\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ca9fb2399eb4fec9ae85e0f851bef8c711cac2b7

Requested commit: ca9fb2399eb4fec9ae85e0f851bef8c711cac2b7

Commit: ca9fb2399eb4fec9ae85e0f851bef8c711cac2b7

Tree: 8b05df1d583841b0fbf60255543a0f123d6af685

Author: Finn Evers

Committer: GitHub

## Message

```
Prevent `toggle_dock` from opening assistant panel when it is disabled via settings (#27215)

Part of #27171

Follows-up the change in
https://github.com/zed-industries/zed/pull/22346 to consider the case
where the assistant-panel is disabled via settings (as also noted in
[this
comment](https://github.com/zed-industries/zed/pull/22346#issuecomment-2558372412),
Notably, only the explicit case is considered here. Can extend this
change to also cover the implicit case where the button is disabled if
requested.).

Currently, if the user toggles the right dock, the assistant panel will
be shown even if it is disabled via settings, because it has the highest
priority (see
https://github.com/zed-industries/zed/pull/22346#issuecomment-2564890493).
With this change, the assistant panel is no longer activated when
disabled and the dock with the next highest activation order is
activated instead.

I did not opt in to make the priority configurabe, as I agree with
https://github.com/zed-industries/zed/pull/22346#issuecomment-2564890493
that this will most likely rarely be used (the active panel is only none
on the first toggle of the dock, afterwards it remains set for the
remainder of the session).

Release Notes:

- `workspace::ToggleRightDock` will no longer open the assistant panel
when it is disabled via settings.
```

## Parents

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

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