fix(ui): hide Submit for review on list-handler panes in Mission Control
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
2b7b58be37
commit
0cfc28adb9
@@ -40,10 +40,14 @@ public sealed partial class ConPtyPaneViewModel : ViewModelBase, IDisposable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Set by the host for a list-handler run ("Let Claude handle it" / "Let Claude merge
|
/// <summary>Set by the host for a list-handler run ("Let Claude handle it" / "Let Claude merge
|
||||||
/// the reviews") pane -- shows the "Abandon run" action. Plain mutable property, not
|
/// the reviews") pane -- shows the "Abandon run" action and hides the manual submit button.</summary>
|
||||||
/// <see cref="ObservableProperty"/>: the host sets it once right after construction, before the
|
[ObservableProperty]
|
||||||
/// pane is added to the visible collection, so no change notification is needed.</summary>
|
[NotifyPropertyChangedFor(nameof(ShowSubmitForReview))]
|
||||||
public bool IsListHandler { get; set; }
|
private bool _isListHandler;
|
||||||
|
|
||||||
|
/// <summary>Whether the header shows "Submit for review": task-based, and not a list handler
|
||||||
|
/// (the handler submits its own task at the end of its merge phase).</summary>
|
||||||
|
public bool ShowSubmitForReview => IsTaskBased && !IsListHandler;
|
||||||
|
|
||||||
[ObservableProperty] private string _displayTitle;
|
[ObservableProperty] private string _displayTitle;
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
Foreground="{DynamicResource TextDimBrush}"
|
Foreground="{DynamicResource TextDimBrush}"
|
||||||
VerticalAlignment="Center" Margin="4,0,0,0" />
|
VerticalAlignment="Center" Margin="4,0,0,0" />
|
||||||
<Button Grid.Column="1" Classes="btn" Margin="0,0,6,0"
|
<Button Grid.Column="1" Classes="btn" Margin="0,0,6,0"
|
||||||
IsVisible="{Binding IsTaskBased}"
|
IsVisible="{Binding ShowSubmitForReview}"
|
||||||
Content="{loc:Tr missionControl.submitForReview}"
|
Content="{loc:Tr missionControl.submitForReview}"
|
||||||
ToolTip.Tip="{loc:Tr missionControl.submitForReviewTip}"
|
ToolTip.Tip="{loc:Tr missionControl.submitForReviewTip}"
|
||||||
Command="{Binding SubmitForReviewCommand}" />
|
Command="{Binding SubmitForReviewCommand}" />
|
||||||
|
|||||||
@@ -1143,6 +1143,19 @@ public class MissionControlViewModelTests : IDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The handler submits its own task, so only a non-handler task-based pane shows the button.
|
||||||
|
[Fact]
|
||||||
|
public async Task ShowSubmitForReview_FalseForListHandler_TrueForNormalTaskPane()
|
||||||
|
{
|
||||||
|
var worker = new RecordingAbandonWorker();
|
||||||
|
using var vm = BuildVm(worker);
|
||||||
|
await vm.OpenConPtySessionAsync("t1");
|
||||||
|
await vm.OpenMergeHelperConPtySessionAsync("L1", new[] { "t2" });
|
||||||
|
|
||||||
|
Assert.True(vm.ConPtySessions[0].ShowSubmitForReview);
|
||||||
|
Assert.False(vm.ConPtySessions[1].ShowSubmitForReview);
|
||||||
|
}
|
||||||
|
|
||||||
// A plain OpenConPtySessionAsync pane (not a list handler) never shows/allows the action --
|
// A plain OpenConPtySessionAsync pane (not a list handler) never shows/allows the action --
|
||||||
// acceptance criterion 5 ("only at handler panes").
|
// acceptance criterion 5 ("only at handler panes").
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
Reference in New Issue
Block a user