BlueGit

ict rusty-teams

feat(parity): speed dial column on the Calls page

- Speed dial list stored locally, click calls, menu for video call and remove
- Add via header button or empty state, people picker
- Add to speed dial from the history row menu
- Column hidden in narrow windows

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

metis Daniel Däschle · pushed by metis

Authored 2026-11-08 · 3 weeks ago

Hash
6f3e9db5878fb9874d6039f10cb0e47412c1b786
Parent
71b93d86
7 files changed +384 −5
crates/app-base/src/assets.rs +2 −1
@@ -8,7 +8,7 @@ macro_rules! symbols {
8 8 };
9 9 }
10 10
11 const SYMBOLS: [(&str, &[u8]); 85] = symbols![
11 const SYMBOLS: [(&str, &[u8]); 86] = symbols![
12 12 "campaign",
13 13 "lock",
14 14 "bot",
@@ -67,6 +67,7 @@ const SYMBOLS: [(&str, &[u8]); 85] = symbols![
67 67 "fluent_mention",
68 68 "fluent_drafts",
69 69 "fluent_bookmark",
70 "fluent_person_add",
70 71 "fluent_record",
71 72 "fluent_record_stop",
72 73 "fluent_cloud_arrow_up",
@@ -8,7 +8,7 @@ macro_rules! symbols {
8 };
8 };
9}
9}
10
10
11const SYMBOLS: [(&str, &[u8]); 85] = symbols![
11const SYMBOLS: [(&str, &[u8]); 86] = symbols![
12 "campaign",
12 "campaign",
13 "lock",
13 "lock",
14 "bot",
14 "bot",
@@ -67,6 +67,7 @@ const SYMBOLS: [(&str, &[u8]); 85] = symbols![
67 "fluent_mention",
67 "fluent_mention",
68 "fluent_drafts",
68 "fluent_drafts",
69 "fluent_bookmark",
69 "fluent_bookmark",
70 "fluent_person_add",
70 "fluent_record",
71 "fluent_record",
71 "fluent_record_stop",
72 "fluent_record_stop",
72 "fluent_cloud_arrow_up",
73 "fluent_cloud_arrow_up",
crates/app-state/src/app_state.rs +3 −0
@@ -157,6 +157,7 @@ pub struct AppState {
157 157 pub calendar_events: Vec<chatsvc::CalendarEvent>,
158 158 pub calendar_nudge: Option<tokio::sync::mpsc::UnboundedSender<()>>,
159 159 pub calls_list: crate::call::CallsList,
160 pub speed_dial: Vec<crate::call::SpeedDialEntry>,
160 161 pub pins: HashMap<String, Vec<PinnedMessage>>,
161 162 pub post_follows: crate::post_follow::PostFollows,
162 163 pub forward_request: Option<ForwardSource>,
@@ -262,6 +263,7 @@ pub fn selection_title(sidebar: &Sidebar, selection: &Selection) -> String {
262 263 impl AppState {
263 264 pub fn new(store: Arc<Store>, mode: Mode) -> Self {
264 265 let sidebar = store.sidebar().unwrap_or_default();
266 let speed_dial = crate::call::speed_dial::load(&store);
265 267 let chat_settings = teams_core::stored_chat_settings(&store);
266 268 let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);
267 269 let actions_on_right_click =
@@ -313,6 +315,7 @@ impl AppState {
313 315 calendar_events: Vec::new(),
314 316 calendar_nudge: None,
315 317 calls_list: crate::call::CallsList::default(),
318 speed_dial,
316 319 pins: HashMap::new(),
317 320 post_follows: Default::default(),
318 321 forward_request: None,
@@ -157,6 +157,7 @@ pub struct AppState {
157 pub calendar_events: Vec<chatsvc::CalendarEvent>,
157 pub calendar_events: Vec<chatsvc::CalendarEvent>,
158 pub calendar_nudge: Option<tokio::sync::mpsc::UnboundedSender<()>>,
158 pub calendar_nudge: Option<tokio::sync::mpsc::UnboundedSender<()>>,
159 pub calls_list: crate::call::CallsList,
159 pub calls_list: crate::call::CallsList,
160 pub speed_dial: Vec<crate::call::SpeedDialEntry>,
160 pub pins: HashMap<String, Vec<PinnedMessage>>,
161 pub pins: HashMap<String, Vec<PinnedMessage>>,
161 pub post_follows: crate::post_follow::PostFollows,
162 pub post_follows: crate::post_follow::PostFollows,
162 pub forward_request: Option<ForwardSource>,
163 pub forward_request: Option<ForwardSource>,
@@ -262,6 +263,7 @@ pub fn selection_title(sidebar: &Sidebar, selection: &Selection) -> String {
262impl AppState {
263impl AppState {
263 pub fn new(store: Arc<Store>, mode: Mode) -> Self {
264 pub fn new(store: Arc<Store>, mode: Mode) -> Self {
264 let sidebar = store.sidebar().unwrap_or_default();
265 let sidebar = store.sidebar().unwrap_or_default();
266 let speed_dial = crate::call::speed_dial::load(&store);
265 let chat_settings = teams_core::stored_chat_settings(&store);
267 let chat_settings = teams_core::stored_chat_settings(&store);
266 let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);
268 let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);
267 let actions_on_right_click =
269 let actions_on_right_click =
@@ -313,6 +315,7 @@ impl AppState {
313 calendar_events: Vec::new(),
315 calendar_events: Vec::new(),
314 calendar_nudge: None,
316 calendar_nudge: None,
315 calls_list: crate::call::CallsList::default(),
317 calls_list: crate::call::CallsList::default(),
318 speed_dial,
316 pins: HashMap::new(),
319 pins: HashMap::new(),
317 post_follows: Default::default(),
320 post_follows: Default::default(),
318 forward_request: None,
321 forward_request: None,
crates/app-state/src/call/mod.rs +2 −0
@@ -16,6 +16,7 @@ pub mod remote_command;
16 16 pub mod reminder;
17 17 pub mod share_actions;
18 18 pub mod share_overlay;
19 pub mod speed_dial;
19 20 pub mod schedule;
20 21 pub mod target;
21 22 pub mod view_actions;
@@ -56,6 +57,7 @@ pub use options_dialog::OptionsDialog;
56 57 pub use prejoin::{AudioChoice, JoinOptions, PendingJoin, load_join_options};
57 58 pub use people::{PeopleSections, PersonRow, people_sections};
58 59 pub use share_actions::ZoomStep;
60 pub use speed_dial::SpeedDialEntry;
59 61 pub use share_view::{SHARE_MOTION_META_KEY, SHARE_STANDOUT_META_KEY, STRIP_DEFAULT_WIDTH, ShareStage, load_flag, load_strip_width};
60 62 pub use preview::{CameraPreview, preview_backgrounds};
61 63 pub use reminder::{MeetingToasts, ReminderPhase, subtitle as meeting_subtitle};
@@ -16,6 +16,7 @@ pub mod remote_command;
16pub mod reminder;
16pub mod reminder;
17pub mod share_actions;
17pub mod share_actions;
18pub mod share_overlay;
18pub mod share_overlay;
19pub mod speed_dial;
19pub mod schedule;
20pub mod schedule;
20pub mod target;
21pub mod target;
21pub mod view_actions;
22pub mod view_actions;
@@ -56,6 +57,7 @@ pub use options_dialog::OptionsDialog;
56pub use prejoin::{AudioChoice, JoinOptions, PendingJoin, load_join_options};
57pub use prejoin::{AudioChoice, JoinOptions, PendingJoin, load_join_options};
57pub use people::{PeopleSections, PersonRow, people_sections};
58pub use people::{PeopleSections, PersonRow, people_sections};
58pub use share_actions::ZoomStep;
59pub use share_actions::ZoomStep;
60pub use speed_dial::SpeedDialEntry;
59pub use share_view::{SHARE_MOTION_META_KEY, SHARE_STANDOUT_META_KEY, STRIP_DEFAULT_WIDTH, ShareStage, load_flag, load_strip_width};
61pub use share_view::{SHARE_MOTION_META_KEY, SHARE_STANDOUT_META_KEY, STRIP_DEFAULT_WIDTH, ShareStage, load_flag, load_strip_width};
60pub use preview::{CameraPreview, preview_backgrounds};
62pub use preview::{CameraPreview, preview_backgrounds};
61pub use reminder::{MeetingToasts, ReminderPhase, subtitle as meeting_subtitle};
63pub use reminder::{MeetingToasts, ReminderPhase, subtitle as meeting_subtitle};
crates/app-state/src/call/speed_dial.rs added +110 −0
@@ -0,0 +1,110 @@
1 use gpui_kit::Context;
2 use store::Store;
3
4 use crate::app_state::AppState;
5
6 const META_KEY: &str = "call_speed_dial";
7
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 pub struct SpeedDialEntry {
10 pub user_id: String,
11 pub name: String,
12 }
13
14 pub fn load(store: &Store) -> Vec<SpeedDialEntry> {
15 store
16 .meta(META_KEY)
17 .ok()
18 .flatten()
19 .map(|text| parse(&text))
20 .unwrap_or_default()
21 }
22
23 fn save(store: &Store, entries: &[SpeedDialEntry]) {
24 let _ = store.set_meta(META_KEY, &serialize(entries));
25 }
26
27 fn serialize(entries: &[SpeedDialEntry]) -> String {
28 entries
29 .iter()
30 .map(|entry| format!("{}\t{}", entry.user_id, entry.name.replace(['\t', '\n'], " ")))
31 .collect::<Vec<_>>()
32 .join("\n")
33 }
34
35 fn parse(text: &str) -> Vec<SpeedDialEntry> {
36 text.lines()
37 .filter_map(|line| line.split_once('\t'))
38 .filter(|(user_id, _)| !user_id.is_empty())
39 .map(|(user_id, name)| SpeedDialEntry {
40 user_id: user_id.to_owned(),
41 name: name.to_owned(),
42 })
43 .collect()
44 }
45
46 fn with_added(entries: &[SpeedDialEntry], added: SpeedDialEntry) -> Option<Vec<SpeedDialEntry>> {
47 if entries.iter().any(|entry| entry.user_id == added.user_id) {
48 return None;
49 }
50 let mut next = entries.to_vec();
51 next.push(added);
52 Some(next)
53 }
54
55 impl AppState {
56 pub fn on_speed_dial(&self, user_id: &str) -> bool {
57 self.speed_dial.iter().any(|entry| entry.user_id == user_id)
58 }
59
60 pub fn add_to_speed_dial(&mut self, user_id: &str, name: &str, cx: &mut Context<Self>) {
61 let added = SpeedDialEntry {
62 user_id: user_id.to_owned(),
63 name: name.to_owned(),
64 };
65 let Some(next) = with_added(&self.speed_dial, added) else {
66 return;
67 };
68 save(&self.store, &next);
69 self.speed_dial = next;
70 cx.notify();
71 }
72
73 pub fn remove_from_speed_dial(&mut self, user_id: &str, cx: &mut Context<Self>) {
74 self.speed_dial.retain(|entry| entry.user_id != user_id);
75 save(&self.store, &self.speed_dial);
76 cx.notify();
77 }
78 }
79
80 #[cfg(test)]
81 mod tests {
82 use super::*;
83
84 fn entry(user_id: &str, name: &str) -> SpeedDialEntry {
85 SpeedDialEntry {
86 user_id: user_id.to_owned(),
87 name: name.to_owned(),
88 }
89 }
90
91 #[test]
92 fn entries_survive_a_round_trip_in_order() {
93 let entries = vec![entry("b", "Grace\tHopper"), entry("a", "Ada Lovelace")];
94 assert_eq!(
95 parse(&serialize(&entries)),
96 [entry("b", "Grace Hopper"), entry("a", "Ada Lovelace")]
97 );
98 assert_eq!(parse("broken\n\tno id\n"), []);
99 }
100
101 #[test]
102 fn adding_a_person_twice_keeps_one_entry() {
103 let entries = vec![entry("a", "Ada")];
104 assert_eq!(with_added(&entries, entry("a", "Ada")), None);
105 assert_eq!(
106 with_added(&entries, entry("b", "Grace")),
107 Some(vec![entry("a", "Ada"), entry("b", "Grace")])
108 );
109 }
110 }
@@ -0,0 +1,110 @@
1use gpui_kit::Context;
2use store::Store;
3
4use crate::app_state::AppState;
5
6const META_KEY: &str = "call_speed_dial";
7
8#[derive(Debug, Clone, PartialEq, Eq)]
9pub struct SpeedDialEntry {
10 pub user_id: String,
11 pub name: String,
12}
13
14pub fn load(store: &Store) -> Vec<SpeedDialEntry> {
15 store
16 .meta(META_KEY)
17 .ok()
18 .flatten()
19 .map(|text| parse(&text))
20 .unwrap_or_default()
21}
22
23fn save(store: &Store, entries: &[SpeedDialEntry]) {
24 let _ = store.set_meta(META_KEY, &serialize(entries));
25}
26
27fn serialize(entries: &[SpeedDialEntry]) -> String {
28 entries
29 .iter()
30 .map(|entry| format!("{}\t{}", entry.user_id, entry.name.replace(['\t', '\n'], " ")))
31 .collect::<Vec<_>>()
32 .join("\n")
33}
34
35fn parse(text: &str) -> Vec<SpeedDialEntry> {
36 text.lines()
37 .filter_map(|line| line.split_once('\t'))
38 .filter(|(user_id, _)| !user_id.is_empty())
39 .map(|(user_id, name)| SpeedDialEntry {
40 user_id: user_id.to_owned(),
41 name: name.to_owned(),
42 })
43 .collect()
44}
45
46fn with_added(entries: &[SpeedDialEntry], added: SpeedDialEntry) -> Option<Vec<SpeedDialEntry>> {
47 if entries.iter().any(|entry| entry.user_id == added.user_id) {
48 return None;
49 }
50 let mut next = entries.to_vec();
51 next.push(added);
52 Some(next)
53}
54
55impl AppState {
56 pub fn on_speed_dial(&self, user_id: &str) -> bool {
57 self.speed_dial.iter().any(|entry| entry.user_id == user_id)
58 }
59
60 pub fn add_to_speed_dial(&mut self, user_id: &str, name: &str, cx: &mut Context<Self>) {
61 let added = SpeedDialEntry {
62 user_id: user_id.to_owned(),
63 name: name.to_owned(),
64 };
65 let Some(next) = with_added(&self.speed_dial, added) else {
66 return;
67 };
68 save(&self.store, &next);
69 self.speed_dial = next;
70 cx.notify();
71 }
72
73 pub fn remove_from_speed_dial(&mut self, user_id: &str, cx: &mut Context<Self>) {
74 self.speed_dial.retain(|entry| entry.user_id != user_id);
75 save(&self.store, &self.speed_dial);
76 cx.notify();
77 }
78}
79
80#[cfg(test)]
81mod tests {
82 use super::*;
83
84 fn entry(user_id: &str, name: &str) -> SpeedDialEntry {
85 SpeedDialEntry {
86 user_id: user_id.to_owned(),
87 name: name.to_owned(),
88 }
89 }
90
91 #[test]
92 fn entries_survive_a_round_trip_in_order() {
93 let entries = vec![entry("b", "Grace\tHopper"), entry("a", "Ada Lovelace")];
94 assert_eq!(
95 parse(&serialize(&entries)),
96 [entry("b", "Grace Hopper"), entry("a", "Ada Lovelace")]
97 );
98 assert_eq!(parse("broken\n\tno id\n"), []);
99 }
100
101 #[test]
102 fn adding_a_person_twice_keeps_one_entry() {
103 let entries = vec![entry("a", "Ada")];
104 assert_eq!(with_added(&entries, entry("a", "Ada")), None);
105 assert_eq!(
106 with_added(&entries, entry("b", "Grace")),
107 Some(vec![entry("a", "Ada"), entry("b", "Grace")])
108 );
109 }
110}
crates/app/assets/symbols/fluent_person_add.svg added +1 −0
@@ -0,0 +1 @@
1 <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM6 6a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm-2 5a2 2 0 0 0-2 2c0 1.7.83 2.97 2.13 3.8A9.14 9.14 0 0 0 9 18c.41 0 .82-.02 1.21-.06A5.5 5.5 0 0 1 9.6 17 12 12 0 0 1 9 17a8.16 8.16 0 0 1-4.33-1.05A3.36 3.36 0 0 1 3 13a1 1 0 0 1 1-1h5.6c.18-.36.4-.7.66-1H4Zm10.5 8a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Zm0-7c.28 0 .5.22.5.5V14h1.5a.5.5 0 0 1 0 1H15v1.5a.5.5 0 0 1-1 0V15h-1.5a.5.5 0 0 1 0-1H14v-1.5c0-.28.22-.5.5-.5Z"/></svg>
@@ -0,0 +1 @@
1<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM6 6a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm-2 5a2 2 0 0 0-2 2c0 1.7.83 2.97 2.13 3.8A9.14 9.14 0 0 0 9 18c.41 0 .82-.02 1.21-.06A5.5 5.5 0 0 1 9.6 17 12 12 0 0 1 9 17a8.16 8.16 0 0 1-4.33-1.05A3.36 3.36 0 0 1 3 13a1 1 0 0 1 1-1h5.6c.18-.36.4-.7.66-1H4Zm10.5 8a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Zm0-7c.28 0 .5.22.5.5V14h1.5a.5.5 0 0 1 0 1H15v1.5a.5.5 0 0 1-1 0V15h-1.5a.5.5 0 0 1 0-1H14v-1.5c0-.28.22-.5.5-.5Z"/></svg>
crates/app/src/layout_guard.rs +5 −0
@@ -276,7 +276,9 @@ mod frames {
276 276 const CALLS_TAGS: &[&str] = &[
277 277 "shell/islands/main/calls-dial",
278 278 "shell/islands/main/calls-history",
279 CALLS_SPEED_DIAL,
279 280 ];
281 const CALLS_SPEED_DIAL: &str = "shell/islands/main/calls-speed-dial";
280 282 const PREJOIN_TAGS: &[&str] = &[
281 283 "shell/islands/main/prejoin",
282 284 "shell/islands/main/prejoin/preview",
@@ -995,6 +997,9 @@ mod frames {
995 997 "calls" => {
996 998 expected.retain(|path| *path != "shell/islands/sidebar");
997 999 expected.extend(CALLS_TAGS);
1000 if !crate::views::calls_page::shows_speed_dial(width) {
1001 expected.retain(|path| *path != CALLS_SPEED_DIAL);
1002 }
998 1003 }
999 1004 "agents" => expected.push(AGENTS_LIST),
1000 1005 "calendar" => {
@@ -276,7 +276,9 @@ mod frames {
276 const CALLS_TAGS: &[&str] = &[
276 const CALLS_TAGS: &[&str] = &[
277 "shell/islands/main/calls-dial",
277 "shell/islands/main/calls-dial",
278 "shell/islands/main/calls-history",
278 "shell/islands/main/calls-history",
279 CALLS_SPEED_DIAL,
279 ];
280 ];
281 const CALLS_SPEED_DIAL: &str = "shell/islands/main/calls-speed-dial";
280 const PREJOIN_TAGS: &[&str] = &[
282 const PREJOIN_TAGS: &[&str] = &[
281 "shell/islands/main/prejoin",
283 "shell/islands/main/prejoin",
282 "shell/islands/main/prejoin/preview",
284 "shell/islands/main/prejoin/preview",
@@ -995,6 +997,9 @@ mod frames {
995 "calls" => {
997 "calls" => {
996 expected.retain(|path| *path != "shell/islands/sidebar");
998 expected.retain(|path| *path != "shell/islands/sidebar");
997 expected.extend(CALLS_TAGS);
999 expected.extend(CALLS_TAGS);
1000 if !crate::views::calls_page::shows_speed_dial(width) {
1001 expected.retain(|path| *path != CALLS_SPEED_DIAL);
1002 }
998 }
1003 }
999 "agents" => expected.push(AGENTS_LIST),
1004 "agents" => expected.push(AGENTS_LIST),
1000 "calendar" => {
1005 "calendar" => {
crates/app/src/views/calls_page.rs +261 −4
@@ -12,16 +12,26 @@ use gpui_kit::*;
12 12 use super::avatar::person_avatar;
13 13 use super::new_chat::NewChatDraft;
14 14 use super::scroll_edge::{scroll_offset, with_top_edge};
15 use super::widgets::{icon, menu_icon};
15 use super::widgets::{icon, menu_icon, symbol};
16 16 use crate::app_state::AppState;
17 use crate::call::{CALL_ROW_HEIGHT, CallRow, EMPTY_HEIGHT, HistoryFilter, ListEntry};
17 use crate::call::{
18 CALL_ROW_HEIGHT, CallRow, EMPTY_HEIGHT, HistoryFilter, ListEntry, SpeedDialEntry,
19 };
18 20 use crate::theme;
19 21
20 22 pub const CALLS_DIAL_TAG: &str = "shell/islands/main/calls-dial";
21 23 pub const CALLS_HISTORY_TAG: &str = "shell/islands/main/calls-history";
24 pub const CALLS_SPEED_DIAL_TAG: &str = "shell/islands/main/calls-speed-dial";
22 25 const CALLS_SCROLL_DIVIDER: &str = "shell/islands/main/calls-history/divider-scroll";
23 26 const CALLS_TITLE: &str = "Calls";
24 27 const HISTORY_TITLE: &str = "History";
28 const SPEED_DIAL_TITLE: &str = "Speed dial";
29 const SPEED_DIAL_EMPTY: &str = "Add people to speed dial for quick access.";
30 const SPEED_DIAL_ADD_TITLE: &str = "Add to speed dial";
31 const ADD_LABEL: &str = "Add";
32 const CANCEL_LABEL: &str = "Cancel";
33 const SPEED_DIAL_WIDTH: f32 = 340.;
34 const SPEED_DIAL_MIN_WINDOW_WIDTH: f32 = 1100.;
25 35 const CALL_LABEL: &str = "Call";
26 36 const CALL_ONE_PERSON_HINT: &str = "Pick one person to call";
27 37 const HEADER_HEIGHT: f32 = 60.;
@@ -50,6 +60,7 @@ fn call_row(
50 60 state: &Entity<AppState>,
51 61 row: &CallRow,
52 62 can_open_chat: bool,
63 on_speed_dial: bool,
53 64 directory: &crate::data::Directory,
54 65 ) -> AnyElement {
55 66 let avatar = if row.meeting {
@@ -67,6 +78,7 @@ fn call_row(
67 78 let menu_state = state.clone();
68 79 let menu_row = row.clone();
69 80 let can_call_back = !row.meeting && row.user_id.is_some();
81 let can_add_to_speed_dial = can_call_back && !on_speed_dial;
70 82 h_flex()
71 83 .id(SharedString::from(format!("call-{}", row.key)))
72 84 .h(px(CALL_ROW_HEIGHT))
@@ -124,6 +136,8 @@ fn call_row(
124 136 let call_row = menu_row.clone();
125 137 let chat_state = menu_state.clone();
126 138 let chat_row = menu_row.clone();
139 let dial_state = menu_state.clone();
140 let dial_row = menu_row.clone();
127 141 popup
128 142 .when(can_call_back, |popup| {
129 143 popup.item(
@@ -147,6 +161,20 @@ fn call_row(
147 161 }),
148 162 )
149 163 })
164 .when(can_add_to_speed_dial, |popup| {
165 popup.item(
166 PopupMenuItem::new(SPEED_DIAL_ADD_TITLE)
167 .icon(menu_icon(IconName::Star))
168 .on_click(move |_, _, cx| {
169 let Some(user_id) = dial_row.user_id.as_deref() else {
170 return;
171 };
172 dial_state.update(cx, |state, cx| {
173 state.add_to_speed_dial(user_id, &dial_row.title, cx)
174 });
175 }),
176 )
177 })
150 178 })
151 179 .into_any_element()
152 180 }
@@ -193,20 +221,95 @@ fn empty_row(text: &'static str) -> AnyElement {
193 221 .into_any_element()
194 222 }
195 223
224 fn speed_dial_row(
225 state: &Entity<AppState>,
226 entry: &SpeedDialEntry,
227 directory: &crate::data::Directory,
228 ) -> AnyElement {
229 let click_state = state.clone();
230 let user_id = entry.user_id.clone();
231 let menu_state = state.clone();
232 let menu_user_id = entry.user_id.clone();
233 h_flex()
234 .id(SharedString::from(format!("speed-dial-{}", entry.user_id)))
235 .h(px(CALL_ROW_HEIGHT))
236 .flex_none()
237 .px(px(10.))
238 .gap(px(12.))
239 .items_center()
240 .rounded(px(8.))
241 .cursor_pointer()
242 .hover(|row| row.bg(theme::row_hover()))
243 .child(person_avatar(
244 directory,
245 Some(&entry.user_id),
246 &entry.name,
247 AVATAR_SIZE,
248 ))
249 .child(
250 div()
251 .flex_1()
252 .min_w_0()
253 .truncate()
254 .text_size(px(14.))
255 .text_color(theme::text())
256 .child(entry.name.clone()),
257 )
258 .on_click(move |_, _, cx| {
259 click_state.update(cx, |state, cx| state.call_person(&user_id, false, cx));
260 })
261 .context_menu(move |popup, _, _| {
262 let video_state = menu_state.clone();
263 let video_user_id = menu_user_id.clone();
264 let remove_state = menu_state.clone();
265 let remove_user_id = menu_user_id.clone();
266 popup
267 .item(
268 PopupMenuItem::new("Video call")
269 .icon(menu_icon(IconName::Video))
270 .on_click(move |_, _, cx| {
271 video_state.update(cx, |state, cx| {
272 state.call_person(&video_user_id, true, cx)
273 });
274 }),
275 )
276 .item(
277 PopupMenuItem::new("Remove from speed dial")
278 .icon(menu_icon(IconName::Delete))
279 .on_click(move |_, _, cx| {
280 remove_state.update(cx, |state, cx| {
281 state.remove_from_speed_dial(&remove_user_id, cx)
282 });
283 }),
284 )
285 })
286 .into_any_element()
287 }
288
289 pub fn shows_speed_dial(window_width: f32) -> bool {
290 window_width >= SPEED_DIAL_MIN_WINDOW_WIDTH
291 }
292
196 293 pub struct CallsPage {
197 294 app: Entity<AppState>,
198 295 people: Entity<NewChatDraft>,
296 speed_dial_people: Entity<NewChatDraft>,
297 adding_speed_dial: bool,
199 298 scroll: ScrollHandle,
200 _observations: [Subscription; 2],
299 _observations: [Subscription; 3],
201 300 }
202 301
203 302 impl CallsPage {
204 303 pub fn new(app: Entity<AppState>, window: &mut Window, cx: &mut Context<Self>) -> Self {
205 304 let people_app = app.clone();
206 305 let people = cx.new(|cx| NewChatDraft::new(people_app, window, cx).compact());
306 let speed_dial_app = app.clone();
307 let speed_dial_people =
308 cx.new(|cx| NewChatDraft::new(speed_dial_app, window, cx).compact());
207 309 let observations = [
208 310 cx.observe(&app, |_, _, cx| cx.notify()),
209 311 cx.observe(&people, |_, _, cx| cx.notify()),
312 cx.observe(&speed_dial_people, |_, _, cx| cx.notify()),
210 313 ];
211 314 cx.spawn(async move |this, cx| {
212 315 loop {
@@ -220,6 +323,8 @@ impl CallsPage {
220 323 CallsPage {
221 324 app,
222 325 people,
326 speed_dial_people,
327 adding_speed_dial: false,
223 328 scroll: ScrollHandle::new(),
224 329 _observations: observations,
225 330 }
@@ -237,6 +342,149 @@ impl CallsPage {
237 342 .update(cx, |people, cx| people.reset(window, cx));
238 343 }
239 344
345 fn open_speed_dial_add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
346 self.adding_speed_dial = true;
347 self.speed_dial_people
348 .update(cx, |people, cx| people.focus_query(window, cx));
349 cx.notify();
350 }
351
352 fn close_speed_dial_add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
353 self.adding_speed_dial = false;
354 self.speed_dial_people
355 .update(cx, |people, cx| people.reset(window, cx));
356 cx.notify();
357 }
358
359 fn confirm_speed_dial_add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
360 let picked = self.speed_dial_people.read(cx).chips().to_vec();
361 self.app.update(cx, |state, cx| {
362 for person in &picked {
363 state.add_to_speed_dial(&person.user_id, &person.name, cx);
364 }
365 });
366 self.close_speed_dial_add(window, cx);
367 }
368
369 fn speed_dial_adder(&self, cx: &mut Context<Self>) -> Div {
370 let picked = !self.speed_dial_people.read(cx).chips().is_empty();
371 v_flex()
372 .gap(px(12.))
373 .child(self.speed_dial_people.clone())
374 .child(
375 h_flex()
376 .gap(px(8.))
377 .justify_end()
378 .child(
379 Button::new("speed-dial-cancel")
380 .label(CANCEL_LABEL)
381 .on_click(cx.listener(|this, _, window, cx| {
382 this.close_speed_dial_add(window, cx)
383 })),
384 )
385 .child(
386 Button::new("speed-dial-confirm")
387 .label(ADD_LABEL)
388 .when(picked, |button| button.primary())
389 .disabled(!picked)
390 .on_click(cx.listener(|this, _, window, cx| {
391 this.confirm_speed_dial_add(window, cx)
392 })),
393 ),
394 )
395 }
396
397 fn speed_dial_empty(&self, cx: &mut Context<Self>) -> Div {
398 v_flex()
399 .flex_1()
400 .items_center()
401 .justify_center()
402 .gap(px(12.))
403 .child(
404 div()
405 .text_size(px(13.))
406 .text_color(theme::text_muted())
407 .child(SPEED_DIAL_EMPTY),
408 )
409 .child(
410 Button::new("speed-dial-empty-add")
411 .label(ADD_LABEL)
412 .on_click(cx.listener(|this, _, window, cx| {
413 this.open_speed_dial_add(window, cx)
414 })),
415 )
416 }
417
418 fn speed_dial_column(&self, cx: &mut Context<Self>) -> Div {
419 let state = self.app.read(cx);
420 let rows = state
421 .speed_dial
422 .iter()
423 .map(|entry| speed_dial_row(&self.app, entry, &state.directory))
424 .collect::<Vec<_>>();
425 let body = if self.adding_speed_dial {
426 div()
427 .p(px(PAGE_PADDING))
428 .child(self.speed_dial_adder(cx))
429 } else if rows.is_empty() {
430 self.speed_dial_empty(cx)
431 } else {
432 div().child(
433 div()
434 .id("calls-speed-dial-scroll")
435 .size_full()
436 .overflow_y_scrollbar()
437 .child(
438 v_flex()
439 .px(px(PAGE_PADDING - 10.))
440 .py(px(8.))
441 .children(rows),
442 ),
443 )
444 };
445 v_flex()
446 .debug_selector(|| CALLS_SPEED_DIAL_TAG.into())
447 .w(px(SPEED_DIAL_WIDTH))
448 .h_full()
449 .flex_none()
450 .child(
451 h_flex()
452 .h(px(HISTORY_HEADER_HEIGHT))
453 .flex_none()
454 .pl(px(PAGE_PADDING))
455 .pr(px(PAGE_PADDING - 6.))
456 .items_center()
457 .justify_between()
458 .child(
459 div()
460 .text_size(px(14.))
461 .font_weight(FontWeight::SEMIBOLD)
462 .text_color(theme::text())
463 .child(SPEED_DIAL_TITLE),
464 )
465 .child(
466 div()
467 .id("speed-dial-add")
468 .size(px(28.))
469 .flex()
470 .items_center()
471 .justify_center()
472 .rounded(px(6.))
473 .cursor_pointer()
474 .hover(|button| button.bg(theme::row_hover()))
475 .tooltip(|window, cx| {
476 gpui_kit::component::tooltip::Tooltip::new(SPEED_DIAL_ADD_TITLE)
477 .build(window, cx)
478 })
479 .child(symbol("fluent_person_add", 18., theme::text_soft()))
480 .on_click(cx.listener(|this, _, window, cx| {
481 this.open_speed_dial_add(window, cx)
482 })),
483 ),
484 )
485 .child(body.flex_1().min_h_0())
486 }
487
240 488 fn dial_column(&self, cx: &mut Context<Self>) -> Div {
241 489 let picked = self.people.read(cx).chips().len();
242 490 let callable = picked == 1;
@@ -290,6 +538,9 @@ impl CallsPage {
290 538 &self.app,
291 539 row,
292 540 state.can_open_chat_of_call_row(row),
541 row.user_id
542 .as_deref()
543 .is_some_and(|user_id| state.on_speed_dial(user_id)),
293 544 &state.directory,
294 545 ),
295 546 });
@@ -340,6 +591,7 @@ impl CallsPage {
340 591 impl Render for CallsPage {
341 592 fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
342 593 let window_height = f32::from(window.viewport_size().height);
594 let window_width = f32::from(window.viewport_size().width);
343 595 v_flex()
344 596 .debug_selector(|| "shell/islands/main".into())
345 597 .flex_1()
@@ -371,7 +623,12 @@ impl Render for CallsPage {
371 623 .w_full()
372 624 .child(self.dial_column(cx))
373 625 .child(div().w(px(1.)).h_full().flex_none().bg(theme::border()))
374 .child(self.history_column(window_height, cx)),
626 .child(self.history_column(window_height, cx))
627 .when(shows_speed_dial(window_width), |columns| {
628 columns
629 .child(div().w(px(1.)).h_full().flex_none().bg(theme::border()))
630 .child(self.speed_dial_column(cx))
631 }),
375 632 )
376 633 }
377 634 }
@@ -12,16 +12,26 @@ use gpui_kit::*;
12use super::avatar::person_avatar;
12use super::avatar::person_avatar;
13use super::new_chat::NewChatDraft;
13use super::new_chat::NewChatDraft;
14use super::scroll_edge::{scroll_offset, with_top_edge};
14use super::scroll_edge::{scroll_offset, with_top_edge};
15use super::widgets::{icon, menu_icon};
15use super::widgets::{icon, menu_icon, symbol};
16use crate::app_state::AppState;
16use crate::app_state::AppState;
17use crate::call::{CALL_ROW_HEIGHT, CallRow, EMPTY_HEIGHT, HistoryFilter, ListEntry};
17use crate::call::{
18 CALL_ROW_HEIGHT, CallRow, EMPTY_HEIGHT, HistoryFilter, ListEntry, SpeedDialEntry,
19};
18use crate::theme;
20use crate::theme;
19
21
20pub const CALLS_DIAL_TAG: &str = "shell/islands/main/calls-dial";
22pub const CALLS_DIAL_TAG: &str = "shell/islands/main/calls-dial";
21pub const CALLS_HISTORY_TAG: &str = "shell/islands/main/calls-history";
23pub const CALLS_HISTORY_TAG: &str = "shell/islands/main/calls-history";
24pub const CALLS_SPEED_DIAL_TAG: &str = "shell/islands/main/calls-speed-dial";
22const CALLS_SCROLL_DIVIDER: &str = "shell/islands/main/calls-history/divider-scroll";
25const CALLS_SCROLL_DIVIDER: &str = "shell/islands/main/calls-history/divider-scroll";
23const CALLS_TITLE: &str = "Calls";
26const CALLS_TITLE: &str = "Calls";
24const HISTORY_TITLE: &str = "History";
27const HISTORY_TITLE: &str = "History";
28const SPEED_DIAL_TITLE: &str = "Speed dial";
29const SPEED_DIAL_EMPTY: &str = "Add people to speed dial for quick access.";
30const SPEED_DIAL_ADD_TITLE: &str = "Add to speed dial";
31const ADD_LABEL: &str = "Add";
32const CANCEL_LABEL: &str = "Cancel";
33const SPEED_DIAL_WIDTH: f32 = 340.;
34const SPEED_DIAL_MIN_WINDOW_WIDTH: f32 = 1100.;
25const CALL_LABEL: &str = "Call";
35const CALL_LABEL: &str = "Call";
26const CALL_ONE_PERSON_HINT: &str = "Pick one person to call";
36const CALL_ONE_PERSON_HINT: &str = "Pick one person to call";
27const HEADER_HEIGHT: f32 = 60.;
37const HEADER_HEIGHT: f32 = 60.;
@@ -50,6 +60,7 @@ fn call_row(
50 state: &Entity<AppState>,
60 state: &Entity<AppState>,
51 row: &CallRow,
61 row: &CallRow,
52 can_open_chat: bool,
62 can_open_chat: bool,
63 on_speed_dial: bool,
53 directory: &crate::data::Directory,
64 directory: &crate::data::Directory,
54) -> AnyElement {
65) -> AnyElement {
55 let avatar = if row.meeting {
66 let avatar = if row.meeting {
@@ -67,6 +78,7 @@ fn call_row(
67 let menu_state = state.clone();
78 let menu_state = state.clone();
68 let menu_row = row.clone();
79 let menu_row = row.clone();
69 let can_call_back = !row.meeting && row.user_id.is_some();
80 let can_call_back = !row.meeting && row.user_id.is_some();
81 let can_add_to_speed_dial = can_call_back && !on_speed_dial;
70 h_flex()
82 h_flex()
71 .id(SharedString::from(format!("call-{}", row.key)))
83 .id(SharedString::from(format!("call-{}", row.key)))
72 .h(px(CALL_ROW_HEIGHT))
84 .h(px(CALL_ROW_HEIGHT))
@@ -124,6 +136,8 @@ fn call_row(
124 let call_row = menu_row.clone();
136 let call_row = menu_row.clone();
125 let chat_state = menu_state.clone();
137 let chat_state = menu_state.clone();
126 let chat_row = menu_row.clone();
138 let chat_row = menu_row.clone();
139 let dial_state = menu_state.clone();
140 let dial_row = menu_row.clone();
127 popup
141 popup
128 .when(can_call_back, |popup| {
142 .when(can_call_back, |popup| {
129 popup.item(
143 popup.item(
@@ -147,6 +161,20 @@ fn call_row(
147 }),
161 }),
148 )
162 )
149 })
163 })
164 .when(can_add_to_speed_dial, |popup| {
165 popup.item(
166 PopupMenuItem::new(SPEED_DIAL_ADD_TITLE)
167 .icon(menu_icon(IconName::Star))
168 .on_click(move |_, _, cx| {
169 let Some(user_id) = dial_row.user_id.as_deref() else {
170 return;
171 };
172 dial_state.update(cx, |state, cx| {
173 state.add_to_speed_dial(user_id, &dial_row.title, cx)
174 });
175 }),
176 )
177 })
150 })
178 })
151 .into_any_element()
179 .into_any_element()
152}
180}
@@ -193,20 +221,95 @@ fn empty_row(text: &'static str) -> AnyElement {
193 .into_any_element()
221 .into_any_element()
194}
222}
195
223
224fn speed_dial_row(
225 state: &Entity<AppState>,
226 entry: &SpeedDialEntry,
227 directory: &crate::data::Directory,
228) -> AnyElement {
229 let click_state = state.clone();
230 let user_id = entry.user_id.clone();
231 let menu_state = state.clone();
232 let menu_user_id = entry.user_id.clone();
233 h_flex()
234 .id(SharedString::from(format!("speed-dial-{}", entry.user_id)))
235 .h(px(CALL_ROW_HEIGHT))
236 .flex_none()
237 .px(px(10.))
238 .gap(px(12.))
239 .items_center()
240 .rounded(px(8.))
241 .cursor_pointer()
242 .hover(|row| row.bg(theme::row_hover()))
243 .child(person_avatar(
244 directory,
245 Some(&entry.user_id),
246 &entry.name,
247 AVATAR_SIZE,
248 ))
249 .child(
250 div()
251 .flex_1()
252 .min_w_0()
253 .truncate()
254 .text_size(px(14.))
255 .text_color(theme::text())
256 .child(entry.name.clone()),
257 )
258 .on_click(move |_, _, cx| {
259 click_state.update(cx, |state, cx| state.call_person(&user_id, false, cx));
260 })
261 .context_menu(move |popup, _, _| {
262 let video_state = menu_state.clone();
263 let video_user_id = menu_user_id.clone();
264 let remove_state = menu_state.clone();
265 let remove_user_id = menu_user_id.clone();
266 popup
267 .item(
268 PopupMenuItem::new("Video call")
269 .icon(menu_icon(IconName::Video))
270 .on_click(move |_, _, cx| {
271 video_state.update(cx, |state, cx| {
272 state.call_person(&video_user_id, true, cx)
273 });
274 }),
275 )
276 .item(
277 PopupMenuItem::new("Remove from speed dial")
278 .icon(menu_icon(IconName::Delete))
279 .on_click(move |_, _, cx| {
280 remove_state.update(cx, |state, cx| {
281 state.remove_from_speed_dial(&remove_user_id, cx)
282 });
283 }),
284 )
285 })
286 .into_any_element()
287}
288
289pub fn shows_speed_dial(window_width: f32) -> bool {
290 window_width >= SPEED_DIAL_MIN_WINDOW_WIDTH
291}
292
196pub struct CallsPage {
293pub struct CallsPage {
197 app: Entity<AppState>,
294 app: Entity<AppState>,
198 people: Entity<NewChatDraft>,
295 people: Entity<NewChatDraft>,
296 speed_dial_people: Entity<NewChatDraft>,
297 adding_speed_dial: bool,
199 scroll: ScrollHandle,
298 scroll: ScrollHandle,
200 _observations: [Subscription; 2],
299 _observations: [Subscription; 3],
201}
300}
202
301
203impl CallsPage {
302impl CallsPage {
204 pub fn new(app: Entity<AppState>, window: &mut Window, cx: &mut Context<Self>) -> Self {
303 pub fn new(app: Entity<AppState>, window: &mut Window, cx: &mut Context<Self>) -> Self {
205 let people_app = app.clone();
304 let people_app = app.clone();
206 let people = cx.new(|cx| NewChatDraft::new(people_app, window, cx).compact());
305 let people = cx.new(|cx| NewChatDraft::new(people_app, window, cx).compact());
306 let speed_dial_app = app.clone();
307 let speed_dial_people =
308 cx.new(|cx| NewChatDraft::new(speed_dial_app, window, cx).compact());
207 let observations = [
309 let observations = [
208 cx.observe(&app, |_, _, cx| cx.notify()),
310 cx.observe(&app, |_, _, cx| cx.notify()),
209 cx.observe(&people, |_, _, cx| cx.notify()),
311 cx.observe(&people, |_, _, cx| cx.notify()),
312 cx.observe(&speed_dial_people, |_, _, cx| cx.notify()),
210 ];
313 ];
211 cx.spawn(async move |this, cx| {
314 cx.spawn(async move |this, cx| {
212 loop {
315 loop {
@@ -220,6 +323,8 @@ impl CallsPage {
220 CallsPage {
323 CallsPage {
221 app,
324 app,
222 people,
325 people,
326 speed_dial_people,
327 adding_speed_dial: false,
223 scroll: ScrollHandle::new(),
328 scroll: ScrollHandle::new(),
224 _observations: observations,
329 _observations: observations,
225 }
330 }
@@ -237,6 +342,149 @@ impl CallsPage {
237 .update(cx, |people, cx| people.reset(window, cx));
342 .update(cx, |people, cx| people.reset(window, cx));
238 }
343 }
239
344
345 fn open_speed_dial_add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
346 self.adding_speed_dial = true;
347 self.speed_dial_people
348 .update(cx, |people, cx| people.focus_query(window, cx));
349 cx.notify();
350 }
351
352 fn close_speed_dial_add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
353 self.adding_speed_dial = false;
354 self.speed_dial_people
355 .update(cx, |people, cx| people.reset(window, cx));
356 cx.notify();
357 }
358
359 fn confirm_speed_dial_add(&mut self, window: &mut Window, cx: &mut Context<Self>) {
360 let picked = self.speed_dial_people.read(cx).chips().to_vec();
361 self.app.update(cx, |state, cx| {
362 for person in &picked {
363 state.add_to_speed_dial(&person.user_id, &person.name, cx);
364 }
365 });
366 self.close_speed_dial_add(window, cx);
367 }
368
369 fn speed_dial_adder(&self, cx: &mut Context<Self>) -> Div {
370 let picked = !self.speed_dial_people.read(cx).chips().is_empty();
371 v_flex()
372 .gap(px(12.))
373 .child(self.speed_dial_people.clone())
374 .child(
375 h_flex()
376 .gap(px(8.))
377 .justify_end()
378 .child(
379 Button::new("speed-dial-cancel")
380 .label(CANCEL_LABEL)
381 .on_click(cx.listener(|this, _, window, cx| {
382 this.close_speed_dial_add(window, cx)
383 })),
384 )
385 .child(
386 Button::new("speed-dial-confirm")
387 .label(ADD_LABEL)
388 .when(picked, |button| button.primary())
389 .disabled(!picked)
390 .on_click(cx.listener(|this, _, window, cx| {
391 this.confirm_speed_dial_add(window, cx)
392 })),
393 ),
394 )
395 }
396
397 fn speed_dial_empty(&self, cx: &mut Context<Self>) -> Div {
398 v_flex()
399 .flex_1()
400 .items_center()
401 .justify_center()
402 .gap(px(12.))
403 .child(
404 div()
405 .text_size(px(13.))
406 .text_color(theme::text_muted())
407 .child(SPEED_DIAL_EMPTY),
408 )
409 .child(
410 Button::new("speed-dial-empty-add")
411 .label(ADD_LABEL)
412 .on_click(cx.listener(|this, _, window, cx| {
413 this.open_speed_dial_add(window, cx)
414 })),
415 )
416 }
417
418 fn speed_dial_column(&self, cx: &mut Context<Self>) -> Div {
419 let state = self.app.read(cx);
420 let rows = state
421 .speed_dial
422 .iter()
423 .map(|entry| speed_dial_row(&self.app, entry, &state.directory))
424 .collect::<Vec<_>>();
425 let body = if self.adding_speed_dial {
426 div()
427 .p(px(PAGE_PADDING))
428 .child(self.speed_dial_adder(cx))
429 } else if rows.is_empty() {
430 self.speed_dial_empty(cx)
431 } else {
432 div().child(
433 div()
434 .id("calls-speed-dial-scroll")
435 .size_full()
436 .overflow_y_scrollbar()
437 .child(
438 v_flex()
439 .px(px(PAGE_PADDING - 10.))
440 .py(px(8.))
441 .children(rows),
442 ),
443 )
444 };
445 v_flex()
446 .debug_selector(|| CALLS_SPEED_DIAL_TAG.into())
447 .w(px(SPEED_DIAL_WIDTH))
448 .h_full()
449 .flex_none()
450 .child(
451 h_flex()
452 .h(px(HISTORY_HEADER_HEIGHT))
453 .flex_none()
454 .pl(px(PAGE_PADDING))
455 .pr(px(PAGE_PADDING - 6.))
456 .items_center()
457 .justify_between()
458 .child(
459 div()
460 .text_size(px(14.))
461 .font_weight(FontWeight::SEMIBOLD)
462 .text_color(theme::text())
463 .child(SPEED_DIAL_TITLE),
464 )
465 .child(
466 div()
467 .id("speed-dial-add")
468 .size(px(28.))
469 .flex()
470 .items_center()
471 .justify_center()
472 .rounded(px(6.))
473 .cursor_pointer()
474 .hover(|button| button.bg(theme::row_hover()))
475 .tooltip(|window, cx| {
476 gpui_kit::component::tooltip::Tooltip::new(SPEED_DIAL_ADD_TITLE)
477 .build(window, cx)
478 })
479 .child(symbol("fluent_person_add", 18., theme::text_soft()))
480 .on_click(cx.listener(|this, _, window, cx| {
481 this.open_speed_dial_add(window, cx)
482 })),
483 ),
484 )
485 .child(body.flex_1().min_h_0())
486 }
487
240 fn dial_column(&self, cx: &mut Context<Self>) -> Div {
488 fn dial_column(&self, cx: &mut Context<Self>) -> Div {
241 let picked = self.people.read(cx).chips().len();
489 let picked = self.people.read(cx).chips().len();
242 let callable = picked == 1;
490 let callable = picked == 1;
@@ -290,6 +538,9 @@ impl CallsPage {
290 &self.app,
538 &self.app,
291 row,
539 row,
292 state.can_open_chat_of_call_row(row),
540 state.can_open_chat_of_call_row(row),
541 row.user_id
542 .as_deref()
543 .is_some_and(|user_id| state.on_speed_dial(user_id)),
293 &state.directory,
544 &state.directory,
294 ),
545 ),
295 });
546 });
@@ -340,6 +591,7 @@ impl CallsPage {
340impl Render for CallsPage {
591impl Render for CallsPage {
341 fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
592 fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
342 let window_height = f32::from(window.viewport_size().height);
593 let window_height = f32::from(window.viewport_size().height);
594 let window_width = f32::from(window.viewport_size().width);
343 v_flex()
595 v_flex()
344 .debug_selector(|| "shell/islands/main".into())
596 .debug_selector(|| "shell/islands/main".into())
345 .flex_1()
597 .flex_1()
@@ -371,7 +623,12 @@ impl Render for CallsPage {
371 .w_full()
623 .w_full()
372 .child(self.dial_column(cx))
624 .child(self.dial_column(cx))
373 .child(div().w(px(1.)).h_full().flex_none().bg(theme::border()))
625 .child(div().w(px(1.)).h_full().flex_none().bg(theme::border()))
374 .child(self.history_column(window_height, cx)),
626 .child(self.history_column(window_height, cx))
627 .when(shows_speed_dial(window_width), |columns| {
628 columns
629 .child(div().w(px(1.)).h_full().flex_none().bg(theme::border()))
630 .child(self.speed_dial_column(cx))
631 }),
375 )
632 )
376 }
633 }
377}
634}