feat(ui): replace OLE task-row drag with custom ghost drag
Task rows now drive a hand-built pointer-capture drag instead of DragDrop.DoDragDropAsync: armed on press, begins past a 4px threshold so a plain click still selects. The ghost follows the screen cursor across windows; on release the action is decided by what is under the cursor -- over the Mission Control window queues the task (geometric DragHitTest, no OLE drop), over another row in the same user list reorders, anywhere else cancels and restores the row. Drag starts from any list kind (drag-to-queue everywhere) but reorder-on-drop stays gated on CanReorder. Removes the obsolete OLE TaskRowFormat path from both the source and MissionControlView (pane PaneFormat reorder is untouched).
This commit is contained in:
@@ -5,7 +5,6 @@ using Avalonia.Interactivity;
|
||||
using Avalonia.VisualTree;
|
||||
using ClaudeDo.Ui.ViewModels;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
using ClaudeDo.Ui.Views.Islands;
|
||||
|
||||
namespace ClaudeDo.Ui.Views.MissionControl;
|
||||
|
||||
@@ -25,9 +24,7 @@ public partial class MissionControlView : UserControl
|
||||
private void OnPaneDragOver(object? sender, DragEventArgs e)
|
||||
{
|
||||
var dt = e.DataTransfer;
|
||||
var accept = (dt?.Contains(PaneFormat) ?? false)
|
||||
|| (dt?.Contains(TasksIslandView.TaskRowFormat) ?? false);
|
||||
e.DragEffects = accept ? DragDropEffects.Move : DragDropEffects.None;
|
||||
e.DragEffects = (dt?.Contains(PaneFormat) ?? false) ? DragDropEffects.Move : DragDropEffects.None;
|
||||
}
|
||||
|
||||
private void OnPaneDrop(object? sender, DragEventArgs e)
|
||||
@@ -36,15 +33,8 @@ public partial class MissionControlView : UserControl
|
||||
var dt = e.DataTransfer;
|
||||
if (dt is null) return;
|
||||
|
||||
// A task dragged from the main app → queue it.
|
||||
var taskId = dt.TryGetValue(TasksIslandView.TaskRowFormat);
|
||||
if (!string.IsNullOrEmpty(taskId))
|
||||
{
|
||||
_ = vm.EnqueueTaskAsync(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
// A pane dragged within the grid → reorder.
|
||||
// A pane dragged within the grid → reorder. (Drag-to-queue from the main app now arrives
|
||||
// via the custom ghost drag's screen hit-test, not an OLE drop.)
|
||||
var draggedId = dt.TryGetValue(PaneFormat);
|
||||
if (string.IsNullOrEmpty(draggedId)) return;
|
||||
if (e.Source is not Avalonia.Visual src) return;
|
||||
|
||||
Reference in New Issue
Block a user