# Fix “Open file in project" option in the right-click menu not working \(\#60807\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 08359123ac72a8e5b2dde63d81e5a453c47703ce

Requested commit: 08359123ac72a8e5b2dde63d81e5a453c47703ce

Commit: 08359123ac72a8e5b2dde63d81e5a453c47703ce

Tree: daca1342ca6d2844a52d3e8e3a6b88593bcf2aba

Author: Yifeng Xu

Committer: GitHub

## Message

```
Fix “Open file in project" option in the right-click menu not working (#60807)

# Objective

Fix file header context menu actions in multi-file Git history diffs.
Previously, `Open File in Project` worked for the first file but did
nothing for subsequent files.

Fixes #60790

## Solution

Include the buffer ID in each file header context menu's GPUI element
ID. This prevents multiple file headers in split diff views from sharing
the same menu state.

## Testing

- Ran `cargo check -p editor --lib`.
- Ran `cargo fmt --package editor -- --check`.
- Reviewers can test by opening a multi-file commit from Git Panel →
History in split diff mode, then using `Open File in Project` on the
second and subsequent file headers.


https://github.com/user-attachments/assets/46fa4e15-60ac-4ae3-9a73-a89c7f107cb0

## 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

---

Release Notes:

- Fixed opening project files from context menus in multi-file Git
history diffs.

Co-authored-by: peakxy <2465549609@qq.com>
```

## Parents

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

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