feat(ui): add "Let Claude handle it" entry points

This commit is contained in:
mika kuns
2026-07-24 14:21:26 +02:00
parent 327ae2b69c
commit ecbc73495c
4 changed files with 52 additions and 4 deletions
+3 -1
View File
@@ -173,8 +173,10 @@
"contextWorktrees": "Worktrees…",
"contextOpenExplorer": "Im Explorer öffnen",
"contextOpenTerminal": "Im Terminal öffnen",
"contextLetClaude": "Claude machen lassen",
"newList": "Neue Liste",
"addReposTip": "Repos als Listen hinzufügen"
"addReposTip": "Repos als Listen hinzufügen",
"letClaudeAllTip": "Claude machen lassen (alle Listen)"
},
"details": {
"pickUpInTerminalTip": "Diese Sitzung im Terminal fortsetzen",
+3 -1
View File
@@ -173,8 +173,10 @@
"contextWorktrees": "Worktrees…",
"contextOpenExplorer": "Open in Explorer",
"contextOpenTerminal": "Open in Terminal",
"contextLetClaude": "Let Claude handle it",
"newList": "New list",
"addReposTip": "Add repos as lists"
"addReposTip": "Add repos as lists",
"letClaudeAllTip": "Let Claude handle it (all lists)"
},
"details": {
"pickUpInTerminalTip": "Pick up this session in a terminal",
@@ -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)
{
@@ -137,6 +137,11 @@
IsVisible="{Binding WorkingDir, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Command="{Binding $parent[UserControl].((vm:ListsIslandViewModel)DataContext).OpenInTerminalCommand}"
CommandParameter="{Binding}"/>
<Separator IsVisible="{Binding WorkingDir, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<MenuItem Header="{loc:Tr lists.contextLetClaude}"
IsVisible="{Binding WorkingDir, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Command="{Binding $parent[UserControl].((vm:ListsIslandViewModel)DataContext).LetClaudeHandleListCommand}"
CommandParameter="{Binding}"/>
</ContextMenu>
</Border.ContextMenu>
<Grid ColumnDefinitions="20,*,Auto">
@@ -176,8 +181,8 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- New list + import row -->
<Grid ColumnDefinitions="*,Auto" Margin="0,4,0,0">
<!-- New list + import + merge-helper row -->
<Grid ColumnDefinitions="*,Auto,Auto" Margin="0,4,0,0">
<Button Grid.Column="0" Classes="new-list-btn"
Command="{Binding CreateListCommand}">
<StackPanel Orientation="Horizontal" Spacing="6">
@@ -198,6 +203,13 @@
Width="14" Height="14"
Foreground="{DynamicResource TextMuteBrush}"/>
</Button>
<Button Grid.Column="2" Classes="icon-btn" Margin="6,0,0,0"
Command="{Binding LetClaudeHandleAllCommand}"
ToolTip.Tip="{loc:Tr lists.letClaudeAllTip}">
<PathIcon Data="{StaticResource Icon.Broom}"
Width="14" Height="14"
Foreground="{DynamicResource TextMuteBrush}"/>
</Button>
</Grid>
</StackPanel>