Add explicit review start action in issue sidebar

This commit is contained in:
dotta 2026-04-08 17:00:57 -05:00
parent efc1e336b0
commit de1cd5858d
2 changed files with 162 additions and 0 deletions

View file

@ -309,6 +309,26 @@ export function IssueProperties({
const approverTrigger = approverValues.length > 0
? <span className="text-sm truncate">{approverValues.map((value) => executionParticipantLabel(value)).join(", ")}</span>
: <span className="text-sm text-muted-foreground">None</span>;
const nextRunnableExecutionStage = (() => {
if (issue.executionState?.status === "changes_requested" && issue.executionState.currentStageType) {
return issue.executionState.currentStageType;
}
if (issue.executionState) return null;
if (reviewerValues.length > 0) return "review";
if (approverValues.length > 0) return "approval";
return null;
})();
const runExecutionButton = (stageType: "review" | "approval") => (
<PropertyRow label="">
<button
type="button"
className="inline-flex items-center rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground"
onClick={() => onUpdate({ status: "in_review" })}
>
{stageType === "review" ? "Run review now" : "Run approval now"}
</button>
</PropertyRow>
);
const currentExecutionLabel = (() => {
if (!issue.executionState?.currentStageType) return null;
const stageLabel = issue.executionState.currentStageType === "review" ? "Review" : "Approval";
@ -892,6 +912,7 @@ export function IssueProperties({
() => updateExecutionPolicy([], approverValues),
)}
</PropertyPicker>
{nextRunnableExecutionStage === "review" && reviewerValues.length > 0 ? runExecutionButton("review") : null}
<PropertyPicker
inline={inline}
@ -910,6 +931,7 @@ export function IssueProperties({
() => updateExecutionPolicy(reviewerValues, []),
)}
</PropertyPicker>
{nextRunnableExecutionStage === "approval" && approverValues.length > 0 ? runExecutionButton("approval") : null}
{currentExecutionLabel && (
<PropertyRow label="Execution">