git_ui: Fix tooltip overlaying context menu in git blame (#42764)

Closes #26949


## Summary

1. Split editor references to avoid borrow conflicts in event handlers
2. Check
[has_mouse_context_menu()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
state directly in tooltip conditional instead of caching stale value
3. Restructured context menu deployment to ensure proper sequencing:
hide popover → build menu → deploy menu → notify for re-render

**Screen recording**



https://github.com/user-attachments/assets/8a00f882-1c54-47b0-9211-4f28f8deb867



Release Notes:

- Fixed an issue where the context menu in the Git Blame view would be
frequently overlapped by the commit information tooltip.

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
This commit is contained in:
Mustaque Ahmed
2025-12-08 14:32:06 +01:00
committed by GitHub
co-authored by Finn Evers
parent 9e0a4c2a9c
commit 00e6cbc4fc
2 changed files with 22 additions and 11 deletions
+5 -1
View File
@@ -6920,7 +6920,11 @@ impl Editor {
}
}
fn hide_blame_popover(&mut self, ignore_timeout: bool, cx: &mut Context<Self>) -> bool {
pub fn has_mouse_context_menu(&self) -> bool {
self.mouse_context_menu.is_some()
}
pub fn hide_blame_popover(&mut self, ignore_timeout: bool, cx: &mut Context<Self>) -> bool {
self.inline_blame_popover_show_task.take();
if let Some(state) = &mut self.inline_blame_popover {
let hide_task = cx.spawn(async move |editor, cx| {