editor: Move blame popover from hover_tooltip to editor prepaint (#29320)

WIP!

In light of having more control over blame popover from editor.

This fixes: https://github.com/zed-industries/zed/issues/28645,
https://github.com/zed-industries/zed/issues/26304

- [x] Initial rendering
- [x] Handle smart positioning (edge detection, etc)
- [x] Delayed hovering, release, etc
- [x] Test blame message selection
- [x] Fix tagged issues

Release Notes:

- Git inline blame popover now dismisses when the cursor is moved, the
editor is scrolled, or the command palette is opened.
This commit is contained in:
Smit Barmase 2025-04-25 01:52:24 +05:30 committed by GitHub
parent 87f85f1863
commit d3911e34de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 501 additions and 83 deletions

View file

@ -27,22 +27,18 @@ pub struct CommitDetails {
pub message: Option<ParsedCommitMessage>,
}
struct CommitAvatar<'a> {
pub struct CommitAvatar<'a> {
commit: &'a CommitDetails,
}
impl<'a> CommitAvatar<'a> {
fn new(details: &'a CommitDetails) -> Self {
pub fn new(details: &'a CommitDetails) -> Self {
Self { commit: details }
}
}
impl<'a> CommitAvatar<'a> {
fn render(
&'a self,
window: &mut Window,
cx: &mut Context<CommitTooltip>,
) -> Option<impl IntoElement + use<>> {
pub fn render(&'a self, window: &mut Window, cx: &mut App) -> Option<impl IntoElement + use<>> {
let remote = self
.commit
.message