feat(calls): the join preview opens in the meeting window
- Like Teams, Join or Meet now opens the meeting window with the preview; the main window stays on chats - The same window turns into the call after Join now; closing it cancels the join Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -290,7 +290,7 @@ impl CallWindows {
290
290
291
291
fn stage_wanted(&self, cx: &App) -> bool {
292
292
let state = self.app.read(cx);
293
state.call.is_some() || state.call_end.is_some()
293
state.call.is_some() || state.call_end.is_some() || state.prejoin.is_some()
294
294
}
295
295
296
296
fn sync_stage(&mut self, cx: &mut Context<Self>) {
@@ -290,7 +290,7 @@ impl CallWindows {290
290
291
fn stage_wanted(&self, cx: &App) -> bool {291
fn stage_wanted(&self, cx: &App) -> bool {292
let state = self.app.read(cx);292
let state = self.app.read(cx);293
state.call.is_some() || state.call_end.is_some()293
state.call.is_some() || state.call_end.is_some() || state.prejoin.is_some()294
}294
}295
295
296
fn sync_stage(&mut self, cx: &mut Context<Self>) {296
fn sync_stage(&mut self, cx: &mut Context<Self>) {@@ -987,7 +987,8 @@ mod frames {
987
987
screen_name,
988
988
"call" | "call-people" | "call-transcript" | "call-share" | "call-consult"
989
989
);
990
let tags = if is_call {
990
let in_call_window = is_call || screen_name == "prejoin";
991
let tags = if in_call_window {
991
992
let mut call_visual = call_window_context(&mut visual);
992
993
call_visual.simulate_resize(size(px(width), px(height)));
993
994
collect(&mut call_visual, None)
@@ -995,8 +996,10 @@ mod frames {
995
996
collect(&mut visual, status_menu.then_some(MENU))
996
997
};
997
998
let mut expected = GUARDED.to_vec();
998
if is_call {
999
if in_call_window {
999
1000
expected = vec!["shell/islands/main"];
1001
}
1002
if is_call {
1000
1003
expected.extend(CALL_GUARDED);
1001
1004
}
1002
1005
if screen_name == "call-transcript" {
@@ -987,7 +987,8 @@ mod frames {987
screen_name,987
screen_name,988
"call" | "call-people" | "call-transcript" | "call-share" | "call-consult"988
"call" | "call-people" | "call-transcript" | "call-share" | "call-consult"989
);989
);990
let tags = if is_call {990
let in_call_window = is_call || screen_name == "prejoin";991
let tags = if in_call_window {991
let mut call_visual = call_window_context(&mut visual);992
let mut call_visual = call_window_context(&mut visual);992
call_visual.simulate_resize(size(px(width), px(height)));993
call_visual.simulate_resize(size(px(width), px(height)));993
collect(&mut call_visual, None)994
collect(&mut call_visual, None)@@ -995,8 +996,10 @@ mod frames {995
collect(&mut visual, status_menu.then_some(MENU))996
collect(&mut visual, status_menu.then_some(MENU))996
};997
};997
let mut expected = GUARDED.to_vec();998
let mut expected = GUARDED.to_vec();998
if is_call {999
if in_call_window {999
expected = vec!["shell/islands/main"];1000
expected = vec!["shell/islands/main"];1001
}1002
if is_call {1000
expected.extend(CALL_GUARDED);1003
expected.extend(CALL_GUARDED);1001
}1004
}1002
if screen_name == "call-transcript" {1005
if screen_name == "call-transcript" {@@ -8,6 +8,7 @@ use super::call_pop_out::zoom_listener;
8
8
use super::call_stage::render_stage_overlay;
9
9
use super::call_view::render_call_view;
10
10
use super::conversation::ConversationView;
11
use super::prejoin_view::PrejoinView;
11
12
use super::actions::ToggleCallMute;
12
13
use super::shortcuts::{
13
14
HangUpCall, OpenLobbyList, PushToTalk, ToggleCallCamera, ToggleCallFullscreen, ToggleCallHand,
@@ -30,6 +31,7 @@ pub fn call_window_title(state: &AppState) -> String {
30
31
.call
31
32
.as_ref()
32
33
.map(|call| call.model.title.clone())
34
.or_else(|| state.prejoin.as_ref().map(|pending| pending.join.title.clone()))
33
35
.filter(|title| !title.is_empty())
34
36
.unwrap_or_else(|| FALLBACK_TITLE.to_owned())
35
37
}
@@ -39,6 +41,7 @@ pub struct CallWindowView {
39
41
app: Entity<AppState>,
40
42
focus: FocusHandle,
41
43
call_chat: Option<(String, Entity<ConversationView>)>,
44
prejoin: Option<Entity<PrejoinView>>,
42
45
fullscreen: bool,
43
46
was_fullscreen: bool,
44
47
_app_subscription: Subscription,
@@ -64,6 +67,7 @@ impl CallWindowView {
64
67
app,
65
68
focus,
66
69
call_chat: None,
70
prejoin: None,
67
71
fullscreen: false,
68
72
was_fullscreen: false,
69
73
_app_subscription: app_subscription,
@@ -84,6 +88,19 @@ impl CallWindowView {
84
88
}
85
89
}
86
90
91
fn sync_prejoin(&mut self, window: &mut Window, cx: &mut Context<Self>) {
92
let wanted = self.app.read(cx).prejoin.clone();
93
let open = self.prejoin.as_ref().map(|view| view.read(cx).pending_id());
94
match (wanted, open) {
95
(Some(pending), Some(id)) if pending.id == id => {}
96
(Some(pending), _) => {
97
let app = self.app.clone();
98
self.prejoin = Some(cx.new(|cx| PrejoinView::new(app, &pending, window, cx)));
99
}
100
(None, _) => self.prejoin = None,
101
}
102
}
103
87
104
fn sync_fullscreen(&mut self, wanted: bool, window: &mut Window) {
88
105
if wanted == self.fullscreen {
89
106
return;
@@ -142,6 +159,8 @@ fn leave_or_dismiss(app: &Entity<AppState>, cx: &mut App) {
142
159
app.update(cx, |state, cx| {
143
160
if state.call.is_some() {
144
161
state.leave_call(cx);
162
} else if state.prejoin.is_some() {
163
state.cancel_prejoin(cx);
145
164
} else {
146
165
state.dismiss_call_end(cx);
147
166
}
@@ -158,6 +177,7 @@ impl Render for CallWindowView {
158
177
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
159
178
let chat_thread = self.app.read(cx).call_chat_thread();
160
179
self.sync_call_chat(chat_thread, window, cx);
180
self.sync_prejoin(window, cx);
161
181
let state = self.app.read(cx);
162
182
let fullscreen = state.call_fullscreen();
163
183
let open_dialogs = [
@@ -174,7 +194,8 @@ impl Render for CallWindowView {
174
194
let stage_width = window_width - 2. * ISLAND_GAP;
175
195
let chat_panel = self.call_chat.as_ref().map(|(_, view)| view.clone().into());
176
196
let stage = render_call_view(&self.app, state, chat_panel, fullscreen, stage_width)
177
.or_else(|| render_call_end(&self.app, state));
197
.or_else(|| render_call_end(&self.app, state))
198
.or_else(|| self.prejoin.clone().map(|prejoin| prejoin.into_any_element()));
178
199
let stage_overlay = render_stage_overlay(&self.app, state);
179
200
elevation::set_app_modal_layers(window, open_dialogs, cx);
180
201
self.sync_fullscreen(fullscreen, window);
@@ -8,6 +8,7 @@ use super::call_pop_out::zoom_listener;8
use super::call_stage::render_stage_overlay;8
use super::call_stage::render_stage_overlay;9
use super::call_view::render_call_view;9
use super::call_view::render_call_view;10
use super::conversation::ConversationView;10
use super::conversation::ConversationView;11
use super::prejoin_view::PrejoinView;11
use super::actions::ToggleCallMute;12
use super::actions::ToggleCallMute;12
use super::shortcuts::{13
use super::shortcuts::{13
HangUpCall, OpenLobbyList, PushToTalk, ToggleCallCamera, ToggleCallFullscreen, ToggleCallHand,14
HangUpCall, OpenLobbyList, PushToTalk, ToggleCallCamera, ToggleCallFullscreen, ToggleCallHand,@@ -30,6 +31,7 @@ pub fn call_window_title(state: &AppState) -> String {30
.call31
.call31
.as_ref()32
.as_ref()32
.map(|call| call.model.title.clone())33
.map(|call| call.model.title.clone())34
.or_else(|| state.prejoin.as_ref().map(|pending| pending.join.title.clone()))33
.filter(|title| !title.is_empty())35
.filter(|title| !title.is_empty())34
.unwrap_or_else(|| FALLBACK_TITLE.to_owned())36
.unwrap_or_else(|| FALLBACK_TITLE.to_owned())35
}37
}@@ -39,6 +41,7 @@ pub struct CallWindowView {39
app: Entity<AppState>,41
app: Entity<AppState>,40
focus: FocusHandle,42
focus: FocusHandle,41
call_chat: Option<(String, Entity<ConversationView>)>,43
call_chat: Option<(String, Entity<ConversationView>)>,44
prejoin: Option<Entity<PrejoinView>>,42
fullscreen: bool,45
fullscreen: bool,43
was_fullscreen: bool,46
was_fullscreen: bool,44
_app_subscription: Subscription,47
_app_subscription: Subscription,@@ -64,6 +67,7 @@ impl CallWindowView {64
app,67
app,65
focus,68
focus,66
call_chat: None,69
call_chat: None,70
prejoin: None,67
fullscreen: false,71
fullscreen: false,68
was_fullscreen: false,72
was_fullscreen: false,69
_app_subscription: app_subscription,73
_app_subscription: app_subscription,@@ -84,6 +88,19 @@ impl CallWindowView {84
}88
}85
}89
}86
90
91
fn sync_prejoin(&mut self, window: &mut Window, cx: &mut Context<Self>) {92
let wanted = self.app.read(cx).prejoin.clone();93
let open = self.prejoin.as_ref().map(|view| view.read(cx).pending_id());94
match (wanted, open) {95
(Some(pending), Some(id)) if pending.id == id => {}96
(Some(pending), _) => {97
let app = self.app.clone();98
self.prejoin = Some(cx.new(|cx| PrejoinView::new(app, &pending, window, cx)));99
}100
(None, _) => self.prejoin = None,101
}102
}103
87
fn sync_fullscreen(&mut self, wanted: bool, window: &mut Window) {104
fn sync_fullscreen(&mut self, wanted: bool, window: &mut Window) {88
if wanted == self.fullscreen {105
if wanted == self.fullscreen {89
return;106
return;@@ -142,6 +159,8 @@ fn leave_or_dismiss(app: &Entity<AppState>, cx: &mut App) {142
app.update(cx, |state, cx| {159
app.update(cx, |state, cx| {143
if state.call.is_some() {160
if state.call.is_some() {144
state.leave_call(cx);161
state.leave_call(cx);162
} else if state.prejoin.is_some() {163
state.cancel_prejoin(cx);145
} else {164
} else {146
state.dismiss_call_end(cx);165
state.dismiss_call_end(cx);147
}166
}@@ -158,6 +177,7 @@ impl Render for CallWindowView {158
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {177
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {159
let chat_thread = self.app.read(cx).call_chat_thread();178
let chat_thread = self.app.read(cx).call_chat_thread();160
self.sync_call_chat(chat_thread, window, cx);179
self.sync_call_chat(chat_thread, window, cx);180
self.sync_prejoin(window, cx);161
let state = self.app.read(cx);181
let state = self.app.read(cx);162
let fullscreen = state.call_fullscreen();182
let fullscreen = state.call_fullscreen();163
let open_dialogs = [183
let open_dialogs = [@@ -174,7 +194,8 @@ impl Render for CallWindowView {174
let stage_width = window_width - 2. * ISLAND_GAP;194
let stage_width = window_width - 2. * ISLAND_GAP;175
let chat_panel = self.call_chat.as_ref().map(|(_, view)| view.clone().into());195
let chat_panel = self.call_chat.as_ref().map(|(_, view)| view.clone().into());176
let stage = render_call_view(&self.app, state, chat_panel, fullscreen, stage_width)196
let stage = render_call_view(&self.app, state, chat_panel, fullscreen, stage_width)177
.or_else(|| render_call_end(&self.app, state));197
.or_else(|| render_call_end(&self.app, state))198
.or_else(|| self.prejoin.clone().map(|prejoin| prejoin.into_any_element()));178
let stage_overlay = render_stage_overlay(&self.app, state);199
let stage_overlay = render_stage_overlay(&self.app, state);179
elevation::set_app_modal_layers(window, open_dialogs, cx);200
elevation::set_app_modal_layers(window, open_dialogs, cx);180
self.sync_fullscreen(fullscreen, window);201
self.sync_fullscreen(fullscreen, window);@@ -12,7 +12,6 @@ use super::conversation::ConversationView;
12
12
use super::dialog_overlay::render_task_dialog;
13
13
use super::forward_dialog::{ForwardDialog, ForwardDialogEvent};
14
14
use super::image_viewer::{ImageViewer, ImageViewerEvent};
15
use super::prejoin_view::PrejoinView;
16
15
use super::profile_card::{ProfileCard, ProfileCardEvent};
17
16
use gpui_kit::prelude::FluentBuilder as _;
18
17
use super::rail::RailView;
@@ -173,7 +172,6 @@ pub struct AppShell {
173
172
calls_page: Entity<CallsPage>,
174
173
shown_quick_view: Option<QuickView>,
175
174
conversation: Entity<ConversationView>,
176
prejoin: Option<Entity<PrejoinView>>,
177
175
switcher: Option<Entity<Switcher>>,
178
176
notifications: Entity<NotificationCenter>,
179
177
_call_windows: Entity<CallWindows>,
@@ -231,19 +229,6 @@ impl AppShell {
231
229
});
232
230
}
233
231
234
fn sync_prejoin(&mut self, window: &mut Window, cx: &mut Context<Self>) {
235
let wanted = self.state.read(cx).prejoin.clone();
236
let open = self.prejoin.as_ref().map(|view| view.read(cx).pending_id());
237
match (wanted, open) {
238
(Some(pending), Some(id)) if pending.id == id => {}
239
(Some(pending), _) => {
240
let app = self.state.clone();
241
self.prejoin = Some(cx.new(|cx| PrejoinView::new(app, &pending, window, cx)));
242
}
243
(None, _) => self.prejoin = None,
244
}
245
}
246
247
232
pub fn new(
248
233
state: Entity<AppState>,
249
234
open_target: Option<OpenTarget>,
@@ -400,7 +385,6 @@ impl AppShell {
400
385
calls_page,
401
386
shown_quick_view: None,
402
387
conversation,
403
prejoin: None,
404
388
switcher: None,
405
389
notifications,
406
390
_call_windows: call_windows,
@@ -943,31 +927,28 @@ impl AppShell {
943
927
)
944
928
}),
945
929
)
946
.child(match self.prejoin.clone() {
947
Some(prejoin) => prejoin
948
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())
949
.into_any_element(),
950
None if calls_open => self
930
.child(match () {
931
_ if calls_open => self
951
932
.calls_page
952
933
.clone()
953
934
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())
954
935
.into_any_element(),
955
None if manage_team_open => self
936
_ if manage_team_open => self
956
937
.manage_team_page
957
938
.clone()
958
939
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())
959
940
.into_any_element(),
960
None if quick_view_open => self
941
_ if quick_view_open => self
961
942
.quick_pane
962
943
.clone()
963
944
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())
964
945
.into_any_element(),
965
None if calendar_open => self
946
_ if calendar_open => self
966
947
.calendar
967
948
.clone()
968
949
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())
969
950
.into_any_element(),
970
None => self
951
_ => self
971
952
.conversation
972
953
.clone()
973
954
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())
@@ -1013,7 +994,6 @@ impl Render for AppShell {
1013
994
});
1014
995
});
1015
996
}
1016
self.sync_prejoin(window, cx);
1017
997
let notice = self.state.read(cx).notice.clone();
1018
998
self.toasts.sync(&self.state, notice.as_ref(), window, cx);
1019
999
let update_failure = match &self.update {
@@ -12,7 +12,6 @@ use super::conversation::ConversationView;12
use super::dialog_overlay::render_task_dialog;12
use super::dialog_overlay::render_task_dialog;13
use super::forward_dialog::{ForwardDialog, ForwardDialogEvent};13
use super::forward_dialog::{ForwardDialog, ForwardDialogEvent};14
use super::image_viewer::{ImageViewer, ImageViewerEvent};14
use super::image_viewer::{ImageViewer, ImageViewerEvent};15
use super::prejoin_view::PrejoinView;16
use super::profile_card::{ProfileCard, ProfileCardEvent};15
use super::profile_card::{ProfileCard, ProfileCardEvent};17
use gpui_kit::prelude::FluentBuilder as _;16
use gpui_kit::prelude::FluentBuilder as _;18
use super::rail::RailView;17
use super::rail::RailView;@@ -173,7 +172,6 @@ pub struct AppShell {173
calls_page: Entity<CallsPage>,172
calls_page: Entity<CallsPage>,174
shown_quick_view: Option<QuickView>,173
shown_quick_view: Option<QuickView>,175
conversation: Entity<ConversationView>,174
conversation: Entity<ConversationView>,176
prejoin: Option<Entity<PrejoinView>>,177
switcher: Option<Entity<Switcher>>,175
switcher: Option<Entity<Switcher>>,178
notifications: Entity<NotificationCenter>,176
notifications: Entity<NotificationCenter>,179
_call_windows: Entity<CallWindows>,177
_call_windows: Entity<CallWindows>,@@ -231,19 +229,6 @@ impl AppShell {231
});229
});232
}230
}233
231
234
fn sync_prejoin(&mut self, window: &mut Window, cx: &mut Context<Self>) {235
let wanted = self.state.read(cx).prejoin.clone();236
let open = self.prejoin.as_ref().map(|view| view.read(cx).pending_id());237
match (wanted, open) {238
(Some(pending), Some(id)) if pending.id == id => {}239
(Some(pending), _) => {240
let app = self.state.clone();241
self.prejoin = Some(cx.new(|cx| PrejoinView::new(app, &pending, window, cx)));242
}243
(None, _) => self.prejoin = None,244
}245
}246
247
pub fn new(232
pub fn new(248
state: Entity<AppState>,233
state: Entity<AppState>,249
open_target: Option<OpenTarget>,234
open_target: Option<OpenTarget>,@@ -400,7 +385,6 @@ impl AppShell {400
calls_page,385
calls_page,401
shown_quick_view: None,386
shown_quick_view: None,402
conversation,387
conversation,403
prejoin: None,404
switcher: None,388
switcher: None,405
notifications,389
notifications,406
_call_windows: call_windows,390
_call_windows: call_windows,@@ -943,31 +927,28 @@ impl AppShell {943
)927
)944
}),928
}),945
)929
)946
.child(match self.prejoin.clone() {930
.child(match () {947
Some(prejoin) => prejoin931
_ if calls_open => self948
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())949
.into_any_element(),950
None if calls_open => self951
.calls_page932
.calls_page952
.clone()933
.clone()953
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())934
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())954
.into_any_element(),935
.into_any_element(),955
None if manage_team_open => self936
_ if manage_team_open => self956
.manage_team_page937
.manage_team_page957
.clone()938
.clone()958
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())939
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())959
.into_any_element(),940
.into_any_element(),960
None if quick_view_open => self941
_ if quick_view_open => self961
.quick_pane942
.quick_pane962
.clone()943
.clone()963
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())944
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())964
.into_any_element(),945
.into_any_element(),965
None if calendar_open => self946
_ if calendar_open => self966
.calendar947
.calendar967
.clone()948
.clone()968
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())949
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())969
.into_any_element(),950
.into_any_element(),970
None => self951
_ => self971
.conversation952
.conversation972
.clone()953
.clone()973
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())954
.cached(StyleRefinement::default().flex_1().min_w_0().h_full())@@ -1013,7 +994,6 @@ impl Render for AppShell {1013
});994
});1014
});995
});1015
}996
}1016
self.sync_prejoin(window, cx);1017
let notice = self.state.read(cx).notice.clone();997
let notice = self.state.read(cx).notice.clone();1018
self.toasts.sync(&self.state, notice.as_ref(), window, cx);998
self.toasts.sync(&self.state, notice.as_ref(), window, cx);1019
let update_failure = match &self.update {999
let update_failure = match &self.update {