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
71 changes: 32 additions & 39 deletions crates/activity_indicator/src/activity_indicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use editor::Editor;
use extension_host::{ExtensionOperation, ExtensionStore};
use futures::StreamExt;
use gpui::{
App, Context, CursorStyle, Entity, EventEmitter, InteractiveElement as _, ParentElement as _,
Render, SharedString, StatefulInteractiveElement, Styled, Window, actions,
App, Context, Entity, EventEmitter, InteractiveElement as _, ParentElement as _, Render,
SharedString, Styled, Window, actions,
};
use language::{
BinaryStatus, LanguageRegistry, LanguageServerId, LanguageServerName,
Expand All @@ -22,10 +22,7 @@ use std::{
sync::Arc,
time::{Duration, Instant},
};
use ui::{
ButtonLike, CommonAnimationExt, ContextMenu, PopoverMenu, PopoverMenuHandle, Tooltip,
prelude::*,
};
use ui::{CommonAnimationExt, ContextMenu, PopoverMenu, PopoverMenuHandle, Tooltip, prelude::*};
use util::truncate_and_trailoff;
use workspace::{StatusItemView, Workspace, item::ItemHandle};

Expand Down Expand Up @@ -720,43 +717,39 @@ impl Render for ActivityIndicator {
};
let activity_indicator = cx.entity().downgrade();
let truncate_content = content.message.len() > MAX_MESSAGE_LEN;

result.gap_2().child(
PopoverMenu::new("activity-indicator-popover")
.trigger(
ButtonLike::new("activity-indicator-trigger").child(
h_flex()
.id("activity-indicator-status")
.gap_2()
.children(content.icon)
.map(|button| {
if truncate_content {
button
.child(
Label::new(truncate_and_trailoff(
&content.message,
MAX_MESSAGE_LEN,
))
.size(LabelSize::Small),
)
.tooltip(Tooltip::text(content.message))
} else {
button
.child(Label::new(content.message).size(LabelSize::Small))
.when_some(
content.tooltip_message,
|this, tooltip_message| {
this.tooltip(Tooltip::text(tooltip_message))
},
)
}
Button::new("activity-indicator-trigger", {
if truncate_content {
truncate_and_trailoff(&content.message, MAX_MESSAGE_LEN)
} else {
content.message.clone()
}
})
.label_size(LabelSize::Small)
.when(content.icon.is_some(), |this| {
this.start_icon(
Icon::new(IconName::LoadCircle)
.color(Color::Muted)
.size(IconSize::Small),
)
})
.map(|button| {
if truncate_content {
button.tooltip(Tooltip::text(content.message))
} else {
button.when_some(content.tooltip_message, |this, tooltip_message| {
this.tooltip(Tooltip::text(tooltip_message))
})
.when_some(content.on_click, |this, handler| {
this.on_click(cx.listener(move |this, _, window, cx| {
handler(this, window, cx);
}))
.cursor(CursorStyle::PointingHand)
}),
),
}
})
.when_some(content.on_click, |this, handler| {
this.on_click(cx.listener(move |this, _, window, cx| {
handler(this, window, cx);
}))
}),
)
.anchor(gpui::Anchor::BottomLeft)
.menu(move |window, cx| {
Expand Down
6 changes: 6 additions & 0 deletions crates/git_ui/src/conflict_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ fn collect_conflicted_file_paths(project: &Project, cx: &App) -> Vec<String> {
for repo in git_store.repositories().values() {
let snapshot = repo.read(cx).snapshot();
for (repo_path, _) in snapshot.merge.merge_heads_by_conflicted_path.iter() {
let is_currently_conflicted = snapshot
.status_for_path(repo_path)
.is_some_and(|entry| entry.status.is_conflicted());
if !is_currently_conflicted {
continue;
}
if let Some(project_path) = repo.read(cx).repo_path_to_project_path(repo_path, cx) {
paths.push(
project_path
Expand Down
2 changes: 1 addition & 1 deletion crates/zed/src/zed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut App) {
status_bar.add_left_item(lsp_button, window, cx);
status_bar.add_left_item(diagnostic_summary, window, cx);
status_bar.add_left_item(active_file_name, window, cx);
status_bar.add_left_item(activity_indicator, window, cx);
status_bar.add_left_item(merge_conflict_indicator, window, cx);
status_bar.add_left_item(activity_indicator, window, cx);
status_bar.add_right_item(edit_prediction_ui, window, cx);
status_bar.add_right_item(active_buffer_encoding, window, cx);
status_bar.add_right_item(active_buffer_language, window, cx);
Expand Down
Loading