Clean up UI

This commit is contained in:
Agus Zubiaga 2025-08-18 17:47:59 -03:00
parent 2ed2b82e02
commit 072703c8b2

View file

@ -1916,36 +1916,45 @@ impl AcpThreadView {
cx: &Context<Self>, cx: &Context<Self>,
) -> Div { ) -> Div {
v_flex() v_flex()
.p_2() .py_2()
.gap_2() .px_8()
.w_full()
.flex_1() .flex_1()
.items_center() .items_center()
.justify_center() .justify_center()
.child( .child(
v_flex() v_flex()
.items_center() .w_full()
.max_w(px(530.))
.justify_center() .justify_center()
.child(self.render_error_agent_logo()) .gap_2()
.child( .child(
h_flex().mt_4().mb_1().justify_center().child( v_flex()
.justify_center()
.items_center()
.child(self.render_error_agent_logo())
.child(h_flex().mt_4().mb_1().justify_center().child(
Headline::new("Authentication Required").size(HeadlineSize::Medium), Headline::new("Authentication Required").size(HeadlineSize::Medium),
), ))
)
.into_any(), .into_any(),
) )
.children(description.map(|desc| { .children(description.map(|desc| {
div().text_ui(cx).text_center().child( div().text_ui(cx).text_center().child(self.render_markdown(
self.render_markdown(desc.clone(), default_markdown_style(false, window, cx)), desc.clone(),
) default_markdown_style(false, window, cx),
))
})) }))
.children( .children(
configuration_view configuration_view
.cloned() .cloned()
.map(|view| div().px_4().w_full().max_w_128().child(view)), .map(|view| div().w_full().child(view)),
) )
.child(h_flex().mt_1p5().justify_center().children( .child(h_flex().mt_1p5().justify_center().children(
connection.auth_methods().into_iter().map(|method| { connection.auth_methods().into_iter().map(|method| {
Button::new(SharedString::from(method.id.0.clone()), method.name.clone()) Button::new(
SharedString::from(method.id.0.clone()),
method.name.clone(),
)
.on_click({ .on_click({
let method_id = method.id.clone(); let method_id = method.id.clone();
cx.listener(move |this, _, window, cx| { cx.listener(move |this, _, window, cx| {
@ -1953,7 +1962,8 @@ impl AcpThreadView {
}) })
}) })
}), }),
)) )),
)
} }
fn render_server_exited(&self, status: ExitStatus, _cx: &Context<Self>) -> AnyElement { fn render_server_exited(&self, status: ExitStatus, _cx: &Context<Self>) -> AnyElement {