//! The Repository panel: stashes, remotes, worktrees, more. use ely_gpui_component::{ buttons::{Button, ButtonVariant}, git::{Stash, StashList}, lists::{List, ListItem}, theme::{ActiveTheme as _, ControlSize}, }; use gpui::{ AnyElement, App, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Role, SharedString, StatefulInteractiveElement as _, Styled as _, Window, div, prelude::FluentBuilder as _, }; use crate::{ changes::Changes, hist::when, places::{Place, Read}, structure::{Checkout, LfsFile}, tree::{Tree, text}, }; type Act = Box)>; fn button(tree: &Entity, id: &'static str, words: SharedString, act: Act) -> Button { let this = tree.downgrade(); Button::new(id, words) .size(ControlSize::Sm) .variant(ButtonVariant::Ghost) .on_click(move |_, window, cx| { this.update(cx, |tree, cx| act(tree, window, cx)).ok(); }) } /// A list's name, with its own buttons. fn heading(name: SharedString, buttons: Vec