BlueGit

ict rusty-teams

Files

rusty-teams / crates / app / src / views / shell.rs

shell.rs

shell.rs 50.4 KiB Download Raw
1mod team_keys;
2
3use std::sync::Arc;
4
5use gpui_kit::component::{elevation, h_flex, v_flex};
6use gpui_kit::*;
7
8use super::activity_panel::{ActivityPanel, ActivityPanelEvent};
9use super::call_mini::CallMiniView;
10use super::call_stage::{render_call_overlay, render_stage_overlay};
11use super::call_end_view::render_call_end;
12use super::call_view::{CHAT_PANEL_WIDTH, OVERLAY_BELOW as CALL_COLUMN_MIN, render_call_view};
13use super::actions::{NewChat, OpenSwitcher, ReplyToHovered, ToggleCallMute};
14use super::calendar_view::CalendarView;
15use super::conversation::ConversationView;
16use super::dialog_overlay::render_task_dialog;
17use super::forward_dialog::{ForwardDialog, ForwardDialogEvent};
18use super::image_viewer::{ImageViewer, ImageViewerEvent};
19use super::prejoin_view::PrejoinView;
20use super::profile_card::{ProfileCard, ProfileCardEvent};
21use gpui_kit::prelude::FluentBuilder as _;
22use super::rail::RailView;
23use crate::chat_filter::ChatFilterPill;
24use super::calls_page::CallsPage;
25use super::quick_view_pane::{QuickViewEvent, QuickViewPane};
26use super::shortcuts::{
27 ClearChatFilters, DeclineCall, FilterMeetingChats, FilterMutedChats,
28 FilterNonMeetingChats, FilterUnreadChats, FindInChat, HangUpCall, JoinMeetingFromToast, JumpToLastReadOrNewest, NextConversation, OpenActivity,
29 OpenAgents, OpenCallsTab, OpenSettings, OpenChannelsTab, OpenChatFilter, OpenChatsTab, PopOutSelectedChat, OpenLobbyList, OpenSaved, OpenCalendar, PreviousConversation, PushToTalk,
30 Scope, ShowShortcuts, StartAudioCall, StartVideoCall, ToggleCallCamera, ToggleCallFullscreen,
31 ToggleCallHand, ToggleCallShare, ZoomIn, ZoomOut, ZoomReset, ZoomShareIn, ZoomShareOut,
32 ZoomShareReset,
33};
34use super::window_zoom::{WindowZoom, change_zoom};
35use super::call_pop_out::zoom_listener;
36use super::chat_pop_out;
37use super::shortcuts_dialog::{ShortcutsDialog, ShortcutsDialogEvent};
38use super::sidebar::{SidebarEvent, SidebarTab, SidebarView};
39use app_ui_kit::render::hooks::RenderHooks;
40use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};
41use super::connection_banner::render_connection_banner;
42use super::notice_toast::NoticeToasts;
43use super::status_menu::{own_status_button, settings_more_button};
44use super::status_message_dialog::{StatusMessageDialog, StatusMessageDialogEvent};
45use super::switcher::{Switcher, SwitcherEvent, candidates_from};
46use super::title_bar::{mode_label, render_title_bar, update_button};
47use crate::activity::ActivityCenter;
48use crate::agents::{AgentRunsEvent, StartDialog, StartDialogEvent, StartRequest};
49use crate::app_state::{AppEvent, AppState, QuickView, Selection, selection_for};
50use crate::call::{CallMedia, CallWindows, ZoomStep};
51use crate::notice::NoticeAction;
52use crate::notify::NotificationCenter;
53use crate::settings::{SettingsDialog, SettingsDialogEvent};
54use crate::settings_section::SettingsSection;
55use crate::sidebar_model::Step;
56use crate::theme;
57use crate::updater::{self, IdleInputs, UpdateStatus};
58use crate::user_activity::{self, UserInput};
59
60pub fn bind_keys(cx: &mut App) {
61 super::composer::bind_keys(cx);
62 super::shortcuts::bind_scopes(
63 cx,
64 &[
65 Scope::Global,
66 Scope::OutsideComposer,
67 Scope::GlobalOverTextFields,
68 Scope::OutsideTextFields,
69 ],
70 );
71}
72
73#[derive(Debug, Clone, Copy)]
74pub enum OpenTarget {
75 Chat(usize),
76 Channel(usize),
77}
78
79#[derive(Default)]
80pub struct Startup {
81 pub switcher_query: Option<String>,
82 pub composer_text: Option<String>,
83 pub reply_to_last: bool,
84 pub launched_by_autostart: bool,
85}
86
87pub const SIDEBAR_HIDDEN_BELOW: f32 = 960.;
88
89pub fn sidebar_hidden_in_call(window_width: f32, panel_open: bool) -> bool {
90 let panel_width = if panel_open { CHAT_PANEL_WIDTH + ISLAND_GAP } else { 0. };
91 window_width < SIDEBAR_HIDDEN_BELOW
92 || window_width - RAIL_WIDTH - SIDEBAR_WIDTH - 2. * ISLAND_GAP - panel_width < CALL_COLUMN_MIN
93}
94
95pub struct UserInputHandle(pub Arc<UserInput>);
96
97impl Global for UserInputHandle {}
98
99pub fn install_globals(state: &Entity<AppState>, user_input: Arc<UserInput>, cx: &mut App) {
100 cx.set_global(crate::app_state::AppHandle(state.clone()));
101 cx.set_global(UserInputHandle(user_input));
102 cx.set_global(RenderHooks {
103 open_profile_link: super::profile_card::open_profile_link,
104 jump_to_quoted,
105 inline_image,
106 });
107}
108
109fn inline_image(url: &str, cx: &App) -> Option<std::path::PathBuf> {
110 let handle = cx.try_global::<crate::app_state::AppHandle>()?;
111 let entry = handle.0.read(cx).directory.image(url)?;
112 Some(entry.path.clone())
113}
114
115fn jump_to_quoted(message_id: String, cx: &mut App) {
116 let Some(handle) = cx.try_global::<crate::app_state::AppHandle>() else {
117 return;
118 };
119 handle.0.clone().update(cx, |state, cx| {
120 if let Some(selection) = state.selection.clone() {
121 state.jump_to_message(selection, message_id, cx);
122 }
123 });
124}
125
126#[cfg(windows)]
127fn watch_releases(running_tag: &'static str, cx: &mut App) {
128 use app_base::release_feed;
129 cx.spawn(async move |cx| {
130 cx.background_executor()
131 .timer(release_feed::FIRST_CHECK_DELAY)
132 .await;
133 loop {
134 let Some(paths) = updater::current_paths() else {
135 return;
136 };
137 let fetch = cx.update(|cx| release_feed::fetch_update(running_tag, paths, cx));
138 match fetch.await {
139 Ok(Some(tag)) => log::info!("release {tag} downloaded for the next restart"),
140 Ok(None) => {}
141 Err(error) => log::warn!("release check failed: {error}"),
142 }
143 cx.background_executor()
144 .timer(release_feed::CHECK_INTERVAL)
145 .await;
146 }
147 })
148 .detach();
149}
150
151const DEMO_UPDATE_VARIABLE: &str = "TEAMS_DEMO_UPDATE";
152
153pub struct AppShell {
154 state: Entity<AppState>,
155 rail: Entity<RailView>,
156 sidebar: Entity<SidebarView>,
157 calendar: Entity<CalendarView>,
158 quick_pane: Entity<QuickViewPane>,
159 calls_page: Entity<CallsPage>,
160 shown_quick_view: Option<QuickView>,
161 conversation: Entity<ConversationView>,
162 call_chat: Option<(String, Entity<ConversationView>)>,
163 prejoin: Option<Entity<PrejoinView>>,
164 switcher: Option<Entity<Switcher>>,
165 notifications: Entity<NotificationCenter>,
166 _call_windows: Entity<CallWindows>,
167 forward_dialog: Option<Entity<ForwardDialog>>,
168 image_viewer: Option<Entity<ImageViewer>>,
169 status_dialog: Option<Entity<StatusMessageDialog>>,
170 shortcuts_dialog: Option<Entity<ShortcutsDialog>>,
171 agent_dialog: Option<Entity<StartDialog>>,
172 settings_dialog: Option<Entity<SettingsDialog>>,
173 profile_card: Option<Entity<ProfileCard>>,
174 focus_handle: FocusHandle,
175 call_window_fullscreen: bool,
176 window_was_fullscreen: bool,
177 open_target: Option<OpenTarget>,
178 update: UpdateStatus,
179 toasts: NoticeToasts,
180 user_input: Arc<UserInput>,
181 _subscription: Subscription,
182 call_mini: Entity<CallMiniView>,
183 _call_media_observation: Subscription,
184 _panel_subscriptions: [Subscription; 2],
185 _sidebar_subscription: Subscription,
186 _agents_subscription: Option<Subscription>,
187 _agent_subscription: Option<Subscription>,
188 _escape_observation: Subscription,
189 _activation_observation: Subscription,
190 _appearance_observation: Subscription,
191}
192
193impl AppShell {
194 #[cfg(test)]
195 pub(crate) fn set_update_status(&mut self, update: UpdateStatus, cx: &mut Context<Self>) {
196 self.update = update;
197 cx.notify();
198 }
199
200 fn sync_call_chat(
201 &mut self,
202 thread: Option<String>,
203 window: &mut Window,
204 cx: &mut Context<Self>,
205 ) {
206 match (thread, &self.call_chat) {
207 (Some(wanted), Some((open, _))) if &wanted == open => {}
208 (Some(wanted), _) => {
209 let app = self.state.clone();
210 let selection = Selection::Chat(wanted.clone());
211 let view = cx.new(|cx| ConversationView::pinned_to(app, selection, window, cx));
212 self.call_chat = Some((wanted, view));
213 }
214 (None, _) => self.call_chat = None,
215 }
216 }
217
218 fn focus_opened_quick_view(&mut self, window: &mut Window, cx: &mut Context<Self>) {
219 let quick_view = self.state.read(cx).quick_view;
220 if std::mem::replace(&mut self.shown_quick_view, quick_view) != quick_view
221 && quick_view.is_some()
222 {
223 self.restore_focus(window, cx);
224 }
225 }
226
227 fn leave_calendar_on_selection(&mut self, cx: &mut Context<Self>) {
228 if self.sidebar.read(cx).tab() != SidebarTab::Calendar {
229 return;
230 }
231 let selection = self.state.read(cx).selection.clone();
232 let sidebar = self.sidebar.clone();
233 cx.defer(move |cx| {
234 sidebar.update(cx, |sidebar, cx| match selection {
235 Some(Selection::Channel(_)) => sidebar.show_channels(cx),
236 Some(Selection::Chat(_)) => sidebar.show_chats(cx),
237 None => {}
238 })
239 });
240 }
241
242 fn sync_prejoin(&mut self, window: &mut Window, cx: &mut Context<Self>) {
243 let wanted = self.state.read(cx).prejoin.clone();
244 let open = self.prejoin.as_ref().map(|view| view.read(cx).pending_id());
245 match (wanted, open) {
246 (Some(pending), Some(id)) if pending.id == id => {}
247 (Some(pending), _) => {
248 let app = self.state.clone();
249 self.prejoin = Some(cx.new(|cx| PrejoinView::new(app, &pending, window, cx)));
250 }
251 (None, _) => self.prejoin = None,
252 }
253 }
254
255 pub fn new(
256 state: Entity<AppState>,
257 open_target: Option<OpenTarget>,
258 startup: Startup,
259 window: &mut Window,
260 cx: &mut Context<Self>,
261 ) -> Self {
262 let call_media = cx.new(|_| CallMedia);
263 state.update(cx, |state, _| state.call_media = Some(call_media.clone()));
264 let call_media_observation = cx.observe(&call_media, |this, _, cx| {
265 if this.state.read(cx).viewing_call() {
266 cx.notify();
267 }
268 });
269 let activity = cx.new(|cx| ActivityCenter::new(state.clone(), window, cx));
270 let activity_panel = cx.new(|cx| ActivityPanel::new(state.clone(), activity.clone(), cx));
271 let quick_pane = cx.new(|cx| QuickViewPane::new(state.clone(), activity.clone(), cx));
272 let calls_page = cx.new(|cx| CallsPage::new(state.clone(), window, cx));
273 let agents_panel = crate::agents::runs_handle(cx)
274 .map(|runs| cx.new(|cx| crate::agents::AgentsPanel::new(runs, cx)));
275 let agents_subscription = agents_panel.as_ref().map(|panel| {
276 cx.subscribe(
277 panel,
278 |this, _, event: &crate::agents::AgentsPanelEvent, cx| {
279 let crate::agents::AgentsPanelEvent::Open {
280 conversation_id,
281 message_id,
282 } = event;
283 this.open_message(conversation_id, message_id, cx);
284 },
285 )
286 });
287 let panel_subscriptions = [
288 cx.subscribe(
289 &activity_panel,
290 |this, _, event: &ActivityPanelEvent, cx| match event {
291 ActivityPanelEvent::OpenSettings => this.state.update(cx, |state, cx| {
292 state.open_settings(SettingsSection::Notifications, cx)
293 }),
294 ActivityPanelEvent::Open {
295 conversation_id,
296 message_id,
297 link,
298 } => {
299 if !this.open_message(conversation_id, message_id, cx)
300 && let Some(link) = link
301 {
302 cx.open_url(link);
303 }
304 }
305 },
306 ),
307 cx.subscribe(&quick_pane, |this, _, event: &QuickViewEvent, cx| {
308 let QuickViewEvent::Open {
309 conversation_id,
310 message_id,
311 } = event;
312 this.state
313 .update(cx, |state, cx| state.close_quick_view(cx));
314 this.open_message(conversation_id, message_id.as_deref().unwrap_or_default(), cx);
315 }),
316 ];
317 let agent_subscription = crate::agents::runs_handle(cx).map(|runs| {
318 cx.subscribe_in(
319 &runs,
320 window,
321 |this, _, event: &AgentRunsEvent, window, cx| match event {
322 AgentRunsEvent::StartRequested(request) => {
323 this.open_agent_dialog(request.clone(), window, cx)
324 }
325 AgentRunsEvent::OpenSettings => {
326 this.open_settings(SettingsSection::Agents, window, cx)
327 }
328 AgentRunsEvent::Finished(_) => {}
329 },
330 )
331 });
332 let sidebar = cx.new(|cx| SidebarView::new(state.clone(), activity_panel, agents_panel, cx));
333 let sidebar_subscription = cx.subscribe_in(&sidebar, window, |this, _, event: &SidebarEvent, window, cx| {
334 match event {
335 SidebarEvent::RestoreFocus => this.restore_focus(window, cx),
336 SidebarEvent::TabChanged => {
337 if this.sidebar.read(cx).tab() == SidebarTab::Calendar {
338 this.restore_focus(window, cx);
339 }
340 cx.notify();
341 }
342 }
343 });
344 let calendar = cx.new(|cx| CalendarView::new(state.clone(), cx));
345 let rail = cx.new(|cx| RailView::new(state.clone(), activity.clone(), sidebar.clone(), cx));
346 let conversation = cx.new(|cx| ConversationView::new(state.clone(), window, cx));
347 let timeline = conversation.read(cx).timeline_bounds();
348 let call_mini = cx.new(|cx| CallMiniView::new(state.clone(), timeline, cx));
349 let subscription =
350 cx.subscribe_in(&state, window, |this, _, event: &AppEvent, window, cx| {
351 if matches!(event, AppEvent::Sidebar | AppEvent::Status) {
352 this.apply_open_target(cx);
353 }
354 if matches!(event, AppEvent::Sidebar) {
355 this.focus_opened_quick_view(window, cx);
356 }
357 if matches!(event, AppEvent::Selection) {
358 this.leave_calendar_on_selection(cx);
359 }
360 if matches!(event, AppEvent::Forward) {
361 this.open_forward_dialog(window, cx);
362 }
363 if matches!(event, AppEvent::ImageViewer) {
364 this.open_image_viewer(window, cx);
365 }
366 if matches!(event, AppEvent::StatusMessage) {
367 this.open_status_dialog(window, cx);
368 }
369 if let AppEvent::Settings(section) = event {
370 this.open_settings(*section, window, cx);
371 }
372 if matches!(event, AppEvent::Profile) {
373 this.open_profile_card(window, cx);
374 }
375 cx.notify();
376 });
377 let focus_handle = cx.focus_handle();
378 window.focus(&focus_handle, cx);
379 let notifications =
380 cx.new(|cx| NotificationCenter::new(state.clone(), activity.clone(), window, cx));
381 let call_windows = cx.new(|cx| CallWindows::new(state.clone(), window, cx));
382 let user_input = cx.global::<UserInputHandle>().0.clone();
383 let escape_observation = cx.observe_keystrokes(|this, event, _, cx| {
384 this.user_input.touch();
385 if event.keystroke.key == "escape" && event.action.is_none() {
386 this.state
387 .update(cx, |state, cx| state.escape_call_fullscreen(cx));
388 }
389 });
390 let appearance_observation = cx.observe_window_appearance(window, |_, window, cx| {
391 crate::active_appearance::system_appearance_changed(window.appearance(), cx);
392 });
393 let activation_observation = cx.observe_window_activation(window, |this, window, cx| {
394 if window.is_window_active() {
395 this.state
396 .update(cx, |state, cx| state.refresh_calendar(cx));
397 } else {
398 this.state
399 .update(cx, |state, cx| state.release_push_to_talk(cx));
400 }
401 });
402 let closing = notifications.clone();
403 window.on_window_should_close(cx, move |_, cx| !closing.read(cx).intercept_close(cx));
404 let mut shell = AppShell {
405 state,
406 rail,
407 sidebar,
408 calendar,
409 quick_pane,
410 calls_page,
411 shown_quick_view: None,
412 conversation,
413 call_chat: None,
414 prejoin: None,
415 switcher: None,
416 notifications,
417 _call_windows: call_windows,
418 forward_dialog: None,
419 image_viewer: None,
420 status_dialog: None,
421 shortcuts_dialog: None,
422 agent_dialog: None,
423 settings_dialog: None,
424 profile_card: None,
425 focus_handle,
426 call_window_fullscreen: false,
427 window_was_fullscreen: false,
428 open_target,
429 update: UpdateStatus::UpToDate,
430 toasts: NoticeToasts::default(),
431 user_input,
432 _subscription: subscription,
433 call_mini,
434 _call_media_observation: call_media_observation,
435 _panel_subscriptions: panel_subscriptions,
436 _sidebar_subscription: sidebar_subscription,
437 _agents_subscription: agents_subscription,
438 _agent_subscription: agent_subscription,
439 _escape_observation: escape_observation,
440 _activation_observation: activation_observation,
441 _appearance_observation: appearance_observation,
442 };
443 shell.apply_open_target(cx);
444 shell
445 .state
446 .update(cx, |state, cx| state.refresh_connection_banner(cx));
447 if shell.state.read(cx).mode.demo && std::env::var_os(DEMO_UPDATE_VARIABLE).is_some() {
448 shell.update = UpdateStatus::Ready;
449 }
450 let Startup {
451 switcher_query,
452 composer_text,
453 reply_to_last,
454 launched_by_autostart,
455 } = startup;
456 if shell
457 .notifications
458 .read(cx)
459 .startup()
460 .starts_hidden(launched_by_autostart)
461 {
462 cx.defer_in(window, |this, window, cx| {
463 this.notifications.read(cx).start_in_background(window)
464 });
465 }
466 if let Some(query) = switcher_query {
467 shell.toggle_switcher(&query, window, cx);
468 }
469 if composer_text.is_some() || reply_to_last {
470 cx.defer_in(window, move |this, window, cx| {
471 this.conversation.update(cx, |conversation, cx| {
472 if reply_to_last {
473 conversation.reply_to_latest_from_others(window, cx);
474 }
475 if let Some(text) = composer_text {
476 conversation.set_composer_text(&text, window, cx);
477 }
478 });
479 });
480 }
481 #[cfg(windows)]
482 cx.spawn_in(window, async move |this, cx| {
483 loop {
484 cx.background_executor().timer(updater::POLL_INTERVAL).await;
485 if this
486 .update_in(cx, |this, window, cx| this.poll_update(window, cx))
487 .is_err()
488 {
489 break;
490 }
491 }
492 })
493 .detach();
494 #[cfg(windows)]
495 if let Some(running_tag) = app_base::version::release_tag() {
496 watch_releases(running_tag, cx);
497 }
498 shell
499 }
500
501 #[cfg_attr(not(windows), allow(dead_code))]
502 fn poll_update(&mut self, window: &mut Window, cx: &mut Context<Self>) {
503 if matches!(
504 self.update,
505 UpdateStatus::Failed(_) | UpdateStatus::Installing
506 ) {
507 return;
508 }
509 let Some(paths) = updater::current_paths() else {
510 return;
511 };
512 if self.update == UpdateStatus::UpToDate {
513 if !updater::check(&paths) {
514 return;
515 }
516 self.update = UpdateStatus::Ready;
517 let update_exe = paths.update_exe.clone();
518 cx.background_spawn(async move { updater::prescan(&update_exe) })
519 .detach();
520 }
521 let conversation = self.conversation.read(cx);
522 let idle = updater::is_idle(IdleInputs {
523 window_active: window.is_window_active(),
524 composer_empty: conversation.composer_is_empty(cx),
525 send_in_flight: conversation.send_in_flight(),
526 });
527 if idle {
528 self.restart_into_update(cx);
529 }
530 cx.notify();
531 }
532
533 fn restart_into_update(&mut self, cx: &mut Context<Self>) {
534 if self.update == UpdateStatus::Installing {
535 return;
536 }
537 let Some(paths) = updater::current_paths() else {
538 return;
539 };
540 self.update = UpdateStatus::Installing;
541 cx.notify();
542 cx.spawn(async move |this, cx| {
543 let result = cx
544 .background_spawn(async move { updater::install_and_relaunch(&paths) })
545 .await;
546 let _ = this.update(cx, |this, cx| {
547 match result {
548 Ok(()) => cx.quit(),
549 Err(message) => this.update = UpdateStatus::Failed(message),
550 }
551 cx.notify();
552 });
553 })
554 .detach();
555 }
556
557 fn apply_open_target(&mut self, cx: &mut Context<Self>) {
558 let Some(target) = self.open_target else {
559 return;
560 };
561 let sidebar = &self.state.read(cx).sidebar;
562 let selection = match target {
563 OpenTarget::Chat(index) => sidebar
564 .chats
565 .get(index)
566 .map(|chat| Selection::Chat(chat.id.clone())),
567 OpenTarget::Channel(index) => sidebar
568 .teams
569 .iter()
570 .flat_map(|team| team.channels.iter())
571 .nth(index)
572 .map(|channel| Selection::Channel(channel.id.clone())),
573 };
574 if let Some(selection) = selection {
575 self.open_target = None;
576 self.state
577 .update(cx, |state, cx| state.select(selection, cx));
578 }
579 }
580
581 fn toggle_switcher(
582 &mut self,
583 initial_query: &str,
584 window: &mut Window,
585 cx: &mut Context<Self>,
586 ) {
587 if self.switcher.take().is_some() {
588 self.restore_focus(window, cx);
589 cx.notify();
590 return;
591 }
592 self.close_image_viewer(window, cx);
593 let candidates = candidates_from(self.state.read(cx));
594 let app = self.state.clone();
595 let switcher = cx.new(|cx| Switcher::new(app, candidates, initial_query, window, cx));
596 cx.subscribe_in(
597 &switcher,
598 window,
599 |this, _, event: &SwitcherEvent, window, cx| {
600 match event {
601 SwitcherEvent::Pick(selection) => {
602 let selection = selection.clone();
603 this.state
604 .update(cx, |state, cx| state.select(selection, cx));
605 }
606 SwitcherEvent::PickMessage {
607 selection,
608 message_id,
609 } => {
610 let (selection, message_id) = (selection.clone(), message_id.clone());
611 this.state.update(cx, |state, cx| {
612 state.jump_to_message(selection, message_id, cx)
613 });
614 }
615 SwitcherEvent::PickPerson { user_id } => {
616 let user_id = user_id.clone();
617 this.state
618 .update(cx, |state, cx| state.open_chat_with(&user_id, cx));
619 }
620 SwitcherEvent::Close => {}
621 }
622 this.switcher = None;
623 this.restore_focus(window, cx);
624 cx.notify();
625 },
626 )
627 .detach();
628 self.switcher = Some(switcher);
629 cx.notify();
630 }
631
632 fn open_message(
633 &mut self,
634 conversation_id: &str,
635 message_id: &str,
636 cx: &mut Context<Self>,
637 ) -> bool {
638 let Some(selection) = selection_for(&self.state.read(cx).sidebar, conversation_id) else {
639 return false;
640 };
641 let message_id = message_id.to_owned();
642 self.state.update(cx, |state, cx| {
643 if message_id.is_empty() {
644 state.select(selection, cx)
645 } else {
646 state.jump_to_message(selection, message_id, cx)
647 }
648 });
649 true
650 }
651
652 fn open_status_dialog(&mut self, window: &mut Window, cx: &mut Context<Self>) {
653 if !self
654 .state
655 .update(cx, |state, _| state.take_status_message_request())
656 {
657 return;
658 }
659 self.close_image_viewer(window, cx);
660 self.switcher = None;
661 let app = self.state.clone();
662 let dialog = cx.new(|cx| StatusMessageDialog::new(app, window, cx));
663 cx.subscribe_in(
664 &dialog,
665 window,
666 |this, _, _: &StatusMessageDialogEvent, window, cx| {
667 this.status_dialog = None;
668 this.restore_focus(window, cx);
669 cx.notify();
670 },
671 )
672 .detach();
673 self.status_dialog = Some(dialog);
674 cx.notify();
675 }
676
677 fn open_agent_dialog(
678 &mut self,
679 request: StartRequest,
680 window: &mut Window,
681 cx: &mut Context<Self>,
682 ) {
683 let Some(runs) = crate::agents::runs_handle(cx) else {
684 return;
685 };
686 let settings = runs.read(cx).settings();
687 let Some(action) = settings
688 .actions
689 .iter()
690 .find(|action| action.id == request.action_id)
691 .cloned()
692 else {
693 return;
694 };
695 let agent_name = settings
696 .agents
697 .iter()
698 .find(|agent| agent.id == action.agent_id)
699 .map(|agent| agent.name.clone())
700 .unwrap_or_default();
701 self.switcher = None;
702 let app = self.state.clone();
703 let dialog = cx.new(|cx| StartDialog::new(app, request, action, &agent_name, window, cx));
704 cx.subscribe_in(
705 &dialog,
706 window,
707 |this, _, _: &StartDialogEvent, window, cx| {
708 this.agent_dialog = None;
709 window.focus(&this.focus_handle, cx);
710 cx.notify();
711 },
712 )
713 .detach();
714 self.agent_dialog = Some(dialog);
715 cx.notify();
716 }
717
718 fn open_settings(
719 &mut self,
720 section: SettingsSection,
721 window: &mut Window,
722 cx: &mut Context<Self>,
723 ) {
724 if let Some(dialog) = &self.settings_dialog {
725 dialog.update(cx, |dialog, cx| dialog.show(section, window, cx));
726 return;
727 }
728 self.close_image_viewer(window, cx);
729 self.switcher = None;
730 let (app, center) = (self.state.clone(), self.notifications.clone());
731 let dialog = cx.new(|cx| SettingsDialog::new(app, center, section, window, cx));
732 cx.subscribe_in(
733 &dialog,
734 window,
735 |this, _, _: &SettingsDialogEvent, window, cx| {
736 this.settings_dialog = None;
737 this.restore_focus(window, cx);
738 cx.notify();
739 },
740 )
741 .detach();
742 self.settings_dialog = Some(dialog);
743 cx.notify();
744 }
745
746 fn toggle_shortcuts_dialog(&mut self, window: &mut Window, cx: &mut Context<Self>) {
747 if self.shortcuts_dialog.take().is_some() {
748 self.restore_focus(window, cx);
749 cx.notify();
750 return;
751 }
752 self.close_image_viewer(window, cx);
753 self.switcher = None;
754 let dialog = cx.new(|cx| ShortcutsDialog::new(window, cx));
755 cx.subscribe_in(
756 &dialog,
757 window,
758 |this, _, _: &ShortcutsDialogEvent, window, cx| {
759 this.shortcuts_dialog = None;
760 this.restore_focus(window, cx);
761 cx.notify();
762 },
763 )
764 .detach();
765 self.shortcuts_dialog = Some(dialog);
766 cx.notify();
767 }
768
769 fn open_profile_card(&mut self, window: &mut Window, cx: &mut Context<Self>) {
770 let Some(request) = self
771 .state
772 .update(cx, |state, _| state.take_profile_request())
773 else {
774 return;
775 };
776 self.close_image_viewer(window, cx);
777 if let Some(card) = &self.profile_card {
778 card.update(cx, |card, cx| {
779 card.move_to(request.user_id, request.anchor, cx)
780 });
781 return;
782 }
783 let app = self.state.clone();
784 let card = cx.new(|cx| ProfileCard::new(app, request.user_id, request.anchor, window, cx));
785 cx.subscribe_in(
786 &card,
787 window,
788 |this, _, _: &ProfileCardEvent, window, cx| {
789 this.profile_card = None;
790 this.restore_focus(window, cx);
791 cx.notify();
792 },
793 )
794 .detach();
795 self.profile_card = Some(card);
796 cx.notify();
797 }
798
799 fn open_image_viewer(&mut self, window: &mut Window, cx: &mut Context<Self>) {
800 let Some(request) = self
801 .state
802 .update(cx, |state, _| state.take_image_viewer_request())
803 else {
804 return;
805 };
806 self.switcher = None;
807 let app = self.state.clone();
808 let viewer = cx.new(|cx| ImageViewer::new(app, request, window, cx));
809 cx.subscribe_in(
810 &viewer,
811 window,
812 |this, _, _: &ImageViewerEvent, window, cx| {
813 this.image_viewer = None;
814 window.focus(&this.focus_handle, cx);
815 cx.notify();
816 },
817 )
818 .detach();
819 self.image_viewer = Some(viewer);
820 cx.notify();
821 }
822
823 fn start_call_in_open_chat(&mut self, with_video: bool, cx: &mut Context<Self>) {
824 self.state.update(cx, |state, cx| {
825 if let Some(Selection::Chat(chat_id)) = state.selection.clone() {
826 if with_video {
827 state.start_chat_video_call(&chat_id, cx);
828 } else {
829 state.start_chat_call(&chat_id, cx);
830 }
831 }
832 });
833 }
834
835 fn sync_window_fullscreen(&mut self, wanted: bool, window: &mut Window) {
836 if wanted == self.call_window_fullscreen {
837 return;
838 }
839 self.call_window_fullscreen = wanted;
840 if wanted {
841 self.window_was_fullscreen = window.is_fullscreen();
842 }
843 if wanted != window.is_fullscreen() && (wanted || !self.window_was_fullscreen) {
844 window.toggle_fullscreen();
845 }
846 }
847
848 fn close_image_viewer(&mut self, window: &mut Window, cx: &mut Context<Self>) {
849 if self.image_viewer.take().is_some() {
850 window.focus(&self.focus_handle, cx);
851 cx.notify();
852 }
853 }
854
855 fn restore_focus(&self, window: &mut Window, cx: &mut Context<Self>) {
856 match &self.image_viewer {
857 Some(viewer) => {
858 let handle = viewer.read(cx).focus_handle();
859 window.focus(&handle, cx)
860 }
861 None => window.focus(&self.focus_handle, cx),
862 }
863 }
864
865 fn open_forward_dialog(&mut self, window: &mut Window, cx: &mut Context<Self>) {
866 let Some(source) = self
867 .state
868 .update(cx, |state, _| state.take_forward_request())
869 else {
870 return;
871 };
872 self.switcher = None;
873 let candidates = candidates_from(self.state.read(cx));
874 let app = self.state.clone();
875 let dialog = cx.new(|cx| ForwardDialog::new(app, source, candidates, window, cx));
876 cx.subscribe_in(
877 &dialog,
878 window,
879 |this, _, event: &ForwardDialogEvent, window, cx| {
880 this.forward_dialog = None;
881 this.restore_focus(window, cx);
882 if let ForwardDialogEvent::Sent { target, title } = event {
883 let target = target.clone();
884 let open = NoticeAction::new("Open", move |state, cx| {
885 state.select(target.clone(), cx)
886 });
887 this.state.update(cx, |state, cx| {
888 state.cancel_forward_selection(cx);
889 state.raise_notice(format!("Forwarded to {title}"), Some(open), cx)
890 });
891 }
892 cx.notify();
893 },
894 )
895 .detach();
896 self.forward_dialog = Some(dialog);
897 cx.notify();
898 }
899}
900
901impl AppShell {
902 fn islands(
903 &self,
904 call_view: Option<AnyElement>,
905 show_sidebar: bool,
906 calendar_open: bool,
907 quick_view_open: bool,
908 calls_open: bool,
909 ) -> impl IntoElement {
910 h_flex()
911 .debug_selector(|| "shell/islands".into())
912 .flex_1()
913 .min_h_0()
914 .w_full()
915 .when(show_sidebar, |islands| islands.gap(px(ISLAND_GAP)))
916 .pr(px(ISLAND_GAP))
917 .pb(px(ISLAND_GAP))
918 .child(
919 h_flex()
920 .h_full()
921 .flex_none()
922 .child(self.rail.clone())
923 .when(show_sidebar, |group| {
924 group.child(
925 self.sidebar.clone().cached(
926 StyleRefinement::default()
927 .w(px(SIDEBAR_WIDTH))
928 .h_full()
929 .flex_none(),
930 ),
931 )
932 }),
933 )
934 .child(match (call_view, self.prejoin.clone()) {
935 (Some(call_view), _) => call_view,
936 (None, Some(prejoin)) => prejoin
937 .cached(StyleRefinement::default().flex_1().min_w_0().h_full())
938 .into_any_element(),
939 (None, None) if calls_open => self
940 .calls_page
941 .clone()
942 .cached(StyleRefinement::default().flex_1().min_w_0().h_full())
943 .into_any_element(),
944 (None, None) if quick_view_open => self
945 .quick_pane
946 .clone()
947 .cached(StyleRefinement::default().flex_1().min_w_0().h_full())
948 .into_any_element(),
949 (None, None) if calendar_open => self
950 .calendar
951 .clone()
952 .cached(StyleRefinement::default().flex_1().min_w_0().h_full())
953 .into_any_element(),
954 (None, None) => self
955 .conversation
956 .clone()
957 .cached(StyleRefinement::default().flex_1().min_w_0().h_full())
958 .into_any_element(),
959 })
960 }
961}
962
963impl Render for AppShell {
964 fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
965 let viewed_call = self
966 .state
967 .read(cx)
968 .call
969 .as_ref()
970 .filter(|call| call.viewing);
971 let open_dialogs = [
972 self.state.read(cx).task_dialog.is_some(),
973 self.forward_dialog.is_some(),
974 self.status_dialog.is_some(),
975 self.shortcuts_dialog.is_some(),
976 self.agent_dialog.is_some(),
977 self.settings_dialog.is_some(),
978 viewed_call.is_some() && self.state.read(cx).transfer_picker.is_some(),
979 viewed_call.is_some_and(|call| call.options_dialog.is_some()),
980 viewed_call.is_some_and(|call| call.model.consent_required),
981 ]
982 .into_iter()
983 .filter(|open| *open)
984 .count();
985 elevation::set_app_modal_layers(window, open_dialogs, cx);
986 if open_dialogs > 0 {
987 crate::inline_video::stop(cx);
988 }
989 if let Some(dialog) = self
990 .state
991 .read(cx)
992 .task_dialog
993 .as_ref()
994 .map(|dialog| (dialog.scope.clone(), dialog.card.clone()))
995 {
996 self.state.update(cx, |state, cx| {
997 state.ensure_card_inputs(&dialog.0, &dialog.1, window, cx)
998 });
999 }
1000 if let Some(me) = self.state.read(cx).directory.me.clone() {
1001 let app = self.state.clone();
1002 cx.defer(move |cx| {
1003 app.update(cx, |state, cx| {
1004 state.request_avatars(vec![me.user_id.clone()], cx);
1005 state.request_presence(vec![me.user_id], cx);
1006 });
1007 });
1008 }
1009 let chat_thread = self.state.read(cx).call_chat_thread();
1010 self.sync_call_chat(chat_thread, window, cx);
1011 self.sync_prejoin(window, cx);
1012 let notice = self.state.read(cx).notice.clone();
1013 self.toasts.sync(&self.state, notice.as_ref(), window, cx);
1014 let update_failure = match &self.update {
1015 UpdateStatus::Failed(message) => Some(message.clone()),
1016 _ => None,
1017 };
1018 self.toasts.update_failed(update_failure.as_deref(), window, cx);
1019 let chat_panel = self.call_chat.as_ref().map(|(_, view)| view.clone().into());
1020 let calendar_tab = self.sidebar.read(cx).tab() == SidebarTab::Calendar;
1021 let chats_tab = self.sidebar.read(cx).tab() == SidebarTab::Chats;
1022 let calls_tab = self.sidebar.read(cx).tab() == SidebarTab::Calls;
1023 let state = self.state.read(cx);
1024 let call_fullscreen = state.call_fullscreen();
1025 let window_width = f32::from(window.viewport_size().width);
1026 let panel_open = state
1027 .call
1028 .as_ref()
1029 .is_some_and(|call| call.chat_open || call.people_open || call.transcript_open);
1030 let calendar_open = calendar_tab && !state.viewing_call();
1031 let quick_view_open = chats_tab && state.quick_view.is_some();
1032 let calls_open = calls_tab && !state.viewing_call();
1033 let show_sidebar = !calendar_open
1034 && !calls_open
1035 && !(state.viewing_call()
1036 && !call_fullscreen
1037 && sidebar_hidden_in_call(window_width, panel_open));
1038 let island_width = window_width
1039 - RAIL_WIDTH
1040 - if show_sidebar { SIDEBAR_WIDTH + ISLAND_GAP } else { 0. }
1041 - ISLAND_GAP;
1042 let call_view = render_call_view(&self.state, state, chat_panel, call_fullscreen, island_width)
1043 .filter(|_| state.viewing_call())
1044 .or_else(|| render_call_end(&self.state, state));
1045 let (call_view, call_overlay) = match call_view {
1046 Some(view) if call_fullscreen => (None, Some(render_call_overlay(view))),
1047 view => (view, None),
1048 };
1049 self.sync_window_fullscreen(call_fullscreen, window);
1050 let call_mini = state
1051 .call
1052 .as_ref()
1053 .is_some_and(|call| !call.viewing)
1054 .then(|| self.call_mini.clone());
1055 let stage_overlay = render_stage_overlay(&self.state, state);
1056 let banner = state.connection_banner_text().map(|banner| {
1057 render_connection_banner(
1058 banner,
1059 cx.listener(|this, _, _, cx| {
1060 this.state.update(cx, |state, _| state.retry_live())
1061 }),
1062 )
1063 });
1064 let title_bar = render_title_bar(
1065 crate::active_appearance::current(cx).app_icon,
1066 mode_label(state.mode),
1067 [
1068 update_button(
1069 &self.update,
1070 cx.listener(|this, _, _, cx| this.restart_into_update(cx)),
1071 ),
1072 Some(settings_more_button(&self.state)),
1073 own_status_button(&self.state, state),
1074 ]
1075 .into_iter()
1076 .flatten(),
1077 cx.listener(|this, _, window, cx| this.toggle_switcher("", window, cx)),
1078 );
1079 let shell = div()
1080 .id("app-shell")
1081 .key_context("AppShell")
1082 .track_focus(&self.focus_handle);
1083 self.team_keys(shell, cx)
1084 .on_action(cx.listener(|this, _: &OpenSwitcher, window, cx| {
1085 this.toggle_switcher("", window, cx);
1086 }))
1087 .on_action(cx.listener(|this, _: &NewChat, window, cx| {
1088 this.close_image_viewer(window, cx);
1089 this.state.update(cx, |state, cx| state.start_new_chat(cx));
1090 }))
1091 .on_action(cx.listener(|this, _: &ToggleCallMute, _, cx| {
1092 this.state
1093 .update(cx, |state, cx| state.toggle_call_mute(cx));
1094 }))
1095 .on_action(cx.listener(|this, _: &PushToTalk, _, cx| {
1096 this.state
1097 .update(cx, |state, cx| state.press_push_to_talk(cx));
1098 }))
1099 .on_key_up(cx.listener(|this, event: &KeyUpEvent, _, cx| {
1100 if event.keystroke.key == "space" {
1101 this.state
1102 .update(cx, |state, cx| state.release_push_to_talk(cx));
1103 }
1104 }))
1105 .on_modifiers_changed(cx.listener(|this, event: &ModifiersChangedEvent, _, cx| {
1106 if !event.modifiers.control {
1107 this.state
1108 .update(cx, |state, cx| state.release_push_to_talk(cx));
1109 }
1110 }))
1111 .on_action(cx.listener(|this, _: &OpenSettings, window, cx| {
1112 this.open_settings(SettingsSection::General, window, cx);
1113 }))
1114 .on_action(cx.listener(|this, _: &ShowShortcuts, window, cx| {
1115 this.toggle_shortcuts_dialog(window, cx);
1116 }))
1117 .on_action(cx.listener(|this, _: &OpenActivity, window, cx| {
1118 this.close_image_viewer(window, cx);
1119 this.sidebar
1120 .update(cx, |sidebar, cx| sidebar.show_activity(cx));
1121 }))
1122 .on_action(cx.listener(|this, _: &OpenSaved, window, cx| {
1123 this.close_image_viewer(window, cx);
1124 this.sidebar
1125 .update(cx, |sidebar, cx| sidebar.open_quick_view(QuickView::Saved, cx));
1126 }))
1127 .on_action(cx.listener(|this, _: &OpenCalendar, window, cx| {
1128 this.close_image_viewer(window, cx);
1129 this.sidebar
1130 .update(cx, |sidebar, cx| sidebar.show_calendar(cx));
1131 }))
1132 .on_action(cx.listener(|this, _: &OpenAgents, window, cx| {
1133 this.close_image_viewer(window, cx);
1134 this.sidebar
1135 .update(cx, |sidebar, cx| sidebar.show_agents(cx));
1136 }))
1137 .on_action(cx.listener(|this, _: &OpenChatsTab, window, cx| {
1138 this.close_image_viewer(window, cx);
1139 this.sidebar
1140 .update(cx, |sidebar, cx| sidebar.show_chats(cx));
1141 }))
1142 .on_action(cx.listener(|this, _: &FindInChat, window, cx| {
1143 this.close_image_viewer(window, cx);
1144 this.state
1145 .update(cx, |state, cx| state.close_quick_view(cx));
1146 this.conversation
1147 .update(cx, |conversation, cx| conversation.open_find(window, cx));
1148 }))
1149 .on_action(cx.listener(|this, _: &PopOutSelectedChat, _, cx| {
1150 let selected = this.state.read(cx).selection.clone();
1151 if let Some(Selection::Chat(chat_id)) = selected {
1152 chat_pop_out::pop_out_chat(&this.state, &chat_id, cx);
1153 }
1154 }))
1155 .on_action(cx.listener(|this, _: &OpenChatFilter, window, cx| {
1156 this.close_image_viewer(window, cx);
1157 this.sidebar
1158 .update(cx, |sidebar, cx| sidebar.toggle_filter_box(window, cx));
1159 }))
1160 .on_action(cx.listener(|this, _: &FilterUnreadChats, _, cx| {
1161 this.sidebar
1162 .update(cx, |sidebar, cx| sidebar.toggle_pill(ChatFilterPill::Unread, cx));
1163 }))
1164 .on_action(cx.listener(|this, _: &FilterNonMeetingChats, _, cx| {
1165 this.sidebar
1166 .update(cx, |sidebar, cx| sidebar.toggle_pill(ChatFilterPill::Chats, cx));
1167 }))
1168 .on_action(cx.listener(|this, _: &FilterMeetingChats, _, cx| {
1169 this.sidebar
1170 .update(cx, |sidebar, cx| sidebar.toggle_pill(ChatFilterPill::Meetings, cx));
1171 }))
1172 .on_action(cx.listener(|this, _: &FilterMutedChats, _, cx| {
1173 this.sidebar
1174 .update(cx, |sidebar, cx| sidebar.toggle_pill(ChatFilterPill::Muted, cx));
1175 }))
1176 .on_action(cx.listener(|this, _: &ClearChatFilters, window, cx| {
1177 this.sidebar
1178 .update(cx, |sidebar, cx| sidebar.clear_filters(window, cx));
1179 }))
1180 .on_action(cx.listener(|this, _: &OpenChannelsTab, window, cx| {
1181 this.close_image_viewer(window, cx);
1182 this.sidebar
1183 .update(cx, |sidebar, cx| sidebar.show_channels(cx));
1184 }))
1185 .on_action(cx.listener(|this, _: &OpenCallsTab, window, cx| {
1186 this.close_image_viewer(window, cx);
1187 this.sidebar
1188 .update(cx, |sidebar, cx| sidebar.show_calls(cx));
1189 }))
1190 .on_action(cx.listener(|this, _: &PreviousConversation, window, cx| {
1191 this.close_image_viewer(window, cx);
1192 this.sidebar.update(cx, |sidebar, cx| {
1193 sidebar.select_adjacent(Step::Previous, cx)
1194 });
1195 }))
1196 .on_action(cx.listener(|this, _: &NextConversation, window, cx| {
1197 this.close_image_viewer(window, cx);
1198 this.sidebar
1199 .update(cx, |sidebar, cx| sidebar.select_adjacent(Step::Next, cx));
1200 }))
1201 .on_action(cx.listener(|this, _: &DeclineCall, _, cx| {
1202 this.state
1203 .update(cx, |state, cx| state.decline_ringing_call(cx));
1204 }))
1205 .on_action(cx.listener(|this, _: &JoinMeetingFromToast, _, cx| {
1206 this.state
1207 .update(cx, |state, cx| state.join_latest_meeting_toast(cx));
1208 }))
1209 .on_action(cx.listener(|this, _: &HangUpCall, _, cx| {
1210 this.state.update(cx, |state, cx| state.leave_call(cx));
1211 }))
1212 .on_action(cx.listener(|this, _: &ToggleCallCamera, _, cx| {
1213 this.state
1214 .update(cx, |state, cx| state.toggle_call_camera(cx));
1215 }))
1216 .on_action(cx.listener(|this, _: &ToggleCallShare, _, cx| {
1217 this.state
1218 .update(cx, |state, cx| state.toggle_call_share(cx));
1219 }))
1220 .on_action(cx.listener(|this, _: &ToggleCallHand, _, cx| {
1221 this.state
1222 .update(cx, |state, cx| state.toggle_call_hand(cx));
1223 }))
1224 .on_action(cx.listener(|this, _: &OpenLobbyList, _, cx| {
1225 this.state
1226 .update(cx, |state, cx| state.open_call_lobby_list(cx));
1227 }))
1228 .on_action(cx.listener(|this, _: &StartAudioCall, _, cx| {
1229 this.start_call_in_open_chat(false, cx);
1230 }))
1231 .on_action(cx.listener(|this, _: &StartVideoCall, _, cx| {
1232 this.start_call_in_open_chat(true, cx);
1233 }))
1234 .on_action(cx.listener(|this, _: &ToggleCallFullscreen, _, cx| {
1235 if this.image_viewer.is_some() || !this.state.read(cx).viewing_call() {
1236 cx.propagate();
1237 return;
1238 }
1239 this.state
1240 .update(cx, |state, cx| state.toggle_call_fullscreen(cx));
1241 }))
1242 .on_action(cx.listener(|this, _: &ZoomIn, _, cx| change_zoom(&this.state, WindowZoom::In, cx)))
1243 .on_action(cx.listener(|this, _: &ZoomOut, _, cx| change_zoom(&this.state, WindowZoom::Out, cx)))
1244 .on_action(cx.listener(|this, _: &ZoomReset, _, cx| change_zoom(&this.state, WindowZoom::Reset, cx)))
1245 .on_action(zoom_listener::<ZoomShareIn>(&self.state, ZoomStep::In))
1246 .on_action(zoom_listener::<ZoomShareOut>(&self.state, ZoomStep::Out))
1247 .on_action(zoom_listener::<ZoomShareReset>(&self.state, ZoomStep::Reset))
1248 .on_action(cx.listener(|this, _: &JumpToLastReadOrNewest, _, cx| {
1249 if this.image_viewer.is_some() || this.state.read(cx).viewing_call() {
1250 cx.propagate();
1251 return;
1252 }
1253 this.conversation
1254 .update(cx, |conversation, cx| conversation.jump_to_last_read_or_newest(cx));
1255 }))
1256 .on_action(cx.listener(|this, _: &ReplyToHovered, window, cx| {
1257 this.close_image_viewer(window, cx);
1258 this.conversation.update(cx, |conversation, cx| {
1259 conversation.reply_to_hovered(window, cx)
1260 });
1261 }))
1262 .relative()
1263 .size_full()
1264 .bg(theme::background())
1265 .text_color(theme::text())
1266 .text_size(px(14.))
1267 .child(crate::frame_log::probe("first"))
1268 .child(user_activity::input_probe(self.user_input.clone()))
1269 .child(app_ui_kit::long_press::long_press_right_click())
1270 .child(
1271 v_flex()
1272 .debug_selector(|| "shell".into())
1273 .size_full()
1274 .child(title_bar)
1275 .children(banner)
1276 .child(self.islands(call_view, show_sidebar, calendar_open, quick_view_open, calls_open)),
1277 )
1278 .children(call_mini)
1279 .children(call_overlay)
1280 .children(stage_overlay)
1281 .children(self.image_viewer.clone())
1282 .children(self.switcher.clone())
1283 .children(render_task_dialog(self.state.read(cx), cx))
1284 .children(self.forward_dialog.clone())
1285 .children(self.status_dialog.clone())
1286 .children(self.shortcuts_dialog.clone())
1287 .children(self.agent_dialog.clone())
1288 .children(self.settings_dialog.clone())
1289 .children(self.profile_card.clone())
1290 .child(crate::frame_log::probe("last"))
1291 }
1292}