From 1888106664852fcd0f38ba5d1c60d7fecc3e8c8b Mon Sep 17 00:00:00 2001
From: Andrew Farkas <6060305+HactarCE@users.noreply.github.com>
Date: Mon, 8 Dec 2025 17:03:51 -0500
Subject: [PATCH] Fix telemetry for `collab::ToggleMute` and remove
unregistered actions (#44432)
This PR removes the actions `collab::ToggleScreenSharing`,
`collab::ToggleMute`, and `collab::ToggleDeafen`. They weren't actually
registered to any behavior, so while it was possible to create a keybind
bound to them, they never actually trigger. I spent ~30 minutes trying
to figure out why I was getting this result for my `"f13":
"collab::ToggleMute"` keybind in the keybind context menu:
(This really threw me for a loop because I was trying to use this as a
known good case to compare against a _different_ action that wasn't
working because I forgot to register it.)
As a side benefit, this enables telemetry for toggling mic mute via
keybind.
Release Notes:
- Fixed telemetry for `collab::Mute`
- Removed unregistered actions `collab::ToggleMute`,
`collab::ToggleDeafen`, and `collab::ToggleScreenshare`
- The correctly-functioning actions `collab::Mute`, `collab::Deafen`,
and `collab::ScreenShare` are recommended instead
---
crates/collab_ui/src/collab_panel.rs | 18 ++----------------
crates/title_bar/src/collab.rs | 26 ++++++--------------------
crates/title_bar/src/title_bar.rs | 2 +-
3 files changed, 9 insertions(+), 37 deletions(-)
diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs
index 7137af21d315391383d3007c148807a7604a1155..2f1e2842cbd2f5024df0608578b7cb7f4bbc158d 100644
--- a/crates/collab_ui/src/collab_panel.rs
+++ b/crates/collab_ui/src/collab_panel.rs
@@ -109,22 +109,8 @@ pub fn init(cx: &mut App) {
});
// TODO: make it possible to bind this one to a held key for push to talk?
// how to make "toggle_on_modifiers_press" contextual?
- workspace.register_action(|_, _: &Mute, window, cx| {
- let room = ActiveCall::global(cx).read(cx).room().cloned();
- if let Some(room) = room {
- window.defer(cx, move |_window, cx| {
- room.update(cx, |room, cx| room.toggle_mute(cx))
- });
- }
- });
- workspace.register_action(|_, _: &Deafen, window, cx| {
- let room = ActiveCall::global(cx).read(cx).room().cloned();
- if let Some(room) = room {
- window.defer(cx, move |_window, cx| {
- room.update(cx, |room, cx| room.toggle_deafen(cx))
- });
- }
- });
+ workspace.register_action(|_, _: &Mute, _, cx| title_bar::collab::toggle_mute(cx));
+ workspace.register_action(|_, _: &Deafen, _, cx| title_bar::collab::toggle_deafen(cx));
workspace.register_action(|_, _: &LeaveCall, window, cx| {
CollabPanel::leave_call(window, cx);
});
diff --git a/crates/title_bar/src/collab.rs b/crates/title_bar/src/collab.rs
index 3af2927464134db1707fb7a93c7fb980fa466c92..8a2d23dd26f81da469fe229eeed586ea8fe49189 100644
--- a/crates/title_bar/src/collab.rs
+++ b/crates/title_bar/src/collab.rs
@@ -8,7 +8,7 @@ use gpui::{
AnyElement, Hsla, IntoElement, MouseButton, Path, ScreenCaptureSource, Styled, WeakEntity,
canvas, point,
};
-use gpui::{App, Task, Window, actions};
+use gpui::{App, Task, Window};
use project::WorktreeSettings;
use rpc::proto::{self};
use settings::{Settings as _, SettingsLocation};
@@ -22,19 +22,7 @@ use workspace::notifications::DetachAndPromptErr;
use crate::TitleBar;
-actions!(
- collab,
- [
- /// Toggles screen sharing on or off.
- ToggleScreenSharing,
- /// Toggles microphone mute.
- ToggleMute,
- /// Toggles deafen mode (mute both microphone and speakers).
- ToggleDeafen
- ]
-);
-
-fn toggle_screen_sharing(
+pub fn toggle_screen_sharing(
screen: anyhow::Result