From a17cd996a1883c2ef927b0ab5b59f97dd3cf8f52 Mon Sep 17 00:00:00 2001 From: KyleBarton Date: Mon, 22 Dec 2025 10:54:31 -0800 Subject: [PATCH] Cleanup unused breadcrumb logic --- crates/editor/src/editor.rs | 2 - crates/editor/src/items.rs | 4 +- crates/git_ui/src/project_diff.rs | 61 +------------------------------ 3 files changed, 4 insertions(+), 63 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 229477e70016da1e5609d6e75c67a5b431abc623..68be482d0611edaf3401a4da48260396cb03cd20 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1216,7 +1216,6 @@ pub struct Editor { accent_data: Option, fetched_tree_sitter_chunks: HashMap>>, use_base_text_line_numbers: bool, - is_multibuffer_collapsed: bool, } #[derive(Debug, PartialEq)] @@ -2407,7 +2406,6 @@ impl Editor { accent_data: None, fetched_tree_sitter_chunks: HashMap::default(), use_base_text_line_numbers: false, - is_multibuffer_collapsed: false, }; if is_minimap { diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 6176d93a986b35ceae7c767e112286be4e3ed86a..056098de5d5e6adda1e7305f6397a74c4e2f53d7 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -1,7 +1,7 @@ use crate::{ Anchor, Autoscroll, BufferSerialization, Editor, EditorEvent, EditorSettings, ExcerptId, ExcerptRange, FormatTarget, MultiBuffer, MultiBufferSnapshot, NavigationData, - ReportEditorEvent, SearchWithinRange, SelectionEffects, ToPoint as _, ToggleFoldAll, + ReportEditorEvent, SearchWithinRange, SelectionEffects, ToPoint as _, display_map::HighlightKey, editor_settings::SeedQuerySetting, persistence::{DB, SerializedEditor}, @@ -39,7 +39,7 @@ use std::{ }; use text::{BufferId, BufferSnapshot, Selection}; use theme::Theme; -use ui::{IconDecorationKind, Tooltip, prelude::*}; +use ui::{IconDecorationKind, prelude::*}; use util::{ResultExt, TryFutureExt, paths::PathExt}; use workspace::{ CollaboratorId, ItemId, ItemNavHistory, ToolbarItemLocation, ViewId, Workspace, WorkspaceId, diff --git a/crates/git_ui/src/project_diff.rs b/crates/git_ui/src/project_diff.rs index e2063304577bd2ecb34b2d3162fefe997cd9c442..4eadcca61f2df8f50415a2ef479a95e4a553dbb5 100644 --- a/crates/git_ui/src/project_diff.rs +++ b/crates/git_ui/src/project_diff.rs @@ -9,7 +9,7 @@ use buffer_diff::{BufferDiff, DiffHunkSecondaryStatus}; use collections::{HashMap, HashSet}; use editor::{ Addon, Editor, EditorEvent, SelectionEffects, SplittableEditor, - actions::{GoToHunk, GoToPreviousHunk, ToggleFoldAll}, + actions::{GoToHunk, GoToPreviousHunk}, multibuffer_context_lines, scroll::Autoscroll, }; @@ -41,7 +41,7 @@ use util::{ResultExt as _, rel_path::RelPath}; use workspace::{ CloseActiveItem, ItemNavHistory, SerializableItem, ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Workspace, - item::{BreadcrumbText, Item, ItemEvent, ItemHandle, SaveOptions, TabContentParams}, + item::{Item, ItemEvent, ItemHandle, SaveOptions, TabContentParams}, notifications::NotifyTaskExt, searchable::SearchableItemHandle, }; @@ -70,7 +70,6 @@ pub struct ProjectDiff { workspace: WeakEntity, focus_handle: FocusHandle, pending_scroll: Option, - is_collapsed: bool, _task: Task>, _subscription: Subscription, } @@ -330,7 +329,6 @@ impl ProjectDiff { focus_handle, editor, multibuffer, - is_collapsed: false, buffer_diff_subscriptions: Default::default(), pending_scroll: None, _task: task, @@ -912,61 +910,6 @@ impl Item for ProjectDiff { } } - fn breadcrumb_prefix( - &self, - _window: &mut Window, - cx: &mut Context, - ) -> Option { - let is_collapsed = self.is_collapsed; - - let (icon, label, tooltip_label) = if is_collapsed { - ( - IconName::ChevronUpDown, - "Expand All", - "Expand All Search Results", - ) - } else { - ( - IconName::ChevronDownUp, - "Collapse All", - "Collapse All Search Results", - ) - }; - - let focus_handle = self.editor.focus_handle(cx); - - Some( - Button::new("multibuffer-collapse-expand", label) - .icon(icon) - .icon_position(IconPosition::Start) - .icon_size(IconSize::Small) - .tooltip(move |_, cx| { - Tooltip::for_action_in(tooltip_label, &ToggleFoldAll, &focus_handle, cx) - }) - .on_click(cx.listener(|this, _, window, cx| { - this.is_collapsed = !this.is_collapsed; - this.editor.update(cx, |splittable, cx| { - splittable.last_selected_editor().update(cx, |editor, cx| { - editor.toggle_fold_all(&ToggleFoldAll, window, cx); - }) - }) - })) - .into_any_element(), - ) - } - - fn breadcrumb_location(&self, _: &App) -> ToolbarItemLocation { - ToolbarItemLocation::Hidden - } - - fn breadcrumbs(&self, theme: &theme::Theme, cx: &App) -> Option> { - self.editor - .read(cx) - .last_selected_editor() - .read(cx) - .breadcrumbs(theme, cx) - } - fn added_to_workspace( &mut self, workspace: &mut Workspace,