Reduce render allocations and redundant work in core components

This commit is contained in:
2026-11-09 14:35:15 +07:00
parent 73f7dc31d4
commit 122f9b12ae
19 changed files with 174 additions and 139 deletions
+8 -16
View File
@@ -969,15 +969,10 @@ fn render_pane(
.map(|tab| tab.view.clone());
// The cache keeps an un-notified panel from re-rendering on dock frames.
let content_id = SharedString::from(format!("{dock_id}-content-{}", pane.key));
let content = div()
.id(SharedString::from(format!(
"{dock_id}-content-{}",
pane.key
)))
.debug_selector({
let id = SharedString::from(format!("{dock_id}-content-{}", pane.key));
move || id.to_string()
})
.id(content_id.clone())
.debug_selector(move || content_id.to_string())
.flex_1()
.min_h_0()
.overflow_hidden()
@@ -999,6 +994,7 @@ fn render_pane(
let pane = pane.clone();
let titlebar = *titlebar;
let padding_x = metrics.dense_padding_x;
move |window, cx| {
let selected = pane
.active
@@ -1065,15 +1061,11 @@ fn render_pane(
}
});
let bar_id = SharedString::from(format!("{dock_id}-pane-{}-bar", pane.key));
h_flex()
.id(SharedString::from(format!(
"{dock_id}-pane-{}-bar",
pane.key
)))
.debug_selector({
let id = SharedString::from(format!("{dock_id}-pane-{}-bar", pane.key));
move || id.to_string()
})
.id(bar_id.clone())
.debug_selector(move || bar_id.to_string())
.flex_none()
.w_full()
.h(titlebar.height)