# assistant: Factor \`RecentBuffersContext\` logic out of \`AssistantPanel\` \(\#11876\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 66e873942dca65f9f44be3c8ffe033eb56f0b7b9

Requested commit: 66e873942dca65f9f44be3c8ffe033eb56f0b7b9

Commit: 66e873942dca65f9f44be3c8ffe033eb56f0b7b9

Tree: 2269d249fa769965893a9f3c329ab2e917d4d862

Author: Marshall Bowers

Committer: GitHub

## Message

```
assistant: Factor `RecentBuffersContext` logic out of `AssistantPanel` (#11876)

This PR factors some more code related to the `RecentBuffersContext` out
of the `AssistantPanel` and into the corresponding module.

We're trying to strike a balance between keeping this code easy to
evolve as we work on the Assistant, while also having some semblance of
separation/structure.

This also adds the missing functionality of updating the remaining token
count when the `CurrentProjectContext` is enabled/disabled.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
```

## Parents

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

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