fix(review): populate review queue from WaitingForReview tasks
ReviewFilter matched Status==Done && active worktree, but a successful run lands a task in WaitingForReview, so the Review virtual list was always empty. Match WaitingForReview instead; update VirtualFilterTests accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,8 +7,7 @@ public sealed class ReviewFilter : ITaskListFilter
|
|||||||
{
|
{
|
||||||
public string Id => "virtual:review";
|
public string Id => "virtual:review";
|
||||||
public bool Matches(TaskEntity t) =>
|
public bool Matches(TaskEntity t) =>
|
||||||
t.Status == TaskStatus.Done &&
|
t.Status == TaskStatus.WaitingForReview;
|
||||||
t.Worktree is { State: WorktreeState.Active };
|
|
||||||
public bool ShouldCount(TaskEntity t) => Matches(t);
|
public bool ShouldCount(TaskEntity t) => Matches(t);
|
||||||
public bool MatchesAsContext(TaskEntity t, IReadOnlyList<TaskEntity> all) => false;
|
public bool MatchesAsContext(TaskEntity t, IReadOnlyList<TaskEntity> all) => false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,12 +78,12 @@ public sealed class VirtualFilterTests
|
|||||||
// --- Review ---
|
// --- Review ---
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Review_matches_only_done_with_active_worktree()
|
public void Review_matches_only_waiting_for_review()
|
||||||
{
|
{
|
||||||
var f = new ReviewFilter();
|
var f = new ReviewFilter();
|
||||||
Assert.True (f.Matches(TaskFactory.Make("a", status: TaskStatus.Done, worktreeState: WorktreeState.Active)));
|
Assert.True (f.Matches(TaskFactory.Make("a", status: TaskStatus.WaitingForReview, worktreeState: WorktreeState.Active)));
|
||||||
Assert.False(f.Matches(TaskFactory.Make("b", status: TaskStatus.Done, worktreeState: WorktreeState.Merged)));
|
Assert.True (f.Matches(TaskFactory.Make("b", status: TaskStatus.WaitingForReview, worktreeState: null)));
|
||||||
Assert.False(f.Matches(TaskFactory.Make("c", status: TaskStatus.Done, worktreeState: null)));
|
Assert.False(f.Matches(TaskFactory.Make("c", status: TaskStatus.Done, worktreeState: WorktreeState.Active)));
|
||||||
Assert.False(f.Matches(TaskFactory.Make("d", status: TaskStatus.Failed, worktreeState: WorktreeState.Active)));
|
Assert.False(f.Matches(TaskFactory.Make("d", status: TaskStatus.Failed, worktreeState: WorktreeState.Active)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ public sealed class VirtualFilterTests
|
|||||||
public void Review_count_equals_match()
|
public void Review_count_equals_match()
|
||||||
{
|
{
|
||||||
var f = new ReviewFilter();
|
var f = new ReviewFilter();
|
||||||
var t = TaskFactory.Make("a", status: TaskStatus.Done, worktreeState: WorktreeState.Active);
|
var t = TaskFactory.Make("a", status: TaskStatus.WaitingForReview, worktreeState: WorktreeState.Active);
|
||||||
Assert.Equal(f.Matches(t), f.ShouldCount(t));
|
Assert.Equal(f.Matches(t), f.ShouldCount(t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user