From 96d40793247ca4d41432362e887c6a114d61df39 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 25 May 2026 16:00:44 +0000 Subject: [PATCH] Render other answers as text links --- .../IssueThreadInteractionCard.test.tsx | 10 +++- .../components/IssueThreadInteractionCard.tsx | 54 +++++++++++-------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/ui/src/components/IssueThreadInteractionCard.test.tsx b/ui/src/components/IssueThreadInteractionCard.test.tsx index eeda1cf6..1ba1762a 100644 --- a/ui/src/components/IssueThreadInteractionCard.test.tsx +++ b/ui/src/components/IssueThreadInteractionCard.test.tsx @@ -74,7 +74,7 @@ describe("IssueThreadInteractionCard", () => { ); const radios = [...host.querySelectorAll('[role="radio"]')]; - expect(radios).toHaveLength(3); + expect(radios).toHaveLength(2); expect(radios[0]?.getAttribute("aria-checked")).toBe("false"); act(() => { @@ -88,7 +88,13 @@ describe("IssueThreadInteractionCard", () => { expect(multiGroup?.getAttribute("aria-labelledby")).toBe( "interaction-questions-default-post-submit-summary-prompt", ); - expect(host.querySelectorAll('[role="checkbox"]')).toHaveLength(4); + expect(host.querySelectorAll('[role="checkbox"]')).toHaveLength(3); + + const otherLink = Array.from(host.querySelectorAll("button")).find((button) => + button.textContent === "Other", + ); + expect(otherLink?.getAttribute("role")).toBeNull(); + expect(otherLink?.className).toContain("underline"); }); it("submits written Other answers for pending questions", async () => { diff --git a/ui/src/components/IssueThreadInteractionCard.tsx b/ui/src/components/IssueThreadInteractionCard.tsx index ca5fb09f..73239fcf 100644 --- a/ui/src/components/IssueThreadInteractionCard.tsx +++ b/ui/src/components/IssueThreadInteractionCard.tsx @@ -821,32 +821,40 @@ function AskUserQuestionsCard({ /> -
- {question.options.map((option) => ( - - toggleOption(question.id, option.id, question.selectionMode)} - /> - ))} - +
+ {question.options.map((option) => ( + + toggleOption(question.id, option.id, question.selectionMode)} + /> + ))} +
+ {otherActiveQuestions[question.id] ? (