refactor: consolidate shared ui helpers and prune unused code

This commit is contained in:
2026-11-22 18:23:21 +07:00
parent 4a72f2b4a0
commit 9daee9d54d
82 changed files with 3607 additions and 7184 deletions
+13 -12
View File
@@ -17,7 +17,7 @@ use ui::tooltip::Tooltip;
use super::grasp_servers::{GraspServersState, grasp_servers_field, load_user_grasp_servers};
use crate::repo::actions::open_repo_panel;
use crate::shared::progress::{DialogProgress, error_row, push_steps_row, run_dialog_task_with};
use crate::shared::progress::{DialogProgress, dialog_submit_button, error_row, push_steps_row, run_dialog_task_with};
use crate::workspace::Workspace;
/// Progress of the create-repository flow, so async results can be rendered.
@@ -229,17 +229,18 @@ impl Render for CreateRepoDialog {
let busy = action_state.read(cx).busy;
let this = this.clone();
let create: AnyElement = Button::new("create-repository")
.label("Create repository")
.icon(Icon::named(IconRole::Plus))
.loading(busy)
.disabled(busy)
.on_click(move |_, window, cx| {
crate::shared::log_dropped(
this.update(cx, |this, cx| this.create(window, cx)),
);
})
.into_any_element();
let create: AnyElement = dialog_submit_button(
"create-repository",
"Create repository",
Some(IconRole::Plus),
busy,
&this,
|this, window, cx| {
this.create(window, cx);
Ok(())
},
)
.into_any_element();
vec![create]
})