BlueGit

ict rusty-teams

fix(chat): show a clock tick while sending instead of a spinner and faded bubble

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-08 · 7 weeks ago

Hash
9106873c5f765261364d5f79403cd08ac205a902
Parent
54b800ed
1 file changed +5 −17
crates/app/src/views/message_row.rs +5 −17
@@ -1,4 +1,3 @@
1 use gpui_kit::assets::IconName;
2 1 use gpui_kit::base::TextSelection;
3 2 use gpui_kit::component::{h_flex, v_flex};
4 3 use gpui_kit::prelude::FluentBuilder as _;
@@ -11,7 +10,7 @@ use super::avatar::{bot_avatar, member_stack, person_avatar};
11 10 use super::message_actions::{HoverChange, MessageMenu, message_toolbar};
12 11 use super::reaction_picker::PickHandler;
13 12 use super::reaction_pills::{ReactionControls, reaction_pills};
14 use super::widgets::{icon, symbol};
13 use super::widgets::symbol;
15 14 use crate::card_state::BotIdentity;
16 15 use crate::data::Directory;
17 16 use crate::render::Block;
@@ -26,7 +25,6 @@ const AVATAR_GAP: f32 = 8.;
26 25 const SERIES_START_GAP: f32 = 8.;
27 26 const BODY_SIZE: f32 = 13.5;
28 27 const MAX_WIDTH_RATIO: f32 = 0.7;
29 const SENDING_OPACITY: f32 = 0.6;
30 28 const REACTION_FOOTER_HEIGHT: f32 = 24.;
31 29 const CARD_AVATAR_SIZE: f32 = 32.;
32 30 const CARD_GAP: f32 = 12.;
@@ -119,9 +117,6 @@ fn bubble(
119 117 })
120 118 .when(failed, |bubble| {
121 119 bubble.border_1().border_color(theme::red())
122 })
123 .when(row.delivery == Delivery::Sending, |bubble| {
124 bubble.opacity(SENDING_OPACITY)
125 120 });
126 121 let has_reactions = !row.reactions.is_empty();
127 122 let mut content = v_flex().gap(px(6.));
@@ -230,6 +225,9 @@ fn bubble_meta(row: &MessageRow, own: bool) -> Div {
230 225 .text_color(tint)
231 226 .when(row.edited, |meta| meta.child("Edited"))
232 227 .child(row.time.clone())
228 .when(own && row.delivery == Delivery::Sending, |meta| {
229 meta.child(symbol("schedule", META_CHECK_SIZE, tint))
230 })
233 231 .when(
234 232 own && row.delivery == Delivery::Delivered,
235 233 |meta| match row.receipt {
@@ -332,17 +330,7 @@ fn has_text(row: &MessageRow) -> bool {
332 330
333 331 fn delivery_note(row: &MessageRow, retry: RowAction, index: usize) -> Option<AnyElement> {
334 332 match &row.delivery {
335 Delivery::Delivered => None,
336 Delivery::Sending => Some(
337 h_flex()
338 .gap(px(4.))
339 .items_center()
340 .text_size(px(11.))
341 .text_color(theme::text_muted())
342 .child(icon(IconName::Loader, 12., theme::text_muted()))
343 .child("Sending")
344 .into_any_element(),
345 ),
333 Delivery::Delivered | Delivery::Sending => None,
346 334 Delivery::Failed(_) => Some(
347 335 h_flex()
348 336 .gap(px(4.))
@@ -1,4 +1,3 @@
1use gpui_kit::assets::IconName;
2use gpui_kit::base::TextSelection;
1use gpui_kit::base::TextSelection;
3use gpui_kit::component::{h_flex, v_flex};
2use gpui_kit::component::{h_flex, v_flex};
4use gpui_kit::prelude::FluentBuilder as _;
3use gpui_kit::prelude::FluentBuilder as _;
@@ -11,7 +10,7 @@ use super::avatar::{bot_avatar, member_stack, person_avatar};
11use super::message_actions::{HoverChange, MessageMenu, message_toolbar};
10use super::message_actions::{HoverChange, MessageMenu, message_toolbar};
12use super::reaction_picker::PickHandler;
11use super::reaction_picker::PickHandler;
13use super::reaction_pills::{ReactionControls, reaction_pills};
12use super::reaction_pills::{ReactionControls, reaction_pills};
14use super::widgets::{icon, symbol};
13use super::widgets::symbol;
15use crate::card_state::BotIdentity;
14use crate::card_state::BotIdentity;
16use crate::data::Directory;
15use crate::data::Directory;
17use crate::render::Block;
16use crate::render::Block;
@@ -26,7 +25,6 @@ const AVATAR_GAP: f32 = 8.;
26const SERIES_START_GAP: f32 = 8.;
25const SERIES_START_GAP: f32 = 8.;
27const BODY_SIZE: f32 = 13.5;
26const BODY_SIZE: f32 = 13.5;
28const MAX_WIDTH_RATIO: f32 = 0.7;
27const MAX_WIDTH_RATIO: f32 = 0.7;
29const SENDING_OPACITY: f32 = 0.6;
30const REACTION_FOOTER_HEIGHT: f32 = 24.;
28const REACTION_FOOTER_HEIGHT: f32 = 24.;
31const CARD_AVATAR_SIZE: f32 = 32.;
29const CARD_AVATAR_SIZE: f32 = 32.;
32const CARD_GAP: f32 = 12.;
30const CARD_GAP: f32 = 12.;
@@ -119,9 +117,6 @@ fn bubble(
119 })
117 })
120 .when(failed, |bubble| {
118 .when(failed, |bubble| {
121 bubble.border_1().border_color(theme::red())
119 bubble.border_1().border_color(theme::red())
122 })
123 .when(row.delivery == Delivery::Sending, |bubble| {
124 bubble.opacity(SENDING_OPACITY)
125 });
120 });
126 let has_reactions = !row.reactions.is_empty();
121 let has_reactions = !row.reactions.is_empty();
127 let mut content = v_flex().gap(px(6.));
122 let mut content = v_flex().gap(px(6.));
@@ -230,6 +225,9 @@ fn bubble_meta(row: &MessageRow, own: bool) -> Div {
230 .text_color(tint)
225 .text_color(tint)
231 .when(row.edited, |meta| meta.child("Edited"))
226 .when(row.edited, |meta| meta.child("Edited"))
232 .child(row.time.clone())
227 .child(row.time.clone())
228 .when(own && row.delivery == Delivery::Sending, |meta| {
229 meta.child(symbol("schedule", META_CHECK_SIZE, tint))
230 })
233 .when(
231 .when(
234 own && row.delivery == Delivery::Delivered,
232 own && row.delivery == Delivery::Delivered,
235 |meta| match row.receipt {
233 |meta| match row.receipt {
@@ -332,17 +330,7 @@ fn has_text(row: &MessageRow) -> bool {
332
330
333fn delivery_note(row: &MessageRow, retry: RowAction, index: usize) -> Option<AnyElement> {
331fn delivery_note(row: &MessageRow, retry: RowAction, index: usize) -> Option<AnyElement> {
334 match &row.delivery {
332 match &row.delivery {
335 Delivery::Delivered => None,
333 Delivery::Delivered | Delivery::Sending => None,
336 Delivery::Sending => Some(
337 h_flex()
338 .gap(px(4.))
339 .items_center()
340 .text_size(px(11.))
341 .text_color(theme::text_muted())
342 .child(icon(IconName::Loader, 12., theme::text_muted()))
343 .child("Sending")
344 .into_any_element(),
345 ),
346 Delivery::Failed(_) => Some(
334 Delivery::Failed(_) => Some(
347 h_flex()
335 h_flex()
348 .gap(px(4.))
336 .gap(px(4.))