chore: improve chat panel (#121)

* .

* .

* .

* skip sent message

* improve sent reports

* .

* .

* .
This commit is contained in:
reya
2025-08-18 13:20:29 +07:00
committed by GitHub
parent 5bef1a2c6c
commit c2b276f3f3
12 changed files with 1031 additions and 918 deletions

View File

@@ -61,6 +61,7 @@ pub enum IconName {
Forward,
Search,
SearchFill,
Sent,
Settings,
SortAscending,
SortDescending,
@@ -133,6 +134,7 @@ impl IconName {
Self::Forward => "icons/forward.svg",
Self::Search => "icons/search.svg",
Self::SearchFill => "icons/search-fill.svg",
Self::Sent => "icons/sent.svg",
Self::Settings => "icons/settings.svg",
Self::SortAscending => "icons/sort-ascending.svg",
Self::SortDescending => "icons/sort-descending.svg",

View File

@@ -54,7 +54,7 @@ type CustomRangeTooltipFn =
Option<Arc<dyn Fn(usize, Range<usize>, &mut Window, &mut App) -> Option<AnyView>>>;
#[derive(Default)]
pub struct RichText {
pub struct RenderedText {
pub text: SharedString,
pub highlights: Vec<(Range<usize>, Highlight)>,
pub link_ranges: Vec<Range<usize>>,
@@ -63,7 +63,7 @@ pub struct RichText {
custom_ranges_tooltip_fn: CustomRangeTooltipFn,
}
impl RichText {
impl RenderedText {
pub fn new(content: &str, cx: &App) -> Self {
let mut text = String::new();
let mut highlights = Vec::new();
@@ -81,7 +81,7 @@ impl RichText {
text.truncate(text.trim_end().len());
RichText {
RenderedText {
text: SharedString::from(text),
link_urls: link_urls.into(),
link_ranges,
@@ -98,7 +98,7 @@ impl RichText {
self.custom_ranges_tooltip_fn = Some(Arc::new(f));
}
pub fn element(&self, id: ElementId, window: &mut Window, cx: &App) -> AnyElement {
pub fn element(&self, id: ElementId, window: &Window, cx: &App) -> AnyElement {
let link_color = cx.theme().text_accent;
InteractiveText::new(