BlueGit

ict rusty-teams

feat(chat): typing indicator shows faces, names on hover

- 1:1: the other person's avatar + dots, no text
- Groups: stacked avatars (max 3, then +N) + dots
- Hover: "Lena Hoffmann is typing" / "A and B are typing", 3+ as a name list
- Fix "Someone is typing" in 1:1: Teams sends no imdisplayname there, the name now comes from chat members or stored messages
- Typing avatars are requested if not cached yet

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

metis Daniel Däschle · pushed by metis

Authored 2026-10-09 · 7 weeks ago

Hash
66a81c4d16f4edb83aefe367822507875ea20e62
Parent
70553fc3
4 files changed +111 −57
ROADMAP.md +1 −1
@@ -73,7 +73,7 @@ Feature parity with the Microsoft Teams desktop client.
73 73 | Read receipts | Done | |
74 74 | Select and copy message text | Done | |
75 75 | Adaptive Cards | Partial | Buttons work (submit, execute, show card, toggle, task dialog card). Input fields work in messages and card dialogs (text, number, date, time, toggle, choice set) with validation. URL task dialogs run in a hosted window on Windows (Teams JS SDK host, see docs/research/card-actions.md), in the browser on Linux. Date and time are plain text fields, no picker |
76 | Typing indicator | Done | Shows who types in the chat, thread and list preview; sends your own typing |
76 | Typing indicator | Done | Shows who types as avatars above the composer (names on hover) and in the list preview; sends your own typing |
77 77 | Link previews | Done | One card per message from the chat service, see docs/research/link-previews.md |
78 78 | Loop components | Missing | |
79 79 | Translate a message | Missing | |
@@ -73,7 +73,7 @@ Feature parity with the Microsoft Teams desktop client.
73| Read receipts | Done | |
73| Read receipts | Done | |
74| Select and copy message text | Done | |
74| Select and copy message text | Done | |
75| Adaptive Cards | Partial | Buttons work (submit, execute, show card, toggle, task dialog card). Input fields work in messages and card dialogs (text, number, date, time, toggle, choice set) with validation. URL task dialogs run in a hosted window on Windows (Teams JS SDK host, see docs/research/card-actions.md), in the browser on Linux. Date and time are plain text fields, no picker |
75| Adaptive Cards | Partial | Buttons work (submit, execute, show card, toggle, task dialog card). Input fields work in messages and card dialogs (text, number, date, time, toggle, choice set) with validation. URL task dialogs run in a hosted window on Windows (Teams JS SDK host, see docs/research/card-actions.md), in the browser on Linux. Date and time are plain text fields, no picker |
76| Typing indicator | Done | Shows who types in the chat, thread and list preview; sends your own typing |
76| Typing indicator | Done | Shows who types as avatars above the composer (names on hover) and in the list preview; sends your own typing |
77| Link previews | Done | One card per message from the chat service, see docs/research/link-previews.md |
77| Link previews | Done | One card per message from the chat service, see docs/research/link-previews.md |
78| Loop components | Missing | |
78| Loop components | Missing | |
79| Translate a message | Missing | |
79| Translate a message | Missing | |
crates/app/src/app_state.rs +47 −2
@@ -472,13 +472,20 @@ impl AppState {
472 472 return;
473 473 }
474 474 if event.active {
475 let display_name = match event.display_name.trim() {
476 "" => crate::people::resolve_names(self, std::slice::from_ref(&event.user_id))
477 .remove(&event.user_id)
478 .unwrap_or_default(),
479 _ => event.display_name.clone(),
480 };
475 481 self.typing.start(
476 482 &event.conversation_id,
477 483 &event.user_id,
478 &event.display_name,
484 &display_name,
479 485 Instant::now(),
480 486 event.received_at,
481 487 );
488 self.request_avatars(vec![event.user_id.clone()], cx);
482 489 self.schedule_typing_expiry(cx);
483 490 } else {
484 491 self.typing.clear(&event.conversation_id, &event.user_id);
@@ -631,7 +638,9 @@ mod tests {
631 638 use chatsvc::TypingEvent;
632 639 use chrono::{Duration, Utc};
633 640 use gpui_kit::{AppContext as _, TestAppContext};
634 use store::{ChannelRecord, ChatRecord, MessageRecord, SidebarTeam, Store, TeamRecord};
641 use store::{
642 ChannelRecord, ChatRecord, MemberRecord, MessageRecord, SidebarTeam, Store, TeamRecord,
643 };
635 644 use teams_core::CoreEvent;
636 645
637 646 use super::{AppState, Mode, Selection, chat_title, selection_title};
@@ -752,4 +761,40 @@ mod tests {
752 761 });
753 762 assert!(names(cx).is_empty());
754 763 }
764
765 #[gpui_kit::test]
766 fn typing_without_a_display_name_uses_the_chat_member_name(cx: &mut TestAppContext) {
767 cx.update(gpui_kit::init);
768 let store = Arc::new(Store::open_in_memory().unwrap());
769 let app = cx.update(|cx| {
770 cx.new(|_| {
771 let mut state = AppState::new(store.clone(), Mode::default());
772 let mut member_chat = chat("c1", "First", false);
773 member_chat.members = vec![MemberRecord {
774 user_id: Some("ada".into()),
775 display_name: "Ada Lovelace".into(),
776 }];
777 state.sidebar.chats = vec![member_chat];
778 state
779 })
780 });
781 cx.update(|cx| {
782 app.update(cx, |state, cx| {
783 state.apply(
784 BackendEvent::Typing(TypingEvent {
785 conversation_id: "c1".into(),
786 user_id: "ada".into(),
787 display_name: String::new(),
788 active: true,
789 received_at: Utc::now(),
790 }),
791 cx,
792 )
793 })
794 });
795 assert_eq!(
796 cx.update(|cx| app.read(cx).typing.names("c1")),
797 vec!["Ada Lovelace".to_owned()]
798 );
799 }
755 800 }
@@ -472,13 +472,20 @@ impl AppState {
472 return;
472 return;
473 }
473 }
474 if event.active {
474 if event.active {
475 let display_name = match event.display_name.trim() {
476 "" => crate::people::resolve_names(self, std::slice::from_ref(&event.user_id))
477 .remove(&event.user_id)
478 .unwrap_or_default(),
479 _ => event.display_name.clone(),
480 };
475 self.typing.start(
481 self.typing.start(
476 &event.conversation_id,
482 &event.conversation_id,
477 &event.user_id,
483 &event.user_id,
478 &event.display_name,
484 &display_name,
479 Instant::now(),
485 Instant::now(),
480 event.received_at,
486 event.received_at,
481 );
487 );
488 self.request_avatars(vec![event.user_id.clone()], cx);
482 self.schedule_typing_expiry(cx);
489 self.schedule_typing_expiry(cx);
483 } else {
490 } else {
484 self.typing.clear(&event.conversation_id, &event.user_id);
491 self.typing.clear(&event.conversation_id, &event.user_id);
@@ -631,7 +638,9 @@ mod tests {
631 use chatsvc::TypingEvent;
638 use chatsvc::TypingEvent;
632 use chrono::{Duration, Utc};
639 use chrono::{Duration, Utc};
633 use gpui_kit::{AppContext as _, TestAppContext};
640 use gpui_kit::{AppContext as _, TestAppContext};
634 use store::{ChannelRecord, ChatRecord, MessageRecord, SidebarTeam, Store, TeamRecord};
641 use store::{
642 ChannelRecord, ChatRecord, MemberRecord, MessageRecord, SidebarTeam, Store, TeamRecord,
643 };
635 use teams_core::CoreEvent;
644 use teams_core::CoreEvent;
636
645
637 use super::{AppState, Mode, Selection, chat_title, selection_title};
646 use super::{AppState, Mode, Selection, chat_title, selection_title};
@@ -752,4 +761,40 @@ mod tests {
752 });
761 });
753 assert!(names(cx).is_empty());
762 assert!(names(cx).is_empty());
754 }
763 }
764
765 #[gpui_kit::test]
766 fn typing_without_a_display_name_uses_the_chat_member_name(cx: &mut TestAppContext) {
767 cx.update(gpui_kit::init);
768 let store = Arc::new(Store::open_in_memory().unwrap());
769 let app = cx.update(|cx| {
770 cx.new(|_| {
771 let mut state = AppState::new(store.clone(), Mode::default());
772 let mut member_chat = chat("c1", "First", false);
773 member_chat.members = vec![MemberRecord {
774 user_id: Some("ada".into()),
775 display_name: "Ada Lovelace".into(),
776 }];
777 state.sidebar.chats = vec![member_chat];
778 state
779 })
780 });
781 cx.update(|cx| {
782 app.update(cx, |state, cx| {
783 state.apply(
784 BackendEvent::Typing(TypingEvent {
785 conversation_id: "c1".into(),
786 user_id: "ada".into(),
787 display_name: String::new(),
788 active: true,
789 received_at: Utc::now(),
790 }),
791 cx,
792 )
793 })
794 });
795 assert_eq!(
796 cx.update(|cx| app.read(cx).typing.names("c1")),
797 vec!["Ada Lovelace".to_owned()]
798 );
799 }
755}
800}
crates/app/src/typing.rs +43 −37
@@ -4,11 +4,11 @@ use std::time::{Duration, Instant};
4 4 use chrono::{DateTime, Utc};
5 5
6 6 use crate::format::first_name;
7 use crate::sidebar_model::Face;
7 8
8 9 pub const SEND_INTERVAL: Duration = Duration::from_secs(20);
9 10 pub const REMOTE_TIMEOUT: Duration = Duration::from_secs(22);
10 11 const UNKNOWN_NAME: &str = "Someone";
11 const LISTED_FIRST_NAMES: usize = 2;
12 12
13 13 #[derive(Debug, Clone, PartialEq, Eq)]
14 14 struct Typer {
@@ -86,13 +86,23 @@ impl TypingState {
86 86 }
87 87
88 88 pub fn names(&self, conversation_id: &str) -> Vec<String> {
89 self.faces(conversation_id)
90 .into_iter()
91 .map(|face| face.name)
92 .collect()
93 }
94
95 pub fn faces(&self, conversation_id: &str) -> Vec<Face> {
89 96 self.conversations
90 97 .get(conversation_id)
91 98 .into_iter()
92 99 .flatten()
93 .map(|typer| match typer.name.trim() {
94 "" => UNKNOWN_NAME.to_owned(),
95 name => name.to_owned(),
100 .map(|typer| Face {
101 user_id: Some(typer.user_id.clone()),
102 name: match typer.name.trim() {
103 "" => UNKNOWN_NAME.to_owned(),
104 name => name.to_owned(),
105 },
96 106 })
97 107 .collect()
98 108 }
@@ -115,25 +125,12 @@ impl TypingState {
115 125 }
116 126 }
117 127
118 pub fn typing_label(names: &[String]) -> String {
128 pub fn typing_tooltip(names: &[String]) -> String {
119 129 match names {
120 130 [] => String::new(),
121 131 [only] => format!("{only} is typing"),
122 [first, second] => {
123 format!("{first} and {second} are typing")
124 }
125 [first, second, third] => format!(
126 "{}, {}, and {} are typing",
127 first_name(first),
128 first_name(second),
129 first_name(third)
130 ),
131 _ => format!(
132 "{}, {}, and {} others are typing",
133 first_name(&names[0]),
134 first_name(&names[1]),
135 names.len() - LISTED_FIRST_NAMES
136 ),
132 [first, second] => format!("{first} and {second} are typing"),
133 _ => format!("Typing\n{}", names.join("\n")),
137 134 }
138 135 }
139 136
@@ -188,33 +185,42 @@ mod tests {
188 185 }
189 186
190 187 #[test]
191 fn label_has_four_forms() {
192 assert_eq!(typing_label(&[]), "");
188 fn tooltip_names_one_or_two_in_a_sentence_and_more_as_a_list() {
189 assert_eq!(typing_tooltip(&[]), "");
193 190 assert_eq!(
194 typing_label(&names(&["Ada Lovelace"])),
191 typing_tooltip(&names(&["Ada Lovelace"])),
195 192 "Ada Lovelace is typing"
196 193 );
197 194 assert_eq!(
198 typing_label(&names(&["Ada Lovelace", "Alan Turing"])),
195 typing_tooltip(&names(&["Ada Lovelace", "Alan Turing"])),
199 196 "Ada Lovelace and Alan Turing are typing"
200 197 );
201 198 assert_eq!(
202 typing_label(&names(&["Ada Lovelace", "Alan Turing", "Grace Hopper"])),
203 "Ada, Alan, and Grace are typing"
204 );
205 assert_eq!(
206 typing_label(&names(&[
207 "Ada Lovelace",
208 "Alan Turing",
209 "Grace Hopper",
210 "Linus T"
211 ])),
212 "Ada, Alan, and 2 others are typing"
199 typing_tooltip(&names(&["A B", "C D", "E F", "G H", "I J"])),
200 "Typing\nA B\nC D\nE F\nG H\nI J"
213 201 );
202 }
203
204 #[test]
205 fn faces_keep_order_and_fall_back_to_someone() {
206 let mut state = TypingState::default();
207 let now = Instant::now();
208 state.start("c", "u1", "Ada", now, at(0));
209 state.start("c", "u2", " ", now, at(0));
214 210 assert_eq!(
215 typing_label(&names(&["A B", "C D", "E F", "G H", "I J"])),
216 "A, C, and 3 others are typing"
211 state.faces("c"),
212 vec![
213 Face {
214 user_id: Some("u1".into()),
215 name: "Ada".into()
216 },
217 Face {
218 user_id: Some("u2".into()),
219 name: "Someone".into()
220 },
221 ]
217 222 );
223 assert!(state.faces("other").is_empty());
218 224 }
219 225
220 226 #[test]
@@ -4,11 +4,11 @@ use std::time::{Duration, Instant};
4use chrono::{DateTime, Utc};
4use chrono::{DateTime, Utc};
5
5
6use crate::format::first_name;
6use crate::format::first_name;
7use crate::sidebar_model::Face;
7
8
8pub const SEND_INTERVAL: Duration = Duration::from_secs(20);
9pub const SEND_INTERVAL: Duration = Duration::from_secs(20);
9pub const REMOTE_TIMEOUT: Duration = Duration::from_secs(22);
10pub const REMOTE_TIMEOUT: Duration = Duration::from_secs(22);
10const UNKNOWN_NAME: &str = "Someone";
11const UNKNOWN_NAME: &str = "Someone";
11const LISTED_FIRST_NAMES: usize = 2;
12
12
13#[derive(Debug, Clone, PartialEq, Eq)]
13#[derive(Debug, Clone, PartialEq, Eq)]
14struct Typer {
14struct Typer {
@@ -86,13 +86,23 @@ impl TypingState {
86 }
86 }
87
87
88 pub fn names(&self, conversation_id: &str) -> Vec<String> {
88 pub fn names(&self, conversation_id: &str) -> Vec<String> {
89 self.faces(conversation_id)
90 .into_iter()
91 .map(|face| face.name)
92 .collect()
93 }
94
95 pub fn faces(&self, conversation_id: &str) -> Vec<Face> {
89 self.conversations
96 self.conversations
90 .get(conversation_id)
97 .get(conversation_id)
91 .into_iter()
98 .into_iter()
92 .flatten()
99 .flatten()
93 .map(|typer| match typer.name.trim() {
100 .map(|typer| Face {
94 "" => UNKNOWN_NAME.to_owned(),
101 user_id: Some(typer.user_id.clone()),
95 name => name.to_owned(),
102 name: match typer.name.trim() {
103 "" => UNKNOWN_NAME.to_owned(),
104 name => name.to_owned(),
105 },
96 })
106 })
97 .collect()
107 .collect()
98 }
108 }
@@ -115,25 +125,12 @@ impl TypingState {
115 }
125 }
116}
126}
117
127
118pub fn typing_label(names: &[String]) -> String {
128pub fn typing_tooltip(names: &[String]) -> String {
119 match names {
129 match names {
120 [] => String::new(),
130 [] => String::new(),
121 [only] => format!("{only} is typing"),
131 [only] => format!("{only} is typing"),
122 [first, second] => {
132 [first, second] => format!("{first} and {second} are typing"),
123 format!("{first} and {second} are typing")
133 _ => format!("Typing\n{}", names.join("\n")),
124 }
125 [first, second, third] => format!(
126 "{}, {}, and {} are typing",
127 first_name(first),
128 first_name(second),
129 first_name(third)
130 ),
131 _ => format!(
132 "{}, {}, and {} others are typing",
133 first_name(&names[0]),
134 first_name(&names[1]),
135 names.len() - LISTED_FIRST_NAMES
136 ),
137 }
134 }
138}
135}
139
136
@@ -188,33 +185,42 @@ mod tests {
188 }
185 }
189
186
190 #[test]
187 #[test]
191 fn label_has_four_forms() {
188 fn tooltip_names_one_or_two_in_a_sentence_and_more_as_a_list() {
192 assert_eq!(typing_label(&[]), "");
189 assert_eq!(typing_tooltip(&[]), "");
193 assert_eq!(
190 assert_eq!(
194 typing_label(&names(&["Ada Lovelace"])),
191 typing_tooltip(&names(&["Ada Lovelace"])),
195 "Ada Lovelace is typing"
192 "Ada Lovelace is typing"
196 );
193 );
197 assert_eq!(
194 assert_eq!(
198 typing_label(&names(&["Ada Lovelace", "Alan Turing"])),
195 typing_tooltip(&names(&["Ada Lovelace", "Alan Turing"])),
199 "Ada Lovelace and Alan Turing are typing"
196 "Ada Lovelace and Alan Turing are typing"
200 );
197 );
201 assert_eq!(
198 assert_eq!(
202 typing_label(&names(&["Ada Lovelace", "Alan Turing", "Grace Hopper"])),
199 typing_tooltip(&names(&["A B", "C D", "E F", "G H", "I J"])),
203 "Ada, Alan, and Grace are typing"
200 "Typing\nA B\nC D\nE F\nG H\nI J"
204 );
205 assert_eq!(
206 typing_label(&names(&[
207 "Ada Lovelace",
208 "Alan Turing",
209 "Grace Hopper",
210 "Linus T"
211 ])),
212 "Ada, Alan, and 2 others are typing"
213 );
201 );
202 }
203
204 #[test]
205 fn faces_keep_order_and_fall_back_to_someone() {
206 let mut state = TypingState::default();
207 let now = Instant::now();
208 state.start("c", "u1", "Ada", now, at(0));
209 state.start("c", "u2", " ", now, at(0));
214 assert_eq!(
210 assert_eq!(
215 typing_label(&names(&["A B", "C D", "E F", "G H", "I J"])),
211 state.faces("c"),
216 "A, C, and 3 others are typing"
212 vec![
213 Face {
214 user_id: Some("u1".into()),
215 name: "Ada".into()
216 },
217 Face {
218 user_id: Some("u2".into()),
219 name: "Someone".into()
220 },
221 ]
217 );
222 );
223 assert!(state.faces("other").is_empty());
218 }
224 }
219
225
220 #[test]
226 #[test]
crates/app/src/views/conversation.rs +20 −17
@@ -11,6 +11,7 @@ use gpui_kit::component::{
11 11 h_flex,
12 12 input::Escape,
13 13 message_scroller::{MessageScroller, MessageScrollerState},
14 tooltip::Tooltip,
14 15 v_flex,
15 16 };
16 17 use gpui_kit::prelude::FluentBuilder as _;
@@ -50,7 +51,7 @@ use crate::rows::{
50 51 use crate::runtime;
51 52 use crate::sidebar_model::{AvatarSpec, Face};
52 53 use crate::theme;
53 use crate::typing::typing_label;
54 use crate::typing::typing_tooltip;
54 55
55 56 const CHAT_OPEN_LIMIT: usize = 60;
56 57 const CHANNEL_OPEN_LIMIT: usize = 300;
@@ -68,7 +69,7 @@ const SLOW_AFTER: Duration = Duration::from_secs(8);
68 69 const PROGRESS_MIN_VISIBLE: Duration = Duration::from_millis(500);
69 70 const PROGRESS_BAR_PERIOD: Duration = Duration::from_millis(1400);
70 71 const PROGRESS_BAR_WIDTH: f32 = 0.35;
71 const TYPING_LINE_HEIGHT: f32 = 20.;
72 const TYPING_LINE_HEIGHT: f32 = 22.;
72 73 const TYPING_DOT_SIZE: f32 = 5.;
73 74 const TYPING_DOT_COUNT: usize = 3;
74 75 const TYPING_PULSE_PERIOD: Duration = Duration::from_millis(1200);
@@ -578,33 +579,35 @@ impl ConversationView {
578 579 }
579 580
580 581 fn render_typing_line(&self, cx: &App) -> impl IntoElement {
581 let names = self
582 let app = self.app.read(cx);
583 let faces = self
582 584 .current
583 585 .as_ref()
584 586 .filter(|_| !self.draft_active)
585 .map(|current| {
586 self.app
587 .read(cx)
588 .typing
589 .names(current.selection.conversation_id())
590 })
587 .map(|current| app.typing.faces(current.selection.conversation_id()))
591 588 .unwrap_or_default();
589 let tooltip_text = typing_tooltip(
590 &faces
591 .iter()
592 .map(|face| face.name.clone())
593 .collect::<Vec<_>>(),
594 );
592 595 h_flex()
593 596 .h(px(TYPING_LINE_HEIGHT))
594 597 .flex_none()
595 598 .px(px(24.))
596 599 .gap(px(6.))
597 600 .items_center()
598 .text_size(px(12.))
599 .text_color(theme::text_muted())
600 .when(!names.is_empty(), |line| {
601 line.child(typing_dots()).child(
601 .when(!faces.is_empty(), |line| {
602 line.child(
602 603 div()
603 .flex_1()
604 .min_w_0()
605 .truncate()
606 .child(typing_label(&names)),
604 .id("typing-faces")
605 .tooltip(move |window, cx| {
606 Tooltip::new(tooltip_text.clone()).build(window, cx)
607 })
608 .child(member_stack(&app.directory, &faces, faces.len())),
607 609 )
610 .child(typing_dots())
608 611 })
609 612 }
610 613
@@ -11,6 +11,7 @@ use gpui_kit::component::{
11 h_flex,
11 h_flex,
12 input::Escape,
12 input::Escape,
13 message_scroller::{MessageScroller, MessageScrollerState},
13 message_scroller::{MessageScroller, MessageScrollerState},
14 tooltip::Tooltip,
14 v_flex,
15 v_flex,
15};
16};
16use gpui_kit::prelude::FluentBuilder as _;
17use gpui_kit::prelude::FluentBuilder as _;
@@ -50,7 +51,7 @@ use crate::rows::{
50use crate::runtime;
51use crate::runtime;
51use crate::sidebar_model::{AvatarSpec, Face};
52use crate::sidebar_model::{AvatarSpec, Face};
52use crate::theme;
53use crate::theme;
53use crate::typing::typing_label;
54use crate::typing::typing_tooltip;
54
55
55const CHAT_OPEN_LIMIT: usize = 60;
56const CHAT_OPEN_LIMIT: usize = 60;
56const CHANNEL_OPEN_LIMIT: usize = 300;
57const CHANNEL_OPEN_LIMIT: usize = 300;
@@ -68,7 +69,7 @@ const SLOW_AFTER: Duration = Duration::from_secs(8);
68const PROGRESS_MIN_VISIBLE: Duration = Duration::from_millis(500);
69const PROGRESS_MIN_VISIBLE: Duration = Duration::from_millis(500);
69const PROGRESS_BAR_PERIOD: Duration = Duration::from_millis(1400);
70const PROGRESS_BAR_PERIOD: Duration = Duration::from_millis(1400);
70const PROGRESS_BAR_WIDTH: f32 = 0.35;
71const PROGRESS_BAR_WIDTH: f32 = 0.35;
71const TYPING_LINE_HEIGHT: f32 = 20.;
72const TYPING_LINE_HEIGHT: f32 = 22.;
72const TYPING_DOT_SIZE: f32 = 5.;
73const TYPING_DOT_SIZE: f32 = 5.;
73const TYPING_DOT_COUNT: usize = 3;
74const TYPING_DOT_COUNT: usize = 3;
74const TYPING_PULSE_PERIOD: Duration = Duration::from_millis(1200);
75const TYPING_PULSE_PERIOD: Duration = Duration::from_millis(1200);
@@ -578,33 +579,35 @@ impl ConversationView {
578 }
579 }
579
580
580 fn render_typing_line(&self, cx: &App) -> impl IntoElement {
581 fn render_typing_line(&self, cx: &App) -> impl IntoElement {
581 let names = self
582 let app = self.app.read(cx);
583 let faces = self
582 .current
584 .current
583 .as_ref()
585 .as_ref()
584 .filter(|_| !self.draft_active)
586 .filter(|_| !self.draft_active)
585 .map(|current| {
587 .map(|current| app.typing.faces(current.selection.conversation_id()))
586 self.app
587 .read(cx)
588 .typing
589 .names(current.selection.conversation_id())
590 })
591 .unwrap_or_default();
588 .unwrap_or_default();
589 let tooltip_text = typing_tooltip(
590 &faces
591 .iter()
592 .map(|face| face.name.clone())
593 .collect::<Vec<_>>(),
594 );
592 h_flex()
595 h_flex()
593 .h(px(TYPING_LINE_HEIGHT))
596 .h(px(TYPING_LINE_HEIGHT))
594 .flex_none()
597 .flex_none()
595 .px(px(24.))
598 .px(px(24.))
596 .gap(px(6.))
599 .gap(px(6.))
597 .items_center()
600 .items_center()
598 .text_size(px(12.))
601 .when(!faces.is_empty(), |line| {
599 .text_color(theme::text_muted())
602 line.child(
600 .when(!names.is_empty(), |line| {
601 line.child(typing_dots()).child(
602 div()
603 div()
603 .flex_1()
604 .id("typing-faces")
604 .min_w_0()
605 .tooltip(move |window, cx| {
605 .truncate()
606 Tooltip::new(tooltip_text.clone()).build(window, cx)
606 .child(typing_label(&names)),
607 })
608 .child(member_stack(&app.directory, &faces, faces.len())),
607 )
609 )
610 .child(typing_dots())
608 })
611 })
609 }
612 }
610
613