Skip to content

The open-source app everyone uses to manage agents at work

fix(ui): reveal completed thinking caret beside label (#15048)

Dotta2a8a99e4a5f6
diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsx
index 384fa952a3..72d4dd8968 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(
+ <MemoryRouter>
+ <IssueChatThread
+ comments={[]}
+ linkedRuns={[run]}
+ timelineEvents={[]}
+ liveRuns={[]}
+ onAdd={async () => {}}
+ showComposer={false}
+ enableLiveTranscriptPolling={false}
+ transcriptsByRunId={issueChatLongThreadTranscriptsByRunId}
+ hasOutputForRun={() => true}
+ />
+ </MemoryRouter>,
+ );
+ });
+
+ 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 f04a25585a..4a9aef03b1 100644
--- a/ui/src/components/IssueChatThread.tsx
+++ b/ui/src/components/IssueChatThread.tsx
@@ -2659,19 +2659,18 @@ function IssueChatAssistantMessage({
<span className="text-xs text-muted-foreground/60">
{chainOfThoughtLabel?.toLowerCase()}
</span>
- <span className="ml-auto flex items-center gap-1.5">
- {message.createdAt ? (
- <span className="text-(length:--text-micro) text-muted-foreground/50">
- {commentDateLabel(message.createdAt)}
- </span>
- ) : null}
- <ChevronDown
- className={cn(
- "h-3.5 w-3.5 text-muted-foreground/40 transition-transform",
- !folded && "rotate-180",
- )}
- />
- </span>
+ <ChevronDown
+ aria-hidden="true"
+ className={cn(
+ "h-3.5 w-3.5 shrink-0 text-muted-foreground/40 opacity-0 transition-[opacity,transform] group-hover:opacity-100 group-focus-visible:opacity-100",
+ !folded && "rotate-180",
+ )}
+ />
+ {message.createdAt ? (
+ <span className="ml-auto text-(length:--text-micro) text-muted-foreground/50">
+ {commentDateLabel(message.createdAt)}
+ </span>
+ ) : null}
</button>
) : (
<div className="mb-1.5 flex items-center gap-2">