refactor(ui): remove dead inline-layout handlers from DetailsIslandView
The redesigned detail island moved the title, subtask rows, and copy/edit controls into TaskHeaderBar and DescriptionStepsCard, leaving four unused code-behind handlers (OnSubtaskTitleTapped, OnSubtaskEditLostFocus, OnTaskIdTapped, OnCopyDescriptionClick) and their imports. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,7 @@
|
|||||||
using System.Linq;
|
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
|
||||||
using Avalonia.Input.Platform;
|
|
||||||
using Avalonia.Interactivity;
|
|
||||||
using Avalonia.Layout;
|
using Avalonia.Layout;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Threading;
|
|
||||||
using Avalonia.VisualTree;
|
|
||||||
using ClaudeDo.Ui.ViewModels.Islands;
|
using ClaudeDo.Ui.ViewModels.Islands;
|
||||||
using ClaudeDo.Ui.Views.Modals;
|
using ClaudeDo.Ui.Views.Modals;
|
||||||
using ClaudeDo.Ui.Views.Planning;
|
using ClaudeDo.Ui.Views.Planning;
|
||||||
@@ -138,37 +132,4 @@ public partial class DetailsIslandView : UserControl
|
|||||||
_ = dialog.ShowDialog(owner);
|
_ = dialog.ShowDialog(owner);
|
||||||
return await tcs.Task;
|
return await tcs.Task;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSubtaskTitleTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is not Control c || c.DataContext is not SubtaskRowViewModel row) return;
|
|
||||||
row.IsEditing = true;
|
|
||||||
|
|
||||||
var box = (c.GetVisualParent() as Panel)?.GetVisualDescendants().OfType<TextBox>().FirstOrDefault();
|
|
||||||
if (box is not null)
|
|
||||||
Dispatcher.UIThread.Post(() => { box.Focus(); box.SelectAll(); }, DispatcherPriority.Background);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSubtaskEditLostFocus(object? sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (DataContext is DetailsIslandViewModel vm
|
|
||||||
&& sender is Control c && c.DataContext is SubtaskRowViewModel row)
|
|
||||||
vm.CommitSubtaskEditCommand.Execute(row);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnTaskIdTapped(object? sender, TappedEventArgs e)
|
|
||||||
{
|
|
||||||
if (DataContext is not DetailsIslandViewModel vm || vm.Task is null) return;
|
|
||||||
var clipboard = TopLevel.GetTopLevel(this)?.Clipboard;
|
|
||||||
if (clipboard is null) return;
|
|
||||||
await clipboard.SetTextAsync(vm.Task.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnCopyDescriptionClick(object? sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (DataContext is not DetailsIslandViewModel vm) return;
|
|
||||||
var clipboard = TopLevel.GetTopLevel(this)?.Clipboard;
|
|
||||||
if (clipboard is null) return;
|
|
||||||
await clipboard.SetTextAsync(vm.EditableDescription ?? string.Empty);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user