feat(calling): meet now opens the prejoin, direct joins use the saved mic choice like Teams
- Meet now shows the prejoin (mic, camera, "Join now") instead of joining at once - --join applies the saved join options (mic on by default) instead of always muted - Test: meet now stages the prejoin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -70,7 +70,10 @@ impl AppState {
70
70
};
71
71
match mode {
72
72
JoinMode::Prejoin => self.stage_meeting_join(join, cx),
73
JoinMode::Direct => self.start_meeting(join, None, cx),
73
JoinMode::Direct => {
74
let options = self.join_options.clone();
75
self.start_meeting(join, Some(&options), cx)
76
}
74
77
}
75
78
}
76
79
@@ -136,7 +139,7 @@ impl AppState {
136
139
organizer_id: "demo-organizer".to_owned(),
137
140
meeting_data: None,
138
141
};
139
self.join_resolved_meeting(target, JoinMode::Direct, cx);
142
self.join_resolved_meeting(target, JoinMode::Prejoin, cx);
140
143
return;
141
144
}
142
145
let Some(launcher) = self.call_launcher.clone() else {
@@ -152,7 +155,7 @@ impl AppState {
152
155
this.update(cx, |state, cx| {
153
156
state.meet_now_pending = false;
154
157
match created {
155
Some(url) => state.join_link(&url, JoinMode::Direct, cx),
158
Some(url) => state.join_link(&url, JoinMode::Prejoin, cx),
156
159
None => state.raise_notice(MEET_NOW_FAILED_NOTICE.to_owned(), None, cx),
157
160
}
158
161
cx.notify();
@@ -185,3 +188,29 @@ impl AppState {
185
188
Ok(())
186
189
}
187
190
}
191
192
#[cfg(test)]
193
mod tests {
194
use std::sync::Arc;
195
196
use gpui_kit::{AppContext as _, TestAppContext};
197
use store::Store;
198
199
use crate::app_state::{AppState, Mode};
200
201
#[gpui_kit::test]
202
fn meet_now_opens_the_prejoin_like_teams(cx: &mut TestAppContext) {
203
cx.update(gpui_kit::init);
204
let store = Arc::new(Store::open_in_memory().unwrap());
205
let mode = Mode {
206
demo: true,
207
..Mode::default()
208
};
209
let app = cx.update(|cx| cx.new(|_| AppState::new(store, mode)));
210
app.update(cx, |state, cx| state.start_meet_now(cx));
211
app.read_with(cx, |state, _| {
212
assert!(state.prejoin.is_some());
213
assert!(state.call.is_none());
214
});
215
}
216
}
@@ -70,7 +70,10 @@ impl AppState {70
};70
};71
match mode {71
match mode {72
JoinMode::Prejoin => self.stage_meeting_join(join, cx),72
JoinMode::Prejoin => self.stage_meeting_join(join, cx),73
JoinMode::Direct => self.start_meeting(join, None, cx),73
JoinMode::Direct => {74
let options = self.join_options.clone();75
self.start_meeting(join, Some(&options), cx)76
}74
}77
}75
}78
}76
79
@@ -136,7 +139,7 @@ impl AppState {136
organizer_id: "demo-organizer".to_owned(),139
organizer_id: "demo-organizer".to_owned(),137
meeting_data: None,140
meeting_data: None,138
};141
};139
self.join_resolved_meeting(target, JoinMode::Direct, cx);142
self.join_resolved_meeting(target, JoinMode::Prejoin, cx);140
return;143
return;141
}144
}142
let Some(launcher) = self.call_launcher.clone() else {145
let Some(launcher) = self.call_launcher.clone() else {@@ -152,7 +155,7 @@ impl AppState {152
this.update(cx, |state, cx| {155
this.update(cx, |state, cx| {153
state.meet_now_pending = false;156
state.meet_now_pending = false;154
match created {157
match created {155
Some(url) => state.join_link(&url, JoinMode::Direct, cx),158
Some(url) => state.join_link(&url, JoinMode::Prejoin, cx),156
None => state.raise_notice(MEET_NOW_FAILED_NOTICE.to_owned(), None, cx),159
None => state.raise_notice(MEET_NOW_FAILED_NOTICE.to_owned(), None, cx),157
}160
}158
cx.notify();161
cx.notify();@@ -185,3 +188,29 @@ impl AppState {185
Ok(())188
Ok(())186
}189
}187
}190
}191
192
#[cfg(test)]193
mod tests {194
use std::sync::Arc;195
196
use gpui_kit::{AppContext as _, TestAppContext};197
use store::Store;198
199
use crate::app_state::{AppState, Mode};200
201
#[gpui_kit::test]202
fn meet_now_opens_the_prejoin_like_teams(cx: &mut TestAppContext) {203
cx.update(gpui_kit::init);204
let store = Arc::new(Store::open_in_memory().unwrap());205
let mode = Mode {206
demo: true,207
..Mode::default()208
};209
let app = cx.update(|cx| cx.new(|_| AppState::new(store, mode)));210
app.update(cx, |state, cx| state.start_meet_now(cx));211
app.read_with(cx, |state, _| {212
assert!(state.prejoin.is_some());213
assert!(state.call.is_none());214
});215
}216
}