diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsx index 384fa952a3d..72d4dd8968a 100644 --- a/ui/src/components/IssueChatThread.test.tsx +++ b/ui/src/components/IssueChatThread.test.tsx @@ -4813,6 +4813,53 @@ describe("IssueChatThread", () => { }); }); + it("keeps the completed chain-of-thought caret beside its label and reveals it on hover or focus", () => { + const root = createRoot(container); + const run = issueChatLongThreadLinkedRuns[2]; + + act(() => { + root.render( + + {}} + showComposer={false} + enableLiveTranscriptPolling={false} + transcriptsByRunId={issueChatLongThreadTranscriptsByRunId} + hasOutputForRun={() => true} + /> + , + ); + }); + + const header = Array.from(container.querySelectorAll("button")).find((button) => + button.textContent?.includes("worked for 4 minutes"), + ); + expect(header).toBeDefined(); + const label = Array.from(header!.children).find((child) => + child.textContent?.includes("worked for 4 minutes"), + ); + const caret = label?.nextElementSibling; + expect(caret?.tagName.toLowerCase()).toBe("svg"); + expect(header?.classList.contains("group")).toBe(true); + expect(caret?.classList.contains("opacity-0")).toBe(true); + expect(caret?.classList.contains("group-hover:opacity-100")).toBe(true); + expect(caret?.classList.contains("group-focus-visible:opacity-100")).toBe(true); + expect(caret?.nextElementSibling?.classList.contains("ml-auto")).toBe(true); + + act(() => { + header!.click(); + }); + expect(caret?.classList.contains("rotate-180")).toBe(true); + + act(() => { + root.unmount(); + }); + }); + it("folds chain-of-thought when the same message transitions from running to complete", () => { expect( resolveAssistantMessageFoldedState({ diff --git a/ui/src/components/IssueChatThread.tsx b/ui/src/components/IssueChatThread.tsx index f04a25585a9..4a9aef03b1f 100644 --- a/ui/src/components/IssueChatThread.tsx +++ b/ui/src/components/IssueChatThread.tsx @@ -2659,19 +2659,18 @@ function IssueChatAssistantMessage({ {chainOfThoughtLabel?.toLowerCase()} - - {message.createdAt ? ( - - {commentDateLabel(message.createdAt)} - - ) : null} - - +