From bfd71db0a375678996c936fdc9482b26e42f7efe Mon Sep 17 00:00:00 2001 From: MrSubidubi Date: Wed, 13 Aug 2025 12:18:47 +0200 Subject: [PATCH] Use new div impl to reduce footprint --- crates/agent_ui/src/acp/thread_view.rs | 60 +++++++++---------- crates/agent_ui/src/active_thread.rs | 1 - .../src/session/running/breakpoint_list.rs | 3 +- .../src/session/running/memory_view.rs | 1 - .../src/session/running/module_list.rs | 1 - .../src/session/running/stack_frame_list.rs | 1 - crates/editor/src/hover_popover.rs | 1 - crates/editor/src/signature_help.rs | 1 - crates/extensions_ui/src/extensions_ui.rs | 24 +++++--- crates/git_ui/src/git_panel.rs | 1 - crates/outline_panel/src/outline_panel.rs | 1 - crates/recent_projects/src/remote_servers.rs | 1 - crates/settings_ui/src/ui_components/table.rs | 1 - 13 files changed, 45 insertions(+), 52 deletions(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 956c961556..e5e5e0b764 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -2633,38 +2633,36 @@ impl Render for AcpThreadView { v_flex().flex_1().map(|this| { if self.list_state.item_count() > 0 { - this.id("acp-thread-list-view") - .child( - list( - self.list_state.clone(), - cx.processor(|this, index: usize, window, cx| { - let Some((entry, len)) = - this.thread().and_then(|thread| { - let entries = &thread.read(cx).entries(); - Some((entries.get(index)?, entries.len())) - }) - else { - return Empty.into_any(); - }; - this.render_entry(index, len, entry, window, cx) - }), - ) - .with_sizing_behavior(gpui::ListSizingBehavior::Auto) - .flex_grow() - .into_any(), + this.child( + list( + self.list_state.clone(), + cx.processor(|this, index: usize, window, cx| { + let Some((entry, len)) = this.thread().and_then(|thread| { + let entries = &thread.read(cx).entries(); + Some((entries.get(index)?, entries.len())) + }) else { + return Empty.into_any(); + }; + this.render_entry(index, len, entry, window, cx) + }), ) - .vertical_scrollbar(window, cx) - .children(match thread_clone.read(cx).status() { - ThreadStatus::Idle - | ThreadStatus::WaitingForToolConfirmation => None, - ThreadStatus::Generating => div() - .px_5() - .py_2() - .child(LoadingLabel::new("").size(LabelSize::Small)) - .into(), - }) - .children(self.render_activity_bar(&thread_clone, window, cx)) - .into_any_element() + .with_sizing_behavior(gpui::ListSizingBehavior::Auto) + .flex_grow() + .into_any(), + ) + .vertical_scrollbar(window, cx) + .children(match thread_clone.read(cx).status() { + ThreadStatus::Idle | ThreadStatus::WaitingForToolConfirmation => { + None + } + ThreadStatus::Generating => div() + .px_5() + .py_2() + .child(LoadingLabel::new("").size(LabelSize::Small)) + .into(), + }) + .children(self.render_activity_bar(&thread_clone, window, cx)) + .into_any_element() } else { this.child(self.render_empty_state(cx)).into_any_element() } diff --git a/crates/agent_ui/src/active_thread.rs b/crates/agent_ui/src/active_thread.rs index eac2c22a24..4cb9f23630 100644 --- a/crates/agent_ui/src/active_thread.rs +++ b/crates/agent_ui/src/active_thread.rs @@ -3529,7 +3529,6 @@ impl EventEmitter for ActiveThread {} impl Render for ActiveThread { fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { v_flex() - .id(("active-thread", cx.entity_id())) .size_full() .relative() .bg(cx.theme().colors().panel_background) diff --git a/crates/debugger_ui/src/session/running/breakpoint_list.rs b/crates/debugger_ui/src/session/running/breakpoint_list.rs index ee120636e4..6eddc6f1cf 100644 --- a/crates/debugger_ui/src/session/running/breakpoint_list.rs +++ b/crates/debugger_ui/src/session/running/breakpoint_list.rs @@ -756,7 +756,7 @@ impl Render for BreakpointList { .chain(exception_breakpoints), ); v_flex() - .id("breakpoint-list-container") + .id("breakpoint-list") .key_context("BreakpointList") .track_focus(&self.focus_handle) .on_action(cx.listener(Self::select_next)) @@ -773,7 +773,6 @@ impl Render for BreakpointList { .m_0p5() .child( v_flex() - .id("breakpoint-list") .size_full() .child(self.render_list(cx)) .vertical_scrollbar_for(self.scroll_handle.clone(), window, cx), diff --git a/crates/debugger_ui/src/session/running/memory_view.rs b/crates/debugger_ui/src/session/running/memory_view.rs index 82fd1899e8..733b7385e5 100644 --- a/crates/debugger_ui/src/session/running/memory_view.rs +++ b/crates/debugger_ui/src/session/running/memory_view.rs @@ -892,7 +892,6 @@ impl Render for MemoryView { .child(Divider::horizontal()) .child( v_flex() - .id("memory-view-scroll-container") .size_full() .on_drag_move(cx.listener(|this, evt, _, _| { this.handle_memory_drag(&evt); diff --git a/crates/debugger_ui/src/session/running/module_list.rs b/crates/debugger_ui/src/session/running/module_list.rs index 39388412f1..c7a8ebbadd 100644 --- a/crates/debugger_ui/src/session/running/module_list.rs +++ b/crates/debugger_ui/src/session/running/module_list.rs @@ -270,7 +270,6 @@ impl Render for ModuleList { self.schedule_rebuild(cx); } div() - .id("module-list-container") .track_focus(&self.focus_handle) .on_action(cx.listener(Self::select_last)) .on_action(cx.listener(Self::select_first)) diff --git a/crates/debugger_ui/src/session/running/stack_frame_list.rs b/crates/debugger_ui/src/session/running/stack_frame_list.rs index 5af31d22c2..474ee1246b 100644 --- a/crates/debugger_ui/src/session/running/stack_frame_list.rs +++ b/crates/debugger_ui/src/session/running/stack_frame_list.rs @@ -680,7 +680,6 @@ impl StackFrameList { impl Render for StackFrameList { fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { div() - .id(("stack-frame-list-container", cx.entity_id())) .track_focus(&self.focus_handle) .size_full() .on_action(cx.listener(Self::select_next)) diff --git a/crates/editor/src/hover_popover.rs b/crates/editor/src/hover_popover.rs index 594c99057e..b5904abca5 100644 --- a/crates/editor/src/hover_popover.rs +++ b/crates/editor/src/hover_popover.rs @@ -990,7 +990,6 @@ impl DiagnosticPopover { ), ), ) - .id("diagnostic-popover-vertical-scroll-container") .custom_scrollbars( Scrollbars::for_settings::() .tracked_scroll_handle(self.scroll_handle.clone()), diff --git a/crates/editor/src/signature_help.rs b/crates/editor/src/signature_help.rs index 591eb9c6f0..6c1fed7ef8 100644 --- a/crates/editor/src/signature_help.rs +++ b/crates/editor/src/signature_help.rs @@ -343,7 +343,6 @@ impl SignatureHelpPopover { let main_content = div() .occlude() .p_2() - .id("signature_help_wrapper") .child( div() .id("signature_help_container") diff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rs index f89bc2f0a7..dbc5d29d20 100644 --- a/crates/extensions_ui/src/extensions_ui.rs +++ b/crates/extensions_ui/src/extensions_ui.rs @@ -1509,7 +1509,6 @@ impl Render for ExtensionsPage { .child(self.render_feature_upsells(cx)) .child( v_flex() - .id("extensions-page-container") .pl_4() .pr_6() .size_full() @@ -1521,17 +1520,24 @@ impl Render for ExtensionsPage { } if count == 0 { - return this.py_4().child(self.render_empty_state(cx)); - } - - let scroll_handle = self.list.clone(); - this.child( - uniform_list("entries", count, cx.processor(Self::render_extensions)) + this.py_4() + .child(self.render_empty_state(cx)) + .into_any_element() + } else { + let scroll_handle = self.list.clone(); + this.child( + uniform_list( + "entries", + count, + cx.processor(Self::render_extensions), + ) .flex_grow() .pb_4() .track_scroll(scroll_handle.clone()), - ) - .vertical_scrollbar_for(scroll_handle, window, cx) + ) + .vertical_scrollbar_for(scroll_handle, window, cx) + .into_any_element() + } }), ) } diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 9f5381b7c3..4aac0f5c7f 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -3525,7 +3525,6 @@ impl GitPanel { .relative() .child( h_flex() - .id("git-panel-entries-container") .flex_1() .size_full() .relative() diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index 1ab8948b80..201f8f323c 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -4706,7 +4706,6 @@ impl OutlinePanel { }; v_flex() - .id("outline-panel-content-container") .flex_shrink() .size_full() .child(list_contents.size_full().flex_shrink()) diff --git a/crates/recent_projects/src/remote_servers.rs b/crates/recent_projects/src/remote_servers.rs index ad9d398500..d9c89992e4 100644 --- a/crates/recent_projects/src/remote_servers.rs +++ b/crates/recent_projects/src/remote_servers.rs @@ -1560,7 +1560,6 @@ impl RemoteServerProjects { .section( Section::new().padded(false).child( v_flex() - .id("remote-server-modal") .min_h(rems(20.)) .size_full() .relative() diff --git a/crates/settings_ui/src/ui_components/table.rs b/crates/settings_ui/src/ui_components/table.rs index d6f5aadac4..ba7ae66653 100644 --- a/crates/settings_ui/src/ui_components/table.rs +++ b/crates/settings_ui/src/ui_components/table.rs @@ -889,7 +889,6 @@ impl RenderOnce for Table { if let Some(state) = interaction_state.as_ref() { content - .id(("table-component-content", state.entity_id())) .custom_scrollbars( Scrollbars::for_settings::() .tracked_scroll_handle(state.read(cx).scroll_handle.clone()),