feat(ui): add "Let Claude handle it" entry points
This commit is contained in:
@@ -16,6 +16,9 @@ namespace ClaudeDo.Ui.ViewModels.Islands;
|
||||
|
||||
public enum ListKind { Smart, Virtual, User }
|
||||
|
||||
/// <summary>Confirmed merge-helper run: the scope list (null = all lists) and the ordered selected task ids.</summary>
|
||||
public sealed record MergeHelperRequest(string? ListId, IReadOnlyList<string> TaskIds);
|
||||
|
||||
public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
{
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
||||
@@ -80,6 +83,35 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||
finally { _worktreesOverviewOpen = false; }
|
||||
}
|
||||
|
||||
/// <summary>Raised after the merge-helper selection dialog is confirmed; the shell opens the ConPTY tile.</summary>
|
||||
public event Action<MergeHelperRequest>? LetClaudeHandleRequested;
|
||||
|
||||
[RelayCommand]
|
||||
private async Task LetClaudeHandleListAsync(ListNavItemViewModel? row)
|
||||
{
|
||||
if (row is null || Dialogs is null || _services is null) return;
|
||||
if (row.Kind != ListKind.User || string.IsNullOrWhiteSpace(row.WorkingDir)) return;
|
||||
var rawId = row.Id.StartsWith("user:", StringComparison.Ordinal) ? row.Id["user:".Length..] : row.Id;
|
||||
var vm = _services.GetRequiredService<MergeHelperSelectionModalViewModel>();
|
||||
vm.Configure(rawId, row.Name);
|
||||
await vm.LoadAsync();
|
||||
var ids = await Dialogs.ShowMergeHelperSelectionAsync(vm);
|
||||
if (ids is { Count: > 0 })
|
||||
LetClaudeHandleRequested?.Invoke(new MergeHelperRequest(rawId, ids));
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task LetClaudeHandleAllAsync()
|
||||
{
|
||||
if (Dialogs is null || _services is null) return;
|
||||
var vm = _services.GetRequiredService<MergeHelperSelectionModalViewModel>();
|
||||
vm.Configure(null, null);
|
||||
await vm.LoadAsync();
|
||||
var ids = await Dialogs.ShowMergeHelperSelectionAsync(vm);
|
||||
if (ids is { Count: > 0 })
|
||||
LetClaudeHandleRequested?.Invoke(new MergeHelperRequest(null, ids));
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenInExplorer(ListNavItemViewModel? row)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user