fix(worktrees): hide batch Merge All in the global overview

The select-all + target picker + Merge All cluster only makes sense per-list: a single target branch is meaningless across repos. Now gated on !IsGlobal; Refresh/Cleanup/Status stay available globally.
This commit is contained in:
Mika Kuns
2026-06-22 17:01:53 +02:00
parent d598a539bc
commit 5231ad6b86

View File

@@ -105,19 +105,22 @@
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<Button Classes="btn" Content="{loc:Tr modals.worktreesOverview.refresh}" Command="{Binding RefreshCommand}" IsEnabled="{Binding !IsBusy}"/> <Button Classes="btn" Content="{loc:Tr modals.worktreesOverview.refresh}" Command="{Binding RefreshCommand}" IsEnabled="{Binding !IsBusy}"/>
<Button Classes="btn" Content="{loc:Tr modals.worktreesOverview.cleanupFinished}" Command="{Binding CleanupFinishedCommand}" IsEnabled="{Binding !IsBusy}"/> <Button Classes="btn" Content="{loc:Tr modals.worktreesOverview.cleanupFinished}" Command="{Binding CleanupFinishedCommand}" IsEnabled="{Binding !IsBusy}"/>
<Button Classes="btn" Content="{loc:Tr modals.worktreesOverview.selectAll}" Command="{Binding ToggleSelectAllCommand}"/> <!-- Batch merge is per-list only: a single target branch is meaningless across repos. -->
<Border Width="1" Background="{DynamicResource LineBrush}" Margin="4,2"/> <StackPanel Orientation="Horizontal" Spacing="8" IsVisible="{Binding !IsGlobal}">
<TextBlock Text="{loc:Tr modals.worktreesOverview.targetLabel}" VerticalAlignment="Center" Foreground="{DynamicResource TextDimBrush}"/> <Button Classes="btn" Content="{loc:Tr modals.worktreesOverview.selectAll}" Command="{Binding ToggleSelectAllCommand}"/>
<ComboBox MinWidth="160" <Border Width="1" Background="{DynamicResource LineBrush}" Margin="4,2"/>
ItemsSource="{Binding MergeTargets}" <TextBlock Text="{loc:Tr modals.worktreesOverview.targetLabel}" VerticalAlignment="Center" Foreground="{DynamicResource TextDimBrush}"/>
SelectedItem="{Binding SelectedTarget, Mode=TwoWay}"/> <ComboBox MinWidth="160"
<Button Classes="btn accent" ItemsSource="{Binding MergeTargets}"
Content="{loc:Tr modals.worktreesOverview.mergeAll}" SelectedItem="{Binding SelectedTarget, Mode=TwoWay}"/>
Command="{Binding MergeAllCommand}"/> <Button Classes="btn accent"
<TextBlock Text="{Binding SelectedCount, StringFormat='{}{0} selected'}" Content="{loc:Tr modals.worktreesOverview.mergeAll}"
VerticalAlignment="Center" Foreground="{DynamicResource TextDimBrush}"/> Command="{Binding MergeAllCommand}"/>
<TextBlock Text="{Binding BatchProgress}" VerticalAlignment="Center" Margin="8,0,0,0" <TextBlock Text="{Binding SelectedCount, StringFormat='{}{0} selected'}"
Foreground="{DynamicResource TextDimBrush}"/> VerticalAlignment="Center" Foreground="{DynamicResource TextDimBrush}"/>
<TextBlock Text="{Binding BatchProgress}" VerticalAlignment="Center" Margin="8,0,0,0"
Foreground="{DynamicResource TextDimBrush}"/>
</StackPanel>
<TextBlock Text="{Binding StatusMessage}" VerticalAlignment="Center" Margin="8,0,0,0" <TextBlock Text="{Binding StatusMessage}" VerticalAlignment="Center" Margin="8,0,0,0"
Foreground="{DynamicResource TextDimBrush}"/> Foreground="{DynamicResource TextDimBrush}"/>
</StackPanel> </StackPanel>