From fdcf96a46ca4f153bf279e347df1be6e724ebbe4 Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 1 May 2026 10:09:13 -0500 Subject: [PATCH] Polish inbox nested issue UI Co-Authored-By: Paperclip --- ui/src/components/IssueChatThread.test.tsx | 43 +++++++++++ .../components/IssueThreadInteractionCard.tsx | 4 +- ui/src/components/IssuesList.test.tsx | 4 +- ui/src/components/SwipeToArchive.tsx | 2 +- ui/src/lib/inbox.test.ts | 39 ++++++++++ ui/src/lib/inbox.ts | 49 ++++++++---- ui/src/pages/Inbox.tsx | 75 +++++++++++-------- 7 files changed, 166 insertions(+), 50 deletions(-) diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsx index 977d2bedbda..dddec3b2cdb 100644 --- a/ui/src/components/IssueChatThread.test.tsx +++ b/ui/src/components/IssueChatThread.test.tsx @@ -1487,6 +1487,49 @@ describe("IssueChatThread", () => { }); }); + it("invokes the cancel callback for pending question interactions", async () => { + const root = createRoot(container); + const onCancelInteraction = vi.fn(async () => undefined); + + await act(async () => { + root.render( + + {}} + onCancelInteraction={onCancelInteraction} + showComposer={false} + enableLiveTranscriptPolling={false} + /> + , + ); + }); + + const cancelButton = Array.from(container.querySelectorAll("button")).find((button) => + button.textContent?.includes("Cancel question"), + ); + expect(cancelButton).toBeTruthy(); + + await act(async () => { + cancelButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })); + }); + + expect(onCancelInteraction).toHaveBeenCalledWith( + expect.objectContaining({ + id: "interaction-question-1", + kind: "ask_user_questions", + }), + ); + + act(() => { + root.unmount(); + }); + }); + it("folds expired request confirmations into an activity row by default", async () => { const root = createRoot(container); diff --git a/ui/src/components/IssueThreadInteractionCard.tsx b/ui/src/components/IssueThreadInteractionCard.tsx index d48bd5b1d3f..a05f0dc2f5b 100644 --- a/ui/src/components/IssueThreadInteractionCard.tsx +++ b/ui/src/components/IssueThreadInteractionCard.tsx @@ -807,8 +807,8 @@ function AskUserQuestionsCard({ ) : ( "Cancel question" )} - - ) : null} + + ) : null}