diff --git a/crates/ui/src/components/ai/thread_item.rs b/crates/ui/src/components/ai/thread_item.rs index 9d34f8a09593623923e6497dcd7c92ba0d1354ef..7aa5c682256d906d9c2b1f3125fd7e1500999306 100644 --- a/crates/ui/src/components/ai/thread_item.rs +++ b/crates/ui/src/components/ai/thread_item.rs @@ -361,50 +361,14 @@ impl RenderOnce for ThreadItem { let has_timestamp = !self.timestamp.is_empty(); let timestamp = self.timestamp; - let visible_worktree_count = self - .worktrees - .iter() - .filter(|wt| !(wt.kind == WorktreeKind::Main && wt.branch_name.is_none())) - .count(); - let mut worktree_labels: Vec = Vec::new(); let slash_color = Color::Custom(cx.theme().colors().text_muted.opacity(0.4)); for wt in self.worktrees { - match (wt.kind, wt.branch_name) { - (WorktreeKind::Main, None) => continue, - (WorktreeKind::Main, Some(branch)) => { - let chip_index = worktree_labels.len(); - - worktree_labels.push( - h_flex() - .id(format!("{}-worktree-{chip_index}", self.id.clone())) - .min_w_0() - .when(visible_worktree_count > 1, |this| { - this.child( - Label::new(wt.name) - .size(LabelSize::Small) - .color(Color::Muted) - .truncate(), - ) - .child( - Label::new("/") - .size(LabelSize::Small) - .color(slash_color) - .flex_shrink_0(), - ) - }) - .child( - Label::new(branch) - .size(LabelSize::Small) - .color(Color::Muted) - .truncate(), - ) - .into_any_element(), - ); - } - (WorktreeKind::Linked, branch) => { + match wt.kind { + WorktreeKind::Main => continue, + WorktreeKind::Linked => { let chip_index = worktree_labels.len(); let label = if wt.highlight_positions.is_empty() { @@ -432,7 +396,7 @@ impl RenderOnce for ThreadItem { .color(Color::Muted), ) .child(label) - .when_some(branch, |this, branch| { + .when_some(wt.branch_name, |this, branch| { this.child( Label::new("/") .size(LabelSize::Small) @@ -861,7 +825,7 @@ impl Component for ThreadItem { .into_any_element(), ), single_example( - "Main Branch + Changes + Timestamp", + "Main Worktree (hidden) + Changes + Timestamp", container() .child( ThreadItem::new("ti-5e", "Main worktree branch with diff stats") diff --git a/crates/zed/src/visual_test_runner.rs b/crates/zed/src/visual_test_runner.rs index ec93fe636620da65c42e637f3760c7779f1a045a..d4c0d29ade5c4bd6496509675f9ccb3fc188eb8f 100644 --- a/crates/zed/src/visual_test_runner.rs +++ b/crates/zed/src/visual_test_runner.rs @@ -2939,9 +2939,7 @@ impl gpui::Render for ThreadItemBranchNameTestView { }]), ), ) - .child(section_label( - "Main worktree with branch (branch only, no icon)", - )) + .child(section_label("Main worktree with branch (nothing shown)")) .child( container().child( ThreadItem::new("ti-main-branch", "Request for Long Classic Poem") @@ -3043,7 +3041,9 @@ impl gpui::Render for ThreadItemBranchNameTestView { }]), ), ) - .child(section_label("Main branch + diff stats + timestamp")) + .child(section_label( + "Main worktree with branch + diff stats + timestamp (branch hidden)", + )) .child( container().child( ThreadItem::new("ti-main-full", "Main worktree with everything")