# Only process a single focus effect per batch · gitcafe/zed

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

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

Visibility: public

Requested revision: 27057fdb1b25af3efd4b5e29d6b168f10a76a82b

Requested commit: 27057fdb1b25af3efd4b5e29d6b168f10a76a82b

Commit: 27057fdb1b25af3efd4b5e29d6b168f10a76a82b

Tree: f8725f16b20df4860769a584b8b9c267dcc799c2

Author: Nathan Sobo

Committer: Nathan Sobo

## Message

```
Only process a single focus effect per batch

This allows us to focus the query editor of the project search when deploying it. Previously, a complex interplay between focus events was preventing this from working in an intuitive way. What happened previously:

- We'd activate the project search, which enqueued a focus effect for the project search view
- We'd focus the query editor, which enqueued an effect
- We'd process the focus effect for the search view, which would enqueue an effect to transfer focus to the results editor
- We'd process the effect to focus the query editor
- We'd process the effect to focus the results editor

Now...

- We activate the project search pane item, enqueuing a focus effect for the project search itself
- We focus the query editor and *remove* the previous pending focus change effect
- We process the focus effect

```

## Parents

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

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