Add actions for calls (#28048)

Add the following actions for use while calling: `Mute`, `Deafen`,
`ShareProject`, `ScreenShare`, `LeaveCall`

We were also interested in adding push-to-talk functionality for mute,
but that will go in a followup PR

Release Notes:

- Call actions (mute/screenshare/etc.) can now be bound to keys and run from the command palette.

---------

Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
This commit is contained in:
Julia Ryan 2025-04-04 19:32:41 -07:00 committed by GitHub
parent 69d7ea7b60
commit 6ddad64af1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 68 additions and 16 deletions

View file

@ -320,9 +320,9 @@ impl TitleBar {
.label_size(LabelSize::Small)
.on_click(cx.listener(move |this, _, window, cx| {
if is_shared {
this.unshare_project(&Default::default(), window, cx);
this.unshare_project(window, cx);
} else {
this.share_project(&Default::default(), cx);
this.share_project(cx);
}
}))
.into_any_element(),

View file

@ -49,16 +49,7 @@ const MAX_BRANCH_NAME_LENGTH: usize = 40;
const BOOK_ONBOARDING: &str = "https://dub.sh/zed-c-onboarding";
actions!(
collab,
[
ShareProject,
UnshareProject,
ToggleUserMenu,
ToggleProjectMenu,
SwitchBranch
]
);
actions!(collab, [ToggleUserMenu, ToggleProjectMenu, SwitchBranch]);
pub fn init(cx: &mut App) {
cx.observe_new(|workspace: &mut Workspace, window, cx| {
@ -567,7 +558,7 @@ impl TitleBar {
cx.notify();
}
fn share_project(&mut self, _: &ShareProject, cx: &mut Context<Self>) {
fn share_project(&mut self, cx: &mut Context<Self>) {
let active_call = ActiveCall::global(cx);
let project = self.project.clone();
active_call
@ -575,7 +566,7 @@ impl TitleBar {
.detach_and_log_err(cx);
}
fn unshare_project(&mut self, _: &UnshareProject, _: &mut Window, cx: &mut Context<Self>) {
fn unshare_project(&mut self, _: &mut Window, cx: &mut Context<Self>) {
let active_call = ActiveCall::global(cx);
let project = self.project.clone();
active_call