git_graph: Add some design adjustments (#49899)

- Made hover/active styles, as well as clicks, work for the entire row,
capture the graph element, too (needed to make some manual hover and
other states management to pull that off)
- Used the existing `Chip` component for the branch chip instead of a
local recreation
- Adjusted spacing and sizing of commit detail panel, including button
labels truncation and tooltip content
- Added diff stat numbers for the changed files, to match the commit
view
- Standardized the commit avatar component across the git graph, the
commit view, and the file history view
- Added scrollbar to the changed files uniform list
- Removed author name display redundancy (kept only email)
- Made the commit detail UI have a min-width

<img width="750" height="1964" alt="Screenshot 2026-02-23 at 11  31@2x"
src="https://github.com/user-attachments/assets/d1433bd8-5edb-4829-882b-52b1bffbd6db"
/>

--- 

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
This commit is contained in:
Danilo LealandAnthony Eid authored and GitHub committed 2026-02-23 17:07:28 +00:00
1 parent b775e5d63f
commit a3c62de696
10 files changed
+588 -412

No files matched your search

+7 -27
View File
@@ -10,9 +10,9 @@ use git::{
parse_git_remote_url,
};
use gpui::{
AnyElement, App, AppContext as _, AsyncApp, AsyncWindowContext, ClipboardItem, Context,
Element, Entity, EventEmitter, FocusHandle, Focusable, InteractiveElement, IntoElement,
ParentElement, PromptLevel, Render, Styled, Task, WeakEntity, Window, actions,
AnyElement, App, AppContext as _, AsyncApp, AsyncWindowContext, ClipboardItem, Context, Entity,
EventEmitter, FocusHandle, Focusable, InteractiveElement, IntoElement, ParentElement,
PromptLevel, Render, Styled, Task, WeakEntity, Window, actions,
};
use language::{
Anchor, Buffer, Capability, DiskState, File, LanguageRegistry, LineEnding, OffsetRangeExt as _,
@@ -403,33 +403,13 @@ impl CommitView {
window: &mut Window,
cx: &mut App,
) -> AnyElement {
let size = size.into();
let avatar = CommitAvatar::new(
CommitAvatar::new(
sha,
Some(self.commit.author_email.clone()),
self.remote.as_ref(),
);
v_flex()
.w(size)
.h(size)
.border_1()
.border_color(cx.theme().colors().border)
.rounded_full()
.justify_center()
.items_center()
.child(
avatar
.avatar(window, cx)
.map(|a| a.size(size).into_any_element())
.unwrap_or_else(|| {
Icon::new(IconName::Person)
.color(Color::Muted)
.size(IconSize::Medium)
.into_any_element()
}),
)
.into_any()
)
.size(size)
.render(window, cx)
}
fn calculate_changed_lines(&self, cx: &App) -> (u32, u32) {