feat(review): gate Approve & Merge behind opening the diff

Approve & Merge is disabled until the pending changes have been inspected:
DetailsIslandViewModel tracks ReviewDiffViewed (reset on task switch and on
every state change), MergeSectionViewModel raises DiffViewed when a diff or
combined diff is opened and exposes HasReviewableDiff, and a hint sits next
to the button. A review with nothing to inspect (sandbox run, no worktree)
approves straight through.

ClaudeDo-Task: f9809a93
This commit is contained in:
mika kuns
2026-07-24 12:52:57 +02:00
parent 3e9ea3ad58
commit 2aaaa23912
7 changed files with 108 additions and 3 deletions
@@ -348,6 +348,16 @@
<Border Height="1" Background="{DynamicResource LineBrush}"
IsVisible="{Binding Merge.ShowMergeSection}" />
<!-- Gate: you must open the diff before Approve & Merge unlocks. -->
<StackPanel Orientation="Horizontal" Spacing="6"
IsVisible="{Binding ShowReviewDiffHint}">
<PathIcon Data="{StaticResource Icon.ArrowOut}" Width="11" Height="11"
Foreground="{DynamicResource AmberBrush}" VerticalAlignment="Center" />
<TextBlock Classes="meta" VerticalAlignment="Center"
Foreground="{DynamicResource AmberBrush}"
Text="Open the diff to enable merge" />
</StackPanel>
<WrapPanel Orientation="Horizontal">
<Button Classes="btn accent" Content="Approve &amp; Merge" Margin="0,0,8,8"
Command="{Binding ApproveReviewCommand}" />