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>
@@ -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 @@1
use gpui_kit::assets::IconName;2
use gpui_kit::base::TextSelection;1
use gpui_kit::base::TextSelection;3
use gpui_kit::component::{h_flex, v_flex};2
use gpui_kit::component::{h_flex, v_flex};4
use gpui_kit::prelude::FluentBuilder as _;3
use gpui_kit::prelude::FluentBuilder as _;@@ -11,7 +10,7 @@ use super::avatar::{bot_avatar, member_stack, person_avatar};11
use super::message_actions::{HoverChange, MessageMenu, message_toolbar};10
use super::message_actions::{HoverChange, MessageMenu, message_toolbar};12
use super::reaction_picker::PickHandler;11
use super::reaction_picker::PickHandler;13
use super::reaction_pills::{ReactionControls, reaction_pills};12
use super::reaction_pills::{ReactionControls, reaction_pills};14
use super::widgets::{icon, symbol};13
use super::widgets::symbol;15
use crate::card_state::BotIdentity;14
use crate::card_state::BotIdentity;16
use crate::data::Directory;15
use crate::data::Directory;17
use crate::render::Block;16
use crate::render::Block;@@ -26,7 +25,6 @@ const AVATAR_GAP: f32 = 8.;26
const SERIES_START_GAP: f32 = 8.;25
const SERIES_START_GAP: f32 = 8.;27
const BODY_SIZE: f32 = 13.5;26
const BODY_SIZE: f32 = 13.5;28
const MAX_WIDTH_RATIO: f32 = 0.7;27
const MAX_WIDTH_RATIO: f32 = 0.7;29
const SENDING_OPACITY: f32 = 0.6;30
const REACTION_FOOTER_HEIGHT: f32 = 24.;28
const REACTION_FOOTER_HEIGHT: f32 = 24.;31
const CARD_AVATAR_SIZE: f32 = 32.;29
const CARD_AVATAR_SIZE: f32 = 32.;32
const CARD_GAP: f32 = 12.;30
const 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
333
fn delivery_note(row: &MessageRow, retry: RowAction, index: usize) -> Option<AnyElement> {331
fn 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.))