refactor: inline intermediate element builders in render methods
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run

This commit is contained in:
2026-11-22 18:42:59 +07:00
parent 9daee9d54d
commit 967273c402
14 changed files with 560 additions and 550 deletions
+25 -24
View File
@@ -213,30 +213,31 @@ impl Render for Workspace {
.gap_2()
.when(self.details.len() > 1, |this| {
let close_weak = weak.clone();
let tabs = Tabs::new("signed-detail-tabs")
.variant(TabsVariant::Pill)
.overflow_scroll(true)
.selected(selected)
.tabs(move |_, cx| {
details
.iter()
.map(|(id, view)| match view {
Some(view) => view.tab(id.clone().into(), cx).closeable(true),
None => Tab::new(id.clone(), id.clone()).closeable(true),
})
.collect()
})
.on_change(move |index, _, cx| {
log_dropped(weak.update(cx, |workspace, cx| {
workspace.activate_detail_at(index, cx);
}));
})
.on_close(move |index, _, cx| {
log_dropped(close_weak.update(cx, |workspace, cx| {
workspace.close_detail_at(index, cx);
}));
});
this.child(tabs)
this.child(
Tabs::new("signed-detail-tabs")
.variant(TabsVariant::Pill)
.overflow_scroll(true)
.selected(selected)
.tabs(move |_, cx| {
details
.iter()
.map(|(id, view)| match view {
Some(view) => view.tab(id.clone().into(), cx).closeable(true),
None => Tab::new(id.clone(), id.clone()).closeable(true),
})
.collect()
})
.on_change(move |index, _, cx| {
log_dropped(weak.update(cx, |workspace, cx| {
workspace.activate_detail_at(index, cx);
}));
})
.on_close(move |index, _, cx| {
log_dropped(close_weak.update(cx, |workspace, cx| {
workspace.close_detail_at(index, cx);
}));
}),
)
})
.child(div().flex_1().min_h_0().w_full().children(body))
}