# Fix git file context menu focus issue \(\#61339\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 948486f8494fefe194561b41a4c02a678bf04c4c

Requested commit: 948486f8494fefe194561b41a4c02a678bf04c4c

Commit: 948486f8494fefe194561b41a4c02a678bf04c4c

Tree: ba3a6125b4d3bb0592d4aed1dad41a675f02ee96

Author: Malin Dhamsara Ruwan Pathirana

Committer: GitHub

## Message

```
Fix git file context menu focus issue (#61339)

## Objective #61331

Ensure the Git panel receives focus when a file context menu is opened.
Previously, focusing the menu immediately could prevent the Git panel
from becoming focused.

## Solution

Defer focusing the context menu’s focus handle until the next window
update cycle. This allows the menu to be established before focus is
applied, preserving expected focus behavior in the Git panel.

## Testing

- Automated tests were not run.
- The change should be manually tested by opening a file context menu
from the Git panel and confirming the Git panel remains focused and
keyboard interaction with the menu works as expected.
- This is a UI focus change and should be verified on supported desktop
platforms.

## 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
- [x] Performance impact has been considered and is acceptable



## Showcase

### Previously


https://github.com/user-attachments/assets/28fb7f9b-3e1f-4939-a8ae-13b33ac0d805

### Now


https://github.com/user-attachments/assets/d85e7459-d260-41bc-955c-37a269be23c1


Release Notes:

- Fixed Git panel focus when opening a file context menu
```

## Parents

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

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