assistant2: Add stray visual adjusments (#22386)

This PR adds just some tiny visual clean ups to the assistant2 panel.
Nothing major, honestly.

<img width="800" alt="Screenshot 2024-12-24 at 12 19 46 AM"
src="https://github.com/user-attachments/assets/da22aa7f-8a42-4ff0-9e4c-5e8b60b28802"
/>

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2024-12-24 01:26:13 -03:00 committed by GitHub
parent 3d4e0780c4
commit 564936e1fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 71 additions and 71 deletions

View file

@ -3,9 +3,9 @@ use std::sync::Arc;
use assistant_tool::ToolWorkingSet; use assistant_tool::ToolWorkingSet;
use collections::HashMap; use collections::HashMap;
use gpui::{ use gpui::{
list, AbsoluteLength, AnyElement, AppContext, CornersRefinement, DefiniteLength, list, AbsoluteLength, AnyElement, AppContext, DefiniteLength, EdgesRefinement, Empty, Length,
EdgesRefinement, Empty, Length, ListAlignment, ListState, Model, StyleRefinement, Subscription, ListAlignment, ListState, Model, StyleRefinement, Subscription, TextStyleRefinement, View,
TextStyleRefinement, View, WeakView, WeakView,
}; };
use language::LanguageRegistry; use language::LanguageRegistry;
use language_model::Role; use language_model::Role;
@ -108,7 +108,7 @@ impl ActiveThread {
selection_background_color: cx.theme().players().local().selection, selection_background_color: cx.theme().players().local().selection,
code_block: StyleRefinement { code_block: StyleRefinement {
margin: EdgesRefinement { margin: EdgesRefinement {
top: Some(Length::Definite(rems(0.5).into())), top: Some(Length::Definite(rems(1.0).into())),
left: Some(Length::Definite(rems(0.).into())), left: Some(Length::Definite(rems(0.).into())),
right: Some(Length::Definite(rems(0.).into())), right: Some(Length::Definite(rems(0.).into())),
bottom: Some(Length::Definite(rems(1.).into())), bottom: Some(Length::Definite(rems(1.).into())),
@ -120,19 +120,13 @@ impl ActiveThread {
bottom: Some(DefiniteLength::Absolute(AbsoluteLength::Pixels(Pixels(8.)))), bottom: Some(DefiniteLength::Absolute(AbsoluteLength::Pixels(Pixels(8.)))),
}, },
background: Some(colors.editor_foreground.opacity(0.01).into()), background: Some(colors.editor_foreground.opacity(0.01).into()),
border_color: Some(colors.border_variant.opacity(0.25)), border_color: Some(colors.border_variant.opacity(0.3)),
border_widths: EdgesRefinement { border_widths: EdgesRefinement {
top: Some(AbsoluteLength::Pixels(Pixels(1.0))), top: Some(AbsoluteLength::Pixels(Pixels(1.0))),
left: Some(AbsoluteLength::Pixels(Pixels(1.))), left: Some(AbsoluteLength::Pixels(Pixels(1.))),
right: Some(AbsoluteLength::Pixels(Pixels(1.))), right: Some(AbsoluteLength::Pixels(Pixels(1.))),
bottom: Some(AbsoluteLength::Pixels(Pixels(1.))), bottom: Some(AbsoluteLength::Pixels(Pixels(1.))),
}, },
corner_radii: CornersRefinement {
top_left: Some(AbsoluteLength::Pixels(Pixels(2.))),
top_right: Some(AbsoluteLength::Pixels(Pixels(2.))),
bottom_right: Some(AbsoluteLength::Pixels(Pixels(2.))),
bottom_left: Some(AbsoluteLength::Pixels(Pixels(2.))),
},
text: Some(TextStyleRefinement { text: Some(TextStyleRefinement {
font_family: Some(theme_settings.buffer_font.family.clone()), font_family: Some(theme_settings.buffer_font.family.clone()),
font_size: Some(buffer_font_size.into()), font_size: Some(buffer_font_size.into()),
@ -272,7 +266,7 @@ impl ActiveThread {
), ),
), ),
) )
.child(v_flex().p_2p5().text_ui(cx).child(markdown.clone())) .child(div().p_2p5().text_ui(cx).child(markdown.clone()))
.when_some(context, |parent, context| { .when_some(context, |parent, context| {
if !context.is_empty() { if !context.is_empty() {
parent.child( parent.child(

View file

@ -220,10 +220,13 @@ impl Render for MessageEditor {
.p_2() .p_2()
.bg(bg_color) .bg(bg_color)
.child(self.context_strip.clone()) .child(self.context_strip.clone())
.child(
v_flex()
.gap_4()
.child({ .child({
let settings = ThemeSettings::get_global(cx); let settings = ThemeSettings::get_global(cx);
let text_style = TextStyle { let text_style = TextStyle {
color: cx.theme().colors().editor_foreground, color: cx.theme().colors().text,
font_family: settings.ui_font.family.clone(), font_family: settings.ui_font.family.clone(),
font_features: settings.ui_font.features.clone(), font_features: settings.ui_font.features.clone(),
font_size: font_size.into(), font_size: font_size.into(),
@ -263,7 +266,9 @@ impl Render for MessageEditor {
cx.listener(|this, selection, _cx| { cx.listener(|this, selection, _cx| {
this.use_tools = match selection { this.use_tools = match selection {
ToggleState::Selected => true, ToggleState::Selected => true,
ToggleState::Unselected | ToggleState::Indeterminate => false, ToggleState::Unselected | ToggleState::Indeterminate => {
false
}
}; };
}), }),
)) ))
@ -282,6 +287,7 @@ impl Render for MessageEditor {
}), }),
), ),
), ),
),
) )
} }
} }

View file

@ -614,11 +614,11 @@ impl Element for MarkdownElement {
}; };
builder.push_div( builder.push_div(
div() div()
.mb_1()
.h_flex() .h_flex()
.mb_2()
.line_height(rems(1.3))
.items_start() .items_start()
.gap_1() .gap_1()
.line_height(rems(1.3))
.child(bullet), .child(bullet),
range, range,
markdown_end, markdown_end,