BlueGit

ict rusty-teams

chore(calls): remove the Teams on the web call path

- calls and meetings always use the own engine
- setting "Use Teams on the web for calls and meetings" and the call window are gone
- --join no longer falls back to a web call

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

metis Daniel Däschle · pushed by metis

Authored 2026-11-09 · 3 weeks ago

Hash
35601c62a29b33bf14946e9f003c7740ee2d879a
Parent
a528c980
11 files changed +5 −189
crates/app-state/src/app_state.rs +0 −5
@@ -185,8 +185,6 @@ pub struct AppState {
185 185 pub chat_settings: teams_core::ChatSettingsDocument,
186 186 pub markdown_mode: bool,
187 187 pub actions_on_right_click: bool,
188 pub web_calls: bool,
189 pub own_engine_next_call: bool,
190 188 pub demo_chat_desktop: HashMap<String, teams_core::DesktopNotifications>,
191 189 pub own_tenant: Option<String>,
192 190 pub call_share_motion: bool,
@@ -270,7 +268,6 @@ impl AppState {
270 268 let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);
271 269 let actions_on_right_click =
272 270 crate::chat_settings_actions::stored_actions_on_right_click(&store);
273 let web_calls = crate::call::web_call::stored_web_calls(&store);
274 271 let mut state = AppState {
275 272 store,
276 273 engine: None,
@@ -345,8 +342,6 @@ impl AppState {
345 342 chat_settings,
346 343 markdown_mode,
347 344 actions_on_right_click,
348 web_calls,
349 own_engine_next_call: false,
350 345 demo_chat_desktop: HashMap::new(),
351 346 own_tenant: None,
352 347 call_share_motion: false,
@@ -185,8 +185,6 @@ pub struct AppState {
185 pub chat_settings: teams_core::ChatSettingsDocument,
185 pub chat_settings: teams_core::ChatSettingsDocument,
186 pub markdown_mode: bool,
186 pub markdown_mode: bool,
187 pub actions_on_right_click: bool,
187 pub actions_on_right_click: bool,
188 pub web_calls: bool,
189 pub own_engine_next_call: bool,
190 pub demo_chat_desktop: HashMap<String, teams_core::DesktopNotifications>,
188 pub demo_chat_desktop: HashMap<String, teams_core::DesktopNotifications>,
191 pub own_tenant: Option<String>,
189 pub own_tenant: Option<String>,
192 pub call_share_motion: bool,
190 pub call_share_motion: bool,
@@ -270,7 +268,6 @@ impl AppState {
270 let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);
268 let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);
271 let actions_on_right_click =
269 let actions_on_right_click =
272 crate::chat_settings_actions::stored_actions_on_right_click(&store);
270 crate::chat_settings_actions::stored_actions_on_right_click(&store);
273 let web_calls = crate::call::web_call::stored_web_calls(&store);
274 let mut state = AppState {
271 let mut state = AppState {
275 store,
272 store,
276 engine: None,
273 engine: None,
@@ -345,8 +342,6 @@ impl AppState {
345 chat_settings,
342 chat_settings,
346 markdown_mode,
343 markdown_mode,
347 actions_on_right_click,
344 actions_on_right_click,
348 web_calls,
349 own_engine_next_call: false,
350 demo_chat_desktop: HashMap::new(),
345 demo_chat_desktop: HashMap::new(),
351 own_tenant: None,
346 own_tenant: None,
352 call_share_motion: false,
347 call_share_motion: false,
crates/app-state/src/call/actions.rs +0 −6
@@ -148,9 +148,6 @@ impl AppState {
148 148 self.start_test_call(cx);
149 149 return;
150 150 }
151 if self.try_web_call(super::web_call::chat_web_url(conversation_id), cx) {
152 return;
153 }
154 151 let chat = self.sidebar.chats.iter().find(|chat| chat.id == conversation_id);
155 152 let plan = chat.and_then(|chat| plan_for_chat(chat, self.directory.me.as_ref()));
156 153 let Some(plan) = plan else {
@@ -199,9 +196,6 @@ impl AppState {
199 196 self.raise_notice(MEETING_UNAVAILABLE_NOTICE.to_owned(), None, cx);
200 197 return;
201 198 };
202 if self.try_web_call(super::web_call::meeting_web_url(&target), cx) {
203 return;
204 }
205 199 let demo = DemoMeeting {
206 200 guests: if conversation_id == DEMO_LOBBY_MEETING {
207 201 DEMO_SMALL_MEETING
@@ -148,9 +148,6 @@ impl AppState {
148 self.start_test_call(cx);
148 self.start_test_call(cx);
149 return;
149 return;
150 }
150 }
151 if self.try_web_call(super::web_call::chat_web_url(conversation_id), cx) {
152 return;
153 }
154 let chat = self.sidebar.chats.iter().find(|chat| chat.id == conversation_id);
151 let chat = self.sidebar.chats.iter().find(|chat| chat.id == conversation_id);
155 let plan = chat.and_then(|chat| plan_for_chat(chat, self.directory.me.as_ref()));
152 let plan = chat.and_then(|chat| plan_for_chat(chat, self.directory.me.as_ref()));
156 let Some(plan) = plan else {
153 let Some(plan) = plan else {
@@ -199,9 +196,6 @@ impl AppState {
199 self.raise_notice(MEETING_UNAVAILABLE_NOTICE.to_owned(), None, cx);
196 self.raise_notice(MEETING_UNAVAILABLE_NOTICE.to_owned(), None, cx);
200 return;
197 return;
201 };
198 };
202 if self.try_web_call(super::web_call::meeting_web_url(&target), cx) {
203 return;
204 }
205 let demo = DemoMeeting {
199 let demo = DemoMeeting {
206 guests: if conversation_id == DEMO_LOBBY_MEETING {
200 guests: if conversation_id == DEMO_LOBBY_MEETING {
207 DEMO_SMALL_MEETING
201 DEMO_SMALL_MEETING
crates/app-state/src/call/join.rs +0 −3
@@ -45,9 +45,6 @@ impl AppState {
45 45 self.show_call(true, cx);
46 46 return;
47 47 }
48 if self.try_web_call(super::web_call::meeting_web_url(&target), cx) {
49 return;
50 }
51 48 let title = selection_for(&self.sidebar, &target.thread_id)
52 49 .map(|selection| selection_title(&self.sidebar, &selection))
53 50 .unwrap_or_else(|| MEETING_TITLE.to_owned());
@@ -45,9 +45,6 @@ impl AppState {
45 self.show_call(true, cx);
45 self.show_call(true, cx);
46 return;
46 return;
47 }
47 }
48 if self.try_web_call(super::web_call::meeting_web_url(&target), cx) {
49 return;
50 }
51 let title = selection_for(&self.sidebar, &target.thread_id)
48 let title = selection_for(&self.sidebar, &target.thread_id)
52 .map(|selection| selection_title(&self.sidebar, &selection))
49 .map(|selection| selection_title(&self.sidebar, &selection))
53 .unwrap_or_else(|| MEETING_TITLE.to_owned());
50 .unwrap_or_else(|| MEETING_TITLE.to_owned());
crates/app-state/src/call/mod.rs +0 −1
@@ -20,7 +20,6 @@ pub mod speed_dial;
20 20 pub mod schedule;
21 21 pub mod target;
22 22 pub mod view_actions;
23 pub mod web_call;
24 23 pub mod week;
25 24
26 25 pub use app_call_model::{
@@ -20,7 +20,6 @@ pub mod speed_dial;
20pub mod schedule;
20pub mod schedule;
21pub mod target;
21pub mod target;
22pub mod view_actions;
22pub mod view_actions;
23pub mod web_call;
24pub mod week;
23pub mod week;
25
24
26pub use app_call_model::{
25pub use app_call_model::{
crates/app-state/src/call/remote_command.rs +0 −2
@@ -97,9 +97,7 @@ impl AppState {
97 97 pub fn run_remote_command(&mut self, text: &str, cx: &mut Context<Self>) {
98 98 match RemoteCommand::decode(text) {
99 99 Some(RemoteCommand::Join(link)) => {
100 self.own_engine_next_call = true;
101 100 self.join_link(&link, JoinMode::Direct, cx);
102 self.own_engine_next_call = false;
103 101 }
104 102 Some(RemoteCommand::HangUp) => self.leave_call(cx),
105 103 Some(RemoteCommand::AdmitAll) => self.admit_all_call_guests(cx),
@@ -97,9 +97,7 @@ impl AppState {
97 pub fn run_remote_command(&mut self, text: &str, cx: &mut Context<Self>) {
97 pub fn run_remote_command(&mut self, text: &str, cx: &mut Context<Self>) {
98 match RemoteCommand::decode(text) {
98 match RemoteCommand::decode(text) {
99 Some(RemoteCommand::Join(link)) => {
99 Some(RemoteCommand::Join(link)) => {
100 self.own_engine_next_call = true;
101 self.join_link(&link, JoinMode::Direct, cx);
100 self.join_link(&link, JoinMode::Direct, cx);
102 self.own_engine_next_call = false;
103 }
101 }
104 Some(RemoteCommand::HangUp) => self.leave_call(cx),
102 Some(RemoteCommand::HangUp) => self.leave_call(cx),
105 Some(RemoteCommand::AdmitAll) => self.admit_all_call_guests(cx),
103 Some(RemoteCommand::AdmitAll) => self.admit_all_call_guests(cx),
crates/app-state/src/call/web_call.rs deleted +0 −98
@@ -1,98 +0,0 @@
1 use calling::MeetingTarget;
2 use gpui_kit::*;
3 use serde_json::json;
4
5 use crate::app_state::AppState;
6
7 pub const META_WEB_CALLS: &str = "calls.teams_web";
8 const TEAMS_WEB: &str = "https://teams.microsoft.com/l";
9 const WEB_CALL_TITLE: &str = "Teams call";
10 const STAY_IN_BROWSER: &str = "directDl=true&msLaunch=false&enableMobilePage=false&suppressPrompt=true";
11
12 pub fn stored_web_calls(store: &store::Store) -> bool {
13 store.meta(META_WEB_CALLS).ok().flatten().as_deref() == Some("true")
14 }
15
16 pub fn meeting_web_url(target: &MeetingTarget) -> String {
17 let context = json!({"Tid": target.tenant_id, "Oid": target.organizer_id}).to_string();
18 format!(
19 "{TEAMS_WEB}/meetup-join/{}/0?context={}&{STAY_IN_BROWSER}",
20 encode(&target.thread_id),
21 encode(&context)
22 )
23 }
24
25 /// Teams on the web has no call link for a chat id, so the chat opens and the call starts there.
26 pub fn chat_web_url(thread_id: &str) -> String {
27 format!("{TEAMS_WEB}/chat/{}/0?{STAY_IN_BROWSER}", encode(thread_id))
28 }
29
30 fn encode(text: &str) -> String {
31 text.bytes()
32 .map(|byte| match byte {
33 b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'-' | b'_' | b'.' | b'~' => {
34 (byte as char).to_string()
35 }
36 byte => format!("%{byte:02X}"),
37 })
38 .collect()
39 }
40
41 impl AppState {
42 pub fn set_web_calls(&mut self, enabled: bool, cx: &mut Context<Self>) {
43 self.web_calls = enabled;
44 let _ = self
45 .store
46 .set_meta(META_WEB_CALLS, if enabled { "true" } else { "false" });
47 cx.notify();
48 }
49
50 /// Opens the call in Teams on the web when that setting is on; false leaves it to the own engine.
51 pub(super) fn try_web_call(&mut self, url: String, cx: &mut Context<Self>) -> bool {
52 if self.own_engine_next_call || !self.web_calls || self.mode.demo {
53 return false;
54 }
55 open_web_call(url, cx)
56 }
57 }
58
59 #[cfg(windows)]
60 fn open_web_call(url: String, cx: &mut App) -> bool {
61 crate::task_dialog::hosted::open_call_window(url, WEB_CALL_TITLE.to_owned(), cx)
62 }
63
64 #[cfg(not(windows))]
65 fn open_web_call(url: String, cx: &mut App) -> bool {
66 let _ = WEB_CALL_TITLE;
67 cx.open_url(&url);
68 true
69 }
70
71 #[cfg(test)]
72 mod tests {
73 use calling::MeetingTarget;
74
75 use super::{chat_web_url, meeting_web_url};
76
77 #[test]
78 fn a_meeting_opens_the_teams_join_link_with_tenant_and_organizer() {
79 let target = MeetingTarget {
80 thread_id: "19:meeting_abc@thread.v2".to_owned(),
81 tenant_id: "tenant-1".to_owned(),
82 organizer_id: "organizer-1".to_owned(),
83 meeting_data: None,
84 };
85 assert_eq!(
86 meeting_web_url(&target),
87 "https://teams.microsoft.com/l/meetup-join/19%3Ameeting_abc%40thread.v2/0?context=%7B%22Tid%22%3A%22tenant-1%22%2C%22Oid%22%3A%22organizer-1%22%7D&directDl=true&msLaunch=false&enableMobilePage=false&suppressPrompt=true"
88 );
89 }
90
91 #[test]
92 fn a_chat_opens_its_teams_chat_link() {
93 assert_eq!(
94 chat_web_url("19:abc@thread.v2"),
95 "https://teams.microsoft.com/l/chat/19%3Aabc%40thread.v2/0?directDl=true&msLaunch=false&enableMobilePage=false&suppressPrompt=true"
96 );
97 }
98 }
@@ -1,98 +0,0 @@
1use calling::MeetingTarget;
2use gpui_kit::*;
3use serde_json::json;
4
5use crate::app_state::AppState;
6
7pub const META_WEB_CALLS: &str = "calls.teams_web";
8const TEAMS_WEB: &str = "https://teams.microsoft.com/l";
9const WEB_CALL_TITLE: &str = "Teams call";
10const STAY_IN_BROWSER: &str = "directDl=true&msLaunch=false&enableMobilePage=false&suppressPrompt=true";
11
12pub fn stored_web_calls(store: &store::Store) -> bool {
13 store.meta(META_WEB_CALLS).ok().flatten().as_deref() == Some("true")
14}
15
16pub fn meeting_web_url(target: &MeetingTarget) -> String {
17 let context = json!({"Tid": target.tenant_id, "Oid": target.organizer_id}).to_string();
18 format!(
19 "{TEAMS_WEB}/meetup-join/{}/0?context={}&{STAY_IN_BROWSER}",
20 encode(&target.thread_id),
21 encode(&context)
22 )
23}
24
25/// Teams on the web has no call link for a chat id, so the chat opens and the call starts there.
26pub fn chat_web_url(thread_id: &str) -> String {
27 format!("{TEAMS_WEB}/chat/{}/0?{STAY_IN_BROWSER}", encode(thread_id))
28}
29
30fn encode(text: &str) -> String {
31 text.bytes()
32 .map(|byte| match byte {
33 b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'-' | b'_' | b'.' | b'~' => {
34 (byte as char).to_string()
35 }
36 byte => format!("%{byte:02X}"),
37 })
38 .collect()
39}
40
41impl AppState {
42 pub fn set_web_calls(&mut self, enabled: bool, cx: &mut Context<Self>) {
43 self.web_calls = enabled;
44 let _ = self
45 .store
46 .set_meta(META_WEB_CALLS, if enabled { "true" } else { "false" });
47 cx.notify();
48 }
49
50 /// Opens the call in Teams on the web when that setting is on; false leaves it to the own engine.
51 pub(super) fn try_web_call(&mut self, url: String, cx: &mut Context<Self>) -> bool {
52 if self.own_engine_next_call || !self.web_calls || self.mode.demo {
53 return false;
54 }
55 open_web_call(url, cx)
56 }
57}
58
59#[cfg(windows)]
60fn open_web_call(url: String, cx: &mut App) -> bool {
61 crate::task_dialog::hosted::open_call_window(url, WEB_CALL_TITLE.to_owned(), cx)
62}
63
64#[cfg(not(windows))]
65fn open_web_call(url: String, cx: &mut App) -> bool {
66 let _ = WEB_CALL_TITLE;
67 cx.open_url(&url);
68 true
69}
70
71#[cfg(test)]
72mod tests {
73 use calling::MeetingTarget;
74
75 use super::{chat_web_url, meeting_web_url};
76
77 #[test]
78 fn a_meeting_opens_the_teams_join_link_with_tenant_and_organizer() {
79 let target = MeetingTarget {
80 thread_id: "19:meeting_abc@thread.v2".to_owned(),
81 tenant_id: "tenant-1".to_owned(),
82 organizer_id: "organizer-1".to_owned(),
83 meeting_data: None,
84 };
85 assert_eq!(
86 meeting_web_url(&target),
87 "https://teams.microsoft.com/l/meetup-join/19%3Ameeting_abc%40thread.v2/0?context=%7B%22Tid%22%3A%22tenant-1%22%2C%22Oid%22%3A%22organizer-1%22%7D&directDl=true&msLaunch=false&enableMobilePage=false&suppressPrompt=true"
88 );
89 }
90
91 #[test]
92 fn a_chat_opens_its_teams_chat_link() {
93 assert_eq!(
94 chat_web_url("19:abc@thread.v2"),
95 "https://teams.microsoft.com/l/chat/19%3Aabc%40thread.v2/0?directDl=true&msLaunch=false&enableMobilePage=false&suppressPrompt=true"
96 );
97 }
98}
crates/app-state/src/task_dialog/hosted.rs +1 −49
@@ -1,10 +1,9 @@
1 1 use std::sync::{Arc, OnceLock};
2 2
3 use app_call_model::report::{WebShadow, report_directory, save_report};
4 3 use gpui_kit::*;
5 4 use serde_json::json;
6 5 use teams_core::DialogIdentity;
7 use webview::{DialogEvent, DialogHandle, DialogMode, DialogSpec, NEW_WINDOW_KIND, WebViewTransport};
6 use webview::{DialogEvent, DialogHandle, DialogMode, DialogSpec, WebViewTransport};
8 7
9 8 use super::sdk::{self, Effect, HostContext, HostPage};
10 9 use super::{UrlDialog, UrlDialogNext};
@@ -13,8 +12,6 @@ use crate::backend::Engine;
13 12 use crate::{notify, runtime, theme};
14 13
15 14 static HOST: OnceLock<Arc<WebViewTransport>> = OnceLock::new();
16 const CALL_WINDOW_WIDTH: u32 = 1100;
17 const CALL_WINDOW_HEIGHT: u32 = 760;
18 15
19 16 pub fn install_host(transport: Arc<WebViewTransport>) {
20 17 let _ = HOST.set(transport);
@@ -38,51 +35,6 @@ pub fn open(dialog: UrlDialog, engine: Option<Arc<Engine>>, cx: &mut App) {
38 35 .detach();
39 36 }
40 37
41 /// Teams on the web in its own window, signed in through the shared WebView2 profile.
42 pub fn open_call_window(url: String, title: String, cx: &mut App) -> bool {
43 let Some(host) = HOST.get().cloned() else {
44 return false;
45 };
46 let (_handle, mut events) = host.open_dialog(DialogSpec {
47 mode: DialogMode::Call,
48 title,
49 width: CALL_WINDOW_WIDTH,
50 height: CALL_WINDOW_HEIGHT,
51 background: theme::background_hex(),
52 owner: None,
53 page_url: url,
54 page_html: String::new(),
55 });
56 cx.spawn(async move |cx| {
57 let mut shadow = WebShadow::new(chrono::Utc::now());
58 while let Some(DialogEvent::Message(raw)) = events.recv().await {
59 if shadow.observe(&raw) {
60 continue;
61 }
62 let link = serde_json::from_str::<serde_json::Value>(&raw)
63 .ok()
64 .filter(|message| message.get("kind").and_then(serde_json::Value::as_str) == Some(NEW_WINDOW_KIND))
65 .and_then(|message| message.get("url")?.as_str().map(str::to_owned));
66 if let Some(link) = link {
67 cx.update(|cx| cx.open_url(&link));
68 }
69 }
70 if shadow.is_empty() {
71 return;
72 }
73 let document = shadow.document();
74 let saved = cx
75 .background_executor()
76 .spawn(async move { save_report(&report_directory(), &document) })
77 .await;
78 if let Err(error) = saved {
79 log::warn!("web call report not saved: {error}");
80 }
81 })
82 .detach();
83 true
84 }
85
86 38 async fn run(
87 39 host: Arc<WebViewTransport>,
88 40 dialog: UrlDialog,
@@ -1,10 +1,9 @@
1use std::sync::{Arc, OnceLock};
1use std::sync::{Arc, OnceLock};
2
2
3use app_call_model::report::{WebShadow, report_directory, save_report};
4use gpui_kit::*;
3use gpui_kit::*;
5use serde_json::json;
4use serde_json::json;
6use teams_core::DialogIdentity;
5use teams_core::DialogIdentity;
7use webview::{DialogEvent, DialogHandle, DialogMode, DialogSpec, NEW_WINDOW_KIND, WebViewTransport};
6use webview::{DialogEvent, DialogHandle, DialogMode, DialogSpec, WebViewTransport};
8
7
9use super::sdk::{self, Effect, HostContext, HostPage};
8use super::sdk::{self, Effect, HostContext, HostPage};
10use super::{UrlDialog, UrlDialogNext};
9use super::{UrlDialog, UrlDialogNext};
@@ -13,8 +12,6 @@ use crate::backend::Engine;
13use crate::{notify, runtime, theme};
12use crate::{notify, runtime, theme};
14
13
15static HOST: OnceLock<Arc<WebViewTransport>> = OnceLock::new();
14static HOST: OnceLock<Arc<WebViewTransport>> = OnceLock::new();
16const CALL_WINDOW_WIDTH: u32 = 1100;
17const CALL_WINDOW_HEIGHT: u32 = 760;
18
15
19pub fn install_host(transport: Arc<WebViewTransport>) {
16pub fn install_host(transport: Arc<WebViewTransport>) {
20 let _ = HOST.set(transport);
17 let _ = HOST.set(transport);
@@ -38,51 +35,6 @@ pub fn open(dialog: UrlDialog, engine: Option<Arc<Engine>>, cx: &mut App) {
38 .detach();
35 .detach();
39}
36}
40
37
41/// Teams on the web in its own window, signed in through the shared WebView2 profile.
42pub fn open_call_window(url: String, title: String, cx: &mut App) -> bool {
43 let Some(host) = HOST.get().cloned() else {
44 return false;
45 };
46 let (_handle, mut events) = host.open_dialog(DialogSpec {
47 mode: DialogMode::Call,
48 title,
49 width: CALL_WINDOW_WIDTH,
50 height: CALL_WINDOW_HEIGHT,
51 background: theme::background_hex(),
52 owner: None,
53 page_url: url,
54 page_html: String::new(),
55 });
56 cx.spawn(async move |cx| {
57 let mut shadow = WebShadow::new(chrono::Utc::now());
58 while let Some(DialogEvent::Message(raw)) = events.recv().await {
59 if shadow.observe(&raw) {
60 continue;
61 }
62 let link = serde_json::from_str::<serde_json::Value>(&raw)
63 .ok()
64 .filter(|message| message.get("kind").and_then(serde_json::Value::as_str) == Some(NEW_WINDOW_KIND))
65 .and_then(|message| message.get("url")?.as_str().map(str::to_owned));
66 if let Some(link) = link {
67 cx.update(|cx| cx.open_url(&link));
68 }
69 }
70 if shadow.is_empty() {
71 return;
72 }
73 let document = shadow.document();
74 let saved = cx
75 .background_executor()
76 .spawn(async move { save_report(&report_directory(), &document) })
77 .await;
78 if let Err(error) = saved {
79 log::warn!("web call report not saved: {error}");
80 }
81 })
82 .detach();
83 true
84}
85
86async fn run(
38async fn run(
87 host: Arc<WebViewTransport>,
39 host: Arc<WebViewTransport>,
88 dialog: UrlDialog,
40 dialog: UrlDialog,
crates/app/src/settings/calls.rs +2 −22
@@ -1,19 +1,12 @@
1 1 use gpui_kit::component::{h_flex, v_flex};
2 2 use gpui_kit::*;
3 3
4 use super::rows::{Choice, caption, control_row, select, text_button, toggle_row};
5 use crate::app_state::AppState;
6 use crate::theme;
4 use super::rows::{Choice, caption, control_row, select, text_button};
7 5 use crate::notify::NotificationCenter;
8 6 use crate::notify::sounds::{Ringtone, RingtoneCallType};
9 7
10 const WEB_CALLS_LABEL: &str = "Use Teams on the web for calls and meetings";
11 const WEB_CALLS_DETAIL: &str =
12 "Joins meetings and opens chat calls in a Teams on the web window instead of the built-in call engine.";
13 8
14 pub fn render(center: &Entity<NotificationCenter>, app: &Entity<AppState>, cx: &App) -> Div {
15 let web_calls = app.read(cx).web_calls;
16 let toggle_app = app.clone();
9 pub fn render(center: &Entity<NotificationCenter>, cx: &App) -> Div {
17 10 let ringtones = center.read(cx).settings().sounds.ringtones;
18 11 let rows = RingtoneCallType::ALL
19 12 .into_iter()
@@ -23,19 +16,6 @@ pub fn render(center: &Entity<NotificationCenter>, app: &Entity<AppState>, cx: &
23 16 .map(|call_type| ringtone_row(center, call_type, ringtones.get(call_type)));
24 17 v_flex()
25 18 .w_full()
26 .child(caption("CALL ENGINE"))
27 .child(
28 toggle_row(
29 "settings-web-calls",
30 WEB_CALLS_LABEL,
31 WEB_CALLS_DETAIL,
32 theme::text_muted(),
33 web_calls,
34 )
35 .on_click(move |_, _, cx| {
36 toggle_app.update(cx, |state, cx| state.set_web_calls(!web_calls, cx))
37 }),
38 )
39 19 .child(caption("RINGTONES"))
40 20 .children(rows)
41 21 }
@@ -1,19 +1,12 @@
1use gpui_kit::component::{h_flex, v_flex};
1use gpui_kit::component::{h_flex, v_flex};
2use gpui_kit::*;
2use gpui_kit::*;
3
3
4use super::rows::{Choice, caption, control_row, select, text_button, toggle_row};
4use super::rows::{Choice, caption, control_row, select, text_button};
5use crate::app_state::AppState;
6use crate::theme;
7use crate::notify::NotificationCenter;
5use crate::notify::NotificationCenter;
8use crate::notify::sounds::{Ringtone, RingtoneCallType};
6use crate::notify::sounds::{Ringtone, RingtoneCallType};
9
7
10const WEB_CALLS_LABEL: &str = "Use Teams on the web for calls and meetings";
11const WEB_CALLS_DETAIL: &str =
12 "Joins meetings and opens chat calls in a Teams on the web window instead of the built-in call engine.";
13
8
14pub fn render(center: &Entity<NotificationCenter>, app: &Entity<AppState>, cx: &App) -> Div {
9pub fn render(center: &Entity<NotificationCenter>, cx: &App) -> Div {
15 let web_calls = app.read(cx).web_calls;
16 let toggle_app = app.clone();
17 let ringtones = center.read(cx).settings().sounds.ringtones;
10 let ringtones = center.read(cx).settings().sounds.ringtones;
18 let rows = RingtoneCallType::ALL
11 let rows = RingtoneCallType::ALL
19 .into_iter()
12 .into_iter()
@@ -23,19 +16,6 @@ pub fn render(center: &Entity<NotificationCenter>, app: &Entity<AppState>, cx: &
23 .map(|call_type| ringtone_row(center, call_type, ringtones.get(call_type)));
16 .map(|call_type| ringtone_row(center, call_type, ringtones.get(call_type)));
24 v_flex()
17 v_flex()
25 .w_full()
18 .w_full()
26 .child(caption("CALL ENGINE"))
27 .child(
28 toggle_row(
29 "settings-web-calls",
30 WEB_CALLS_LABEL,
31 WEB_CALLS_DETAIL,
32 theme::text_muted(),
33 web_calls,
34 )
35 .on_click(move |_, _, cx| {
36 toggle_app.update(cx, |state, cx| state.set_web_calls(!web_calls, cx))
37 }),
38 )
39 .child(caption("RINGTONES"))
19 .child(caption("RINGTONES"))
40 .children(rows)
20 .children(rows)
41}
21}
crates/app/src/settings/dialog.rs +1 −1
@@ -181,7 +181,7 @@ impl SettingsDialog {
181 181 }
182 182 SettingsSection::Appearance => appearance::render(&self.app, cx).into_any_element(),
183 183 SettingsSection::Chats => chats::render(&self.app, cx).into_any_element(),
184 SettingsSection::Calls => calls::render(&self.center, &self.app, cx).into_any_element(),
184 SettingsSection::Calls => calls::render(&self.center, cx).into_any_element(),
185 185 SettingsSection::Devices => self
186 186 .devices
187 187 .clone()
@@ -181,7 +181,7 @@ impl SettingsDialog {
181 }
181 }
182 SettingsSection::Appearance => appearance::render(&self.app, cx).into_any_element(),
182 SettingsSection::Appearance => appearance::render(&self.app, cx).into_any_element(),
183 SettingsSection::Chats => chats::render(&self.app, cx).into_any_element(),
183 SettingsSection::Chats => chats::render(&self.app, cx).into_any_element(),
184 SettingsSection::Calls => calls::render(&self.center, &self.app, cx).into_any_element(),
184 SettingsSection::Calls => calls::render(&self.center, cx).into_any_element(),
185 SettingsSection::Devices => self
185 SettingsSection::Devices => self
186 .devices
186 .devices
187 .clone()
187 .clone()
crates/app/src/settings/nav.rs +1 −1
@@ -59,7 +59,7 @@ fn search_terms(section: SettingsSection) -> &'static [&'static str] {
59 59 "When writing a message, press Enter to",
60 60 "Format messages using mark-down",
61 61 ],
62 SettingsSection::Calls => &["Use Teams on the web for calls and meetings", "Ringtones"],
62 SettingsSection::Calls => &["Ringtones"],
63 63 SettingsSection::Devices => &[
64 64 "Speaker",
65 65 "Microphone",
@@ -59,7 +59,7 @@ fn search_terms(section: SettingsSection) -> &'static [&'static str] {
59 "When writing a message, press Enter to",
59 "When writing a message, press Enter to",
60 "Format messages using mark-down",
60 "Format messages using mark-down",
61 ],
61 ],
62 SettingsSection::Calls => &["Use Teams on the web for calls and meetings", "Ringtones"],
62 SettingsSection::Calls => &["Ringtones"],
63 SettingsSection::Devices => &[
63 SettingsSection::Devices => &[
64 "Speaker",
64 "Speaker",
65 "Microphone",
65 "Microphone",
crates/chatsvc/tests/internal_endpoints.rs +0 −1
@@ -23,7 +23,6 @@ const ALLOWED_PATHS: &[(&str, &str)] = &[
23 23 ("calling/src/meeting_options.rs", "meeting options MT"),
24 24 ("calling/src/whiteboard.rs", "meeting whiteboard MT"),
25 25 ("calling/src/breakout.rs", "breakout room join link parsing"),
26 ("app-state/src/call/web_call.rs", "Teams on the web call and meeting links"),
27 26 ("calling/assets/", "in-page caption bot command"),
28 27 (
29 28 "session/",
@@ -23,7 +23,6 @@ const ALLOWED_PATHS: &[(&str, &str)] = &[
23 ("calling/src/meeting_options.rs", "meeting options MT"),
23 ("calling/src/meeting_options.rs", "meeting options MT"),
24 ("calling/src/whiteboard.rs", "meeting whiteboard MT"),
24 ("calling/src/whiteboard.rs", "meeting whiteboard MT"),
25 ("calling/src/breakout.rs", "breakout room join link parsing"),
25 ("calling/src/breakout.rs", "breakout room join link parsing"),
26 ("app-state/src/call/web_call.rs", "Teams on the web call and meeting links"),
27 ("calling/assets/", "in-page caption bot command"),
26 ("calling/assets/", "in-page caption bot command"),
28 (
27 (
29 "session/",
28 "session/",