Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions crates/sidebar/src/sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,8 @@ impl Sidebar {
) -> AnyElement {
let host = key.host();

let has_filter = self.has_filter_query(cx);

let id_prefix = if is_sticky { "sticky-" } else { "" };
let id = SharedString::from(format!("{id_prefix}project-header-{ix}"));
let group_name = SharedString::from(format!("{id_prefix}header-group-{ix}"));
Expand Down Expand Up @@ -2311,16 +2313,18 @@ impl Sidebar {
let group_name_for_gradient = group_name.clone();
let gradient_overlay = move || {
GradientFade::new(base_bg, hover_solid, hover_solid)
.width(px(64.0))
.width(px(92.0))
.right(px(-2.0))
.gradient_stop(0.75)
.group_name(group_name_for_gradient.clone())
.gradient_stop(0.7)
.when(!has_filter, |this| {
this.group_name(group_name_for_gradient.clone())
})
};

let header = h_flex()
.id(id)
.group(&group_name)
.cursor_pointer()
.when(!has_filter, |this| this.cursor_pointer())
.relative()
.h(Tab::content_height(cx))
.w_full()
Expand All @@ -2335,7 +2339,7 @@ impl Sidebar {
this.border_color(gpui::transparent_black())
}
})
.hover(|s| s.bg(hover_solid))
.when(!has_filter, |this| this.hover(|s| s.bg(hover_solid)))
.child(
h_flex()
.relative()
Expand Down Expand Up @@ -2386,15 +2390,17 @@ impl Sidebar {
},
)
})
.child(
div()
.when(!is_focused, |this| this.visible_on_hover(&group_name))
.child(
Icon::new(disclosure_icon)
.size(IconSize::Small)
.color(Color::Muted),
),
),
.when(!has_filter, |this| {
this.child(
div()
.when(!is_focused, |this| this.visible_on_hover(&group_name))
.child(
Icon::new(disclosure_icon)
.size(IconSize::Small)
.color(Color::Muted),
),
)
}),
)
.child(gradient_overlay())
.child(
Expand Down Expand Up @@ -2431,7 +2437,7 @@ impl Sidebar {
cx.listener(move |this, event: &gpui::ClickEvent, window, cx| {
if event.modifiers().secondary() {
this.activate_or_open_workspace_for_group(&key_for_focus, window, cx);
} else {
} else if !this.has_filter_query(cx) {
this.toggle_collapse(&key_for_toggle, window, cx);
}
}),
Expand Down
2 changes: 1 addition & 1 deletion crates/ui/src/components/ai/thread_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl RenderOnce for ThreadItem {
let gradient_overlay = GradientFade::new(base_bg, hover_bg, hover_bg)
.width(px(64.0))
.right(px(-10.0))
.gradient_stop(0.75)
.gradient_stop(0.7)
.group_name("thread-item");

let separator_color = Color::Custom(color.text_muted.opacity(0.4));
Expand Down
Loading