diff --git a/docs/pr-screenshots/pap-2945/monitor-surfaces.png b/docs/pr-screenshots/pap-2945/monitor-surfaces.png new file mode 100644 index 00000000000..1d96eb5f2d0 Binary files /dev/null and b/docs/pr-screenshots/pap-2945/monitor-surfaces.png differ diff --git a/server/src/services/issue-execution-policy.ts b/server/src/services/issue-execution-policy.ts index ec19958fa3c..37b75c84c10 100644 --- a/server/src/services/issue-execution-policy.ts +++ b/server/src/services/issue-execution-policy.ts @@ -500,6 +500,7 @@ function buildStateWithCompletedStages(input: { completedStageIds: input.completedStageIds, lastDecisionId: input.previous?.lastDecisionId ?? null, lastDecisionOutcome: input.previous?.lastDecisionOutcome ?? null, + monitor: input.previous?.monitor ?? null, }; } @@ -519,6 +520,7 @@ function buildSkippedStageCompletedState(input: { completedStageIds: input.completedStageIds, lastDecisionId: input.previous?.lastDecisionId ?? null, lastDecisionOutcome: input.previous?.lastDecisionOutcome ?? null, + monitor: input.previous?.monitor ?? null, }; } diff --git a/ui/src/components/IssueProperties.tsx b/ui/src/components/IssueProperties.tsx index 564cfc6422d..7989c942f94 100644 --- a/ui/src/components/IssueProperties.tsx +++ b/ui/src/components/IssueProperties.tsx @@ -525,7 +525,7 @@ export function IssueProperties({ updateMonitor({ nextCheckAt: nextCheckAt.toISOString(), notes: monitorNotesInput.trim() || null, - scheduledBy: issue.executionPolicy?.monitor?.scheduledBy ?? "assignee", + scheduledBy: "board", kind: serviceName ? "external_service" : null, serviceName, externalRef: null, diff --git a/ui/storybook/stories/monitor-surfaces.stories.tsx b/ui/storybook/stories/monitor-surfaces.stories.tsx index 9d16c13e631..c6473652824 100644 --- a/ui/storybook/stories/monitor-surfaces.stories.tsx +++ b/ui/storybook/stories/monitor-surfaces.stories.tsx @@ -56,6 +56,43 @@ const longerWaitIssue: Issue = { }, }; +const triggeredIssue: Issue = { + ...baseIssue, + monitorNextCheckAt: null, + monitorLastTriggeredAt: new Date(Date.now() - 3 * 60_000), + monitorAttemptCount: 3, + monitorNotes: "Greptile review was checked and needs another pass.", + executionPolicy: { + ...(baseIssue.executionPolicy ?? { mode: "normal", commentRequired: true, stages: [] }), + }, + executionState: { + ...(baseIssue.executionState ?? { + status: "pending", + currentStageId: null, + currentStageIndex: null, + currentStageType: null, + currentParticipant: null, + returnAssignee: null, + reviewRequest: null, + completedStageIds: [], + lastDecisionId: null, + lastDecisionOutcome: null, + }), + monitor: null, + }, +}; + +const clearedIssue: Issue = { + ...baseIssue, + monitorNextCheckAt: null, + monitorLastTriggeredAt: null, + monitorAttemptCount: 0, + monitorNotes: null, + executionPolicy: { + ...(baseIssue.executionPolicy ?? { mode: "normal", commentRequired: true, stages: [] }), + }, +}; + function MonitorSurfaceStories() { return (