diff --git a/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx b/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx index d971d6d5540..e5c4831cd16 100644 --- a/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx +++ b/ui/src/components/task-chat/TaskChatCompactInteractionCard.tsx @@ -858,14 +858,15 @@ function ConfirmationCard({ const setReason = (value: string) => updateDraft({ reason: value }); const [actionError, setActionError] = useState(null); const [revisionUploading, setRevisionUploading] = useState(false); + const isPlanConfirmation = + interaction.payload.target?.type === "issue_document" && + interaction.payload.target.key === "plan"; const collectsRejectReason = Boolean( + isPlanConfirmation || interaction.payload.rejectRequiresReason || interaction.payload.allowDeclineReason || interaction.payload.declineReasonPlaceholder, ); - const isPlanConfirmation = - interaction.payload.target?.type === "issue_document" && - interaction.payload.target.key === "plan"; useEffect(() => { if (!draftKey) return; const legacyReason = loadStructuredDraft(draftKey, ""); diff --git a/ui/src/components/task-chat/TaskChatInteractionCard.test.tsx b/ui/src/components/task-chat/TaskChatInteractionCard.test.tsx index c2ddbef6fe2..5d12bb57a08 100644 --- a/ui/src/components/task-chat/TaskChatInteractionCard.test.tsx +++ b/ui/src/components/task-chat/TaskChatInteractionCard.test.tsx @@ -735,6 +735,38 @@ describe("TaskChatInteractionCard", () => { expect(reasonGroup?.className).not.toContain("mt-3"); }); + it("opens the revision note for a plan even when the request does not require a reason", async () => { + const reject = vi.fn(); + const interaction = createRequestConfirmation({ + sourceRunId: "run-plan", + title: "Confirm the two-step plan", + payload: { + version: 1, + prompt: "Please review the plan.", + acceptLabel: "Confirm", + rejectLabel: "Request changes", + rejectRequiresReason: false, + target: { type: "issue_document", issueId: "issue-1", key: "plan", revisionId: "revision-1", revisionNumber: 1 }, + }, + }); + flushSync(() => { + root.render( + + + + + , + ); + }); + const requestChanges = Array.from(container.querySelectorAll("button")) + .find((button) => button.textContent?.trim() === "Request changes"); + flushSync(() => requestChanges?.click()); + expect(reject).not.toHaveBeenCalled(); + expect(container.querySelector('[data-testid="plan-revision-composer"]')).not.toBeNull(); + expect(container.textContent).toContain("(optional)"); + }); + it("shows one question at a time and preserves answers across pages", async () => { const submit = vi.fn(); flushSync(() => {