Skip to content

Automate browser based workflows with AI

Hide the pending-proposal chip while Copilot is working, so Review never lands on a card without actions (SKY-17384) (#8714)

Shuchang Zheng10657e27547c
diff --git a/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.reviewGate.test.tsx b/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.reviewGate.test.tsx
index c578fb884..b783a2b86 100644
--- a/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.reviewGate.test.tsx
+++ b/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.reviewGate.test.tsx
@@ -7794,11 +7794,11 @@ describe("WorkflowCopilotChat — g2 review gate", () => {
// keep_pending_proposal must ride along on the bypassing request.
expect(streamCalls[1]!.body.keep_pending_proposal).toBe(true);
- // Mid-flight: the gate's own actions are not accessible while loading.
+ // Mid-flight: the gate's actions are held, so the chip that jumps to them is too.
expect(screen.queryByRole("button", { name: "Accept" })).toBeNull();
expect(
- screen.getByRole("button", { name: /1 proposal pending/ }),
- ).toBeTruthy();
+ screen.queryByRole("button", { name: /1 proposal pending/ }),
+ ).toBeNull();
// Turn 2 ends with no new proposal; resync picks the row back up.
await act(async () => {
diff --git a/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.tsx b/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.tsx
index 8ee196d03..70573282a 100644
--- a/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.tsx
+++ b/skyvern-frontend/src/routes/workflows/copilot/WorkflowCopilotChat.tsx
@@ -9181,6 +9181,14 @@ export function WorkflowCopilotChat({
gateFailure?.kind === "changed";
// The action row stays locked for `saved` by its own fieldset, so this enables the exit only.
const gateActionable = gateHasSubject && !isLoading && !isLoadingHistory;
+ // The chip jumps to the gate, so it waits for the gate's actions rather than pointing at a card
+ // with nothing to click.
+ const pendingChipVisible = Boolean(
+ proposedWorkflow &&
+ pendingProposalTurnId &&
+ gateActionable &&
+ gateOwnerIndex !== lastTurnIndex,
+ );
const turningOffThisChat =
workflowCopilotChatId !== null &&
(turningOffCounts.get(workflowCopilotChatId) ?? 0) > 0;
@@ -10168,15 +10176,10 @@ export function WorkflowCopilotChat({
{/* Input */}
<div className="border-t border-border p-3">
- {(proposedWorkflow &&
- pendingProposalTurnId &&
- (gateOwnerIndex !== lastTurnIndex || isLoading)) ||
- (autoAccept && workflowCopilotChatId) ? (
+ {pendingChipVisible || (autoAccept && workflowCopilotChatId) ? (
// One status strip: what Copilot is doing, separate from the mode control above it.
<div className="mb-2 flex items-center gap-2 border-t border-border/60 pt-1.5 text-[10.5px] text-muted-foreground">
- {proposedWorkflow &&
- pendingProposalTurnId &&
- (gateOwnerIndex !== lastTurnIndex || isLoading) ? (
+ {pendingChipVisible ? (
<button
type="button"
onClick={() => {