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
@@ -4,14 +4,13 @@ use gpui::{
Styled as _, Window, div, px,
};
use signed_state::Backend;
use ui::button::Button;
use ui::common::v_flex;
use ui::dialog::{Dialog, DialogHandle};
use ui::field::Field;
use ui::input::{Input, InputState};
use ui::theme::ActiveTheme as _;
use crate::shared::progress::{DialogProgress, error_row, run_dialog_task};
use crate::shared::progress::{DialogProgress, dialog_submit_button, error_row, run_dialog_task};
pub struct OnboardingDialog {
handle: DialogHandle,
@@ -108,16 +107,18 @@ impl Render for OnboardingDialog {
let busy = action_state.read(cx).busy;
let this = this.clone();
let create: AnyElement = Button::new("create-identity")
.label("Create new identity")
.loading(busy)
.disabled(busy)
.on_click(move |_, _, cx| {
crate::shared::log_dropped(
this.update(cx, |this, cx| this.create_identity(cx)),
);
})
.into_any_element();
let create: AnyElement = dialog_submit_button(
"create-identity",
"Create new identity",
None,
busy,
&this,
|this, _window, cx| {
this.create_identity(cx);
Ok(())
},
)
.into_any_element();
vec![create]
})