@@ -3,10 +3,10 @@ use super::UiEventSender;
33use crate :: persistence:: ChatMetadata ;
44use crate :: ui:: ui_events:: UiEvent ;
55use gpui:: {
6- actions , div, prelude:: * , px, AnyElement , App , AppContext , Context , Div , ElementId , Entity ,
7- FocusHandle , Focusable , MouseButton , MouseUpEvent , SharedString , Styled , Window ,
6+ div, prelude:: * , px, AppContext , Context , Entity , FocusHandle , Focusable , MouseButton ,
7+ MouseUpEvent , SharedString , Styled , Window ,
88} ;
9- use gpui_component:: { popup_menu :: PopupMenuExt , ActiveTheme , Selectable , StyledExt } ;
9+ use gpui_component:: { ActiveTheme , StyledExt } ;
1010use std:: time:: SystemTime ;
1111use tracing:: { debug, trace, warn} ;
1212
@@ -237,73 +237,6 @@ impl Render for ChatListItem {
237237 }
238238}
239239
240- #[ derive( IntoElement ) ]
241- pub struct ItemMenu {
242- pub base : Div ,
243- id : ElementId ,
244- selected : bool ,
245- }
246-
247- impl ItemMenu {
248- pub fn new ( id : impl Into < ElementId > ) -> Self {
249- Self {
250- base : div ( ) . flex_shrink_0 ( ) ,
251- id : id. into ( ) ,
252- selected : false ,
253- }
254- }
255- }
256-
257- impl Selectable for ItemMenu {
258- fn element_id ( & self ) -> & ElementId {
259- & self . id
260- }
261-
262- fn selected ( mut self , selected : bool ) -> Self {
263- self . selected = selected;
264- self
265- }
266-
267- fn is_selected ( & self ) -> bool {
268- self . selected
269- }
270- }
271-
272- impl From < ItemMenu > for AnyElement {
273- fn from ( menu : ItemMenu ) -> Self {
274- menu. into_any_element ( )
275- }
276- }
277-
278- impl Styled for ItemMenu {
279- fn style ( & mut self ) -> & mut gpui:: StyleRefinement {
280- self . base . style ( )
281- }
282- }
283-
284- impl PopupMenuExt for ItemMenu { }
285-
286- impl RenderOnce for ItemMenu {
287- fn render ( self , _: & mut Window , cx : & mut App ) -> impl IntoElement {
288- div ( )
289- . size ( px ( 20. ) )
290- . rounded_sm ( )
291- . flex ( )
292- . items_center ( )
293- . justify_center ( )
294- . cursor_pointer ( )
295- . hover ( |s| s. bg ( cx. theme ( ) . muted . opacity ( 0.8 ) ) )
296- . child ( file_icons:: render_icon (
297- & file_icons:: get ( ) . get_type_icon ( "menu" ) ,
298- 12.0 ,
299- cx. theme ( ) . muted_foreground ,
300- "..." ,
301- ) )
302- }
303- }
304-
305- actions ! ( chat_sidebar, [ Rename , Delete ] ) ;
306-
307240/// Main chat sidebar component
308241pub struct ChatSidebar {
309242 items : Vec < Entity < ChatListItem > > ,
0 commit comments