feat(ui): drag-reorder Mission Control panes by their header

This commit is contained in:
Mika Kuns
2026-06-26 16:11:51 +02:00
parent f63be285a2
commit f6ecfc995f
3 changed files with 60 additions and 2 deletions
@@ -1,8 +1,26 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.VisualTree;
using ClaudeDo.Ui.ViewModels.Islands;
namespace ClaudeDo.Ui.Views.MissionControl;
public partial class MonitorPaneView : UserControl
{
public MonitorPaneView() => InitializeComponent();
private async void OnHeaderPressed(object? sender, PointerPressedEventArgs e)
{
if (DataContext is not TaskMonitorViewModel m || m.SubscribedTaskId is not { } id) return;
if (e.Source is not Avalonia.Visual src) return;
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
// Don't start a drag when the press landed on a header action button.
var button = src as Button ?? src.FindAncestorOfType<Button>();
if (button is not null) return;
var data = new DataTransfer();
data.Add(DataTransferItem.Create(MissionControlView.PaneFormat, id));
await DragDrop.DoDragDropAsync(e, data, DragDropEffects.Move);
}
}