diff --git a/ui/src/components/IssueThreadInteractionCard.test.tsx b/ui/src/components/IssueThreadInteractionCard.test.tsx index fe9d14d7183..b289c72a7b3 100644 --- a/ui/src/components/IssueThreadInteractionCard.test.tsx +++ b/ui/src/components/IssueThreadInteractionCard.test.tsx @@ -91,6 +91,25 @@ describe("IssueThreadInteractionCard", () => { expect(host.querySelectorAll('[role="checkbox"]')).toHaveLength(3); }); + it("only shows question cancellation when a cancel handler is wired", () => { + const withoutHandler = renderCard({ + interaction: pendingAskUserQuestionsInteraction, + onSubmitInteractionAnswers: vi.fn(), + }); + expect(withoutHandler.textContent).not.toContain("Cancel question"); + + act(() => root?.unmount()); + withoutHandler.remove(); + root = null; + + const withHandler = renderCard({ + interaction: pendingAskUserQuestionsInteraction, + onCancelInteraction: vi.fn(), + onSubmitInteractionAnswers: vi.fn(), + }); + expect(withHandler.textContent).toContain("Cancel question"); + }); + it("makes child tasks explicit in suggested task trees", () => { const host = renderCard({ interaction: pendingSuggestedTasksInteraction, diff --git a/ui/src/components/IssueThreadInteractionCard.tsx b/ui/src/components/IssueThreadInteractionCard.tsx index cf5e037a13c..d48bd5b1d3f 100644 --- a/ui/src/components/IssueThreadInteractionCard.tsx +++ b/ui/src/components/IssueThreadInteractionCard.tsx @@ -792,21 +792,23 @@ function AskUserQuestionsCard({ Submit once after you finish the full form.
- + {onCancelInteraction ? ( + + ) : null}