assistant2: Refine empty states design (#27812)

| No LLM provider | Fresh Start | No ToS |
|--------|--------|--------|
| ![CleanShot 2025-03-31 at 7  04
17@2x](https://github.com/user-attachments/assets/aab5987c-1530-401d-acc6-65e4f2fc13b8)
| ![CleanShot 2025-03-31 at 7  04
39@2x](https://github.com/user-attachments/assets/b2c7a2e0-5178-4bcb-a917-da7bf8e6246c)
| ![CleanShot 2025-03-31 at 7  05
10@2x](https://github.com/user-attachments/assets/4a656e82-0e1d-4d11-8d34-8eeeadd4814c)
|

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-03-31 19:31:56 -03:00 committed by GitHub
parent a1bef28da3
commit dce824f095
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 154 additions and 61 deletions

View file

@ -410,7 +410,11 @@ fn render_accept_terms(
.icon_size(IconSize::XSmall)
.on_click(move |_, _window, cx| cx.open_url("https://zed.dev/terms-of-service"));
let text = "To start using Zed AI, please read and accept the";
let thread_view = match view_kind {
LanguageModelProviderTosView::ThreadEmptyState => true,
LanguageModelProviderTosView::PromptEditorPopup => false,
LanguageModelProviderTosView::Configuration => false,
};
let form = v_flex()
.w_full()
@ -418,14 +422,20 @@ fn render_accept_terms(
.child(
h_flex()
.flex_wrap()
.items_start()
.child(Label::new(text))
.when(thread_view, |this| this.justify_center())
.child(Label::new(
"To start using Zed AI, please read and accept the",
))
.child(terms_button),
)
.child({
let button_container = h_flex().w_full().child(
Button::new("accept_terms", "I accept the Terms of Service")
.style(ButtonStyle::Tinted(TintColor::Accent))
.icon(IconName::Check)
.icon_position(IconPosition::Start)
.icon_size(IconSize::Small)
.full_width()
.disabled(accept_terms_disabled)
.on_click({
let state = state.downgrade();
@ -439,10 +449,8 @@ fn render_accept_terms(
match view_kind {
LanguageModelProviderTosView::PromptEditorPopup => button_container.justify_end(),
LanguageModelProviderTosView::Configuration
| LanguageModelProviderTosView::ThreadEmptyState => {
button_container.justify_start()
}
LanguageModelProviderTosView::Configuration => button_container.justify_start(),
LanguageModelProviderTosView::ThreadEmptyState => button_container.justify_center(),
}
});