feat(ui): add "Let Claude handle it" entry points
This commit is contained in:
@@ -173,8 +173,10 @@
|
|||||||
"contextWorktrees": "Worktrees…",
|
"contextWorktrees": "Worktrees…",
|
||||||
"contextOpenExplorer": "Im Explorer öffnen",
|
"contextOpenExplorer": "Im Explorer öffnen",
|
||||||
"contextOpenTerminal": "Im Terminal öffnen",
|
"contextOpenTerminal": "Im Terminal öffnen",
|
||||||
|
"contextLetClaude": "Claude machen lassen",
|
||||||
"newList": "Neue Liste",
|
"newList": "Neue Liste",
|
||||||
"addReposTip": "Repos als Listen hinzufügen"
|
"addReposTip": "Repos als Listen hinzufügen",
|
||||||
|
"letClaudeAllTip": "Claude machen lassen (alle Listen)"
|
||||||
},
|
},
|
||||||
"details": {
|
"details": {
|
||||||
"pickUpInTerminalTip": "Diese Sitzung im Terminal fortsetzen",
|
"pickUpInTerminalTip": "Diese Sitzung im Terminal fortsetzen",
|
||||||
|
|||||||
@@ -173,8 +173,10 @@
|
|||||||
"contextWorktrees": "Worktrees…",
|
"contextWorktrees": "Worktrees…",
|
||||||
"contextOpenExplorer": "Open in Explorer",
|
"contextOpenExplorer": "Open in Explorer",
|
||||||
"contextOpenTerminal": "Open in Terminal",
|
"contextOpenTerminal": "Open in Terminal",
|
||||||
|
"contextLetClaude": "Let Claude handle it",
|
||||||
"newList": "New list",
|
"newList": "New list",
|
||||||
"addReposTip": "Add repos as lists"
|
"addReposTip": "Add repos as lists",
|
||||||
|
"letClaudeAllTip": "Let Claude handle it (all lists)"
|
||||||
},
|
},
|
||||||
"details": {
|
"details": {
|
||||||
"pickUpInTerminalTip": "Pick up this session in a terminal",
|
"pickUpInTerminalTip": "Pick up this session in a terminal",
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ namespace ClaudeDo.Ui.ViewModels.Islands;
|
|||||||
|
|
||||||
public enum ListKind { Smart, Virtual, User }
|
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
|
public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
||||||
{
|
{
|
||||||
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
||||||
@@ -80,6 +83,35 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
|
|||||||
finally { _worktreesOverviewOpen = false; }
|
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]
|
[RelayCommand]
|
||||||
private void OpenInExplorer(ListNavItemViewModel? row)
|
private void OpenInExplorer(ListNavItemViewModel? row)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -137,6 +137,11 @@
|
|||||||
IsVisible="{Binding WorkingDir, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
IsVisible="{Binding WorkingDir, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||||
Command="{Binding $parent[UserControl].((vm:ListsIslandViewModel)DataContext).OpenInTerminalCommand}"
|
Command="{Binding $parent[UserControl].((vm:ListsIslandViewModel)DataContext).OpenInTerminalCommand}"
|
||||||
CommandParameter="{Binding}"/>
|
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>
|
</ContextMenu>
|
||||||
</Border.ContextMenu>
|
</Border.ContextMenu>
|
||||||
<Grid ColumnDefinitions="20,*,Auto">
|
<Grid ColumnDefinitions="20,*,Auto">
|
||||||
@@ -176,8 +181,8 @@
|
|||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
|
||||||
<!-- New list + import row -->
|
<!-- New list + import + merge-helper row -->
|
||||||
<Grid ColumnDefinitions="*,Auto" Margin="0,4,0,0">
|
<Grid ColumnDefinitions="*,Auto,Auto" Margin="0,4,0,0">
|
||||||
<Button Grid.Column="0" Classes="new-list-btn"
|
<Button Grid.Column="0" Classes="new-list-btn"
|
||||||
Command="{Binding CreateListCommand}">
|
Command="{Binding CreateListCommand}">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
@@ -198,6 +203,13 @@
|
|||||||
Width="14" Height="14"
|
Width="14" Height="14"
|
||||||
Foreground="{DynamicResource TextMuteBrush}"/>
|
Foreground="{DynamicResource TextMuteBrush}"/>
|
||||||
</Button>
|
</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>
|
</Grid>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
Reference in New Issue
Block a user