From fad8515a7aaa09f7e443e41f69dd0bb01fc97e90 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanishkin Date: Thu, 3 Sep 2026 09:47:23 +0000 Subject: [PATCH] git_graph: Show time in commit details (#62679) # Objective The Git Graph list shows the full commit timestamp in its constrained date column, while the more spacious commit details view only shows the calendar date. Include the time in the details view so it does not provide less information than the graph itself. ## Solution Reuse the existing `format_timestamp` helper from the Git Graph `Date` column when rendering the selected commit details. This gives both views the same local date and time format without a separate formatting path. ## Testing - `cargo check -p git_ui` ## 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: - Improved Git Graph commit details to show the same full commit timestamp as the `Date` column. Co-authored-by: Kirill Bulatov --- crates/git_ui/src/git_graph.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/crates/git_ui/src/git_graph.rs b/crates/git_ui/src/git_graph.rs index 68984da791..769752968b 100644 --- a/crates/git_ui/src/git_graph.rs +++ b/crates/git_ui/src/git_graph.rs @@ -2740,18 +2740,7 @@ impl GitGraph { CommitDataState::Loading(_) => ("Loading…".into(), "".into(), None), }; - let date_string = commit_timestamp - .and_then(|ts| OffsetDateTime::from_unix_timestamp(ts).ok()) - .map(|datetime| { - let local_offset = UtcOffset::current_local_offset().unwrap_or(UtcOffset::UTC); - let local_datetime = datetime.to_offset(local_offset); - let format = - time::format_description::parse("[month repr:short] [day], [year]").ok(); - format - .and_then(|f| local_datetime.format(&f).ok()) - .unwrap_or_default() - }) - .unwrap_or_default(); + let date_string = commit_timestamp.map(format_timestamp).unwrap_or_default(); let remote = repository.update(cx, |repo, cx| { let remote_url = repo.default_remote_url()?;