assistant2: Adjust thread history list item visuals (#21998)

Most notably, adding the `outlined` property in the `ListItem`
component.

<img width="800" alt="Screenshot 2024-12-13 at 20 35 39"
src="https://github.com/user-attachments/assets/adac4463-66f9-4b5e-b1c0-93c34f068dc4"
/>

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2024-12-16 16:42:09 -03:00 committed by GitHub
parent 426f94b310
commit ec741d61ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 8 deletions

View file

@ -323,10 +323,11 @@ impl AssistantPanel {
.when(!recent_threads.is_empty(), |parent| {
parent
.child(
h_flex()
.w_full()
.justify_center()
.child(Label::new("Recent Threads:").size(LabelSize::Small)),
h_flex().w_full().justify_center().child(
Label::new("Recent Threads:")
.size(LabelSize::Small)
.color(Color::Muted),
),
)
.child(
v_flex().gap_2().children(

View file

@ -2,7 +2,7 @@ use gpui::{
uniform_list, AppContext, FocusHandle, FocusableView, Model, UniformListScrollHandle, WeakView,
};
use time::{OffsetDateTime, UtcOffset};
use ui::{prelude::*, IconButtonShape, ListItem};
use ui::{prelude::*, IconButtonShape, ListItem, ListItemSpacing, Tooltip};
use crate::thread::Thread;
use crate::thread_store::ThreadStore;
@ -117,17 +117,25 @@ impl RenderOnce for PastThread {
.unwrap_or(UtcOffset::UTC),
time_format::TimestampFormat::EnhancedAbsolute,
);
ListItem::new(("past-thread", self.thread.entity_id()))
.outlined()
.start_slot(Icon::new(IconName::MessageBubbles))
.child(Label::new(summary))
.spacing(ListItemSpacing::Sparse)
.child(Label::new(summary).size(LabelSize::Small))
.end_slot(
h_flex()
.gap_2()
.child(Label::new(thread_timestamp).color(Color::Disabled))
.child(
Label::new(thread_timestamp)
.color(Color::Disabled)
.size(LabelSize::Small),
)
.child(
IconButton::new("delete", IconName::TrashAlt)
.shape(IconButtonShape::Square)
.icon_size(IconSize::Small)
.tooltip(|cx| Tooltip::text("Delete Thread", cx))
.on_click({
let assistant_panel = self.assistant_panel.clone();
let id = id.clone();