Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/CodeShellManager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@

<Button DockPanel.Dock="Left" AutomationProperties.AutomationId="NewSessionBtn" Content="+ New Session" Style="{StaticResource ToolBtn}"
Foreground="#a6e3a1" Click="NewSession_Click" Margin="0,0,4,0"/>
<Button DockPanel.Dock="Left" AutomationProperties.AutomationId="BroadcastBtn" Content="⊕ RC All" Style="{StaticResource ToolBtn}"
Foreground="#89b4fa" Click="BroadcastRemoteControl_Click" Margin="0,0,4,0"
ToolTip="Send /remote-control to all sessions"/>
</DockPanel>
</Border>

Expand Down
25 changes: 16 additions & 9 deletions src/CodeShellManager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -729,15 +729,6 @@ private async Task InitDatabaseAsync()

private void NewSession_Click(object sender, RoutedEventArgs e) => OpenNewSessionDialog();

private void BroadcastRemoteControl_Click(object sender, RoutedEventArgs e)
{
foreach (var session in _vm.Sessions)
{
session.Bridge?.SendToTerminal("/remote-control\r");
session.AlertDetector?.NotifyUserInteracted();
}
}

private void OpenNewSessionDialog(string defaultFolder = "")
=> OpenNewSessionDialogCore(defaultFolder, parent: null);

Expand Down Expand Up @@ -2440,6 +2431,21 @@ private System.Windows.Controls.ContextMenu BuildSidebarQuickMenu()

// Global bulk actions — operate on every live or dormant session, not just one group.
var bulkActions = new System.Windows.Controls.MenuItem { Header = "Bulk actions" };

// Lived on the toolbar as a large "⊕ RC All" button next to "+ New Session", where it
// was easy to hit by mistake for something rarely wanted. Mirrors the per-group
// "Remote control all in group" entry.
var remoteControlAll = new System.Windows.Controls.MenuItem { Header = "Remote control all" };
remoteControlAll.Click += (_, _) =>
{
foreach (var vm in _vm.Sessions.ToList())
{
vm.Bridge?.SendToTerminal("/remote-control\r");
vm.AlertDetector?.NotifyUserInteracted();
}
};
bulkActions.Items.Add(remoteControlAll);

var wakeAllDormant = new System.Windows.Controls.MenuItem { Header = "Wake all dormant" };
wakeAllDormant.Click += async (_, _) =>
{
Expand Down Expand Up @@ -2562,6 +2568,7 @@ private System.Windows.Controls.ContextMenu BuildSidebarQuickMenu()

int liveCount = _vm.Sessions.Count;
int dormantCount = _sessionManager.Sessions.Count(s => s.IsDormant);
remoteControlAll.IsEnabled = liveCount > 0;
wakeAllDormant.IsEnabled = dormantCount > 0;
restartAllGlobal.IsEnabled = liveCount > 0;
sleepAllGlobal.IsEnabled = liveCount > 0;
Expand Down