From 32f2ee3da5cd28dc693ec736eba7d9035005bf35 Mon Sep 17 00:00:00 2001 From: Daniel Sauer Date: Sat, 17 Jan 2026 23:45:41 +0100 Subject: [PATCH 1/2] feat(ui): Add thinking/reasoning block visibility toggle Add toggle button to show/hide thinking blocks after response completion. Currently, reasoning blocks are only visible during streaming and disappear once the response is complete. Changes: - Add showReasoning state to session turn store - Add hasReasoningParts() memo to detect if turn has reasoning content - Show toggle button in response header when reasoning parts exist - Add reasoning section at bottom of response when toggled on - Keep reasoning visible during streaming (existing behavior) Fixes #7866 --- packages/ui/src/components/session-turn.tsx | 32 ++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index c03622105916..ea034afcf8c9 100644 --- a/packages/ui/src/components/session-turn.tsx +++ b/packages/ui/src/components/session-turn.tsx @@ -378,6 +378,17 @@ export function SessionTurn( const isShellMode = createMemo(() => !!shellModePart()) + const hasReasoningParts = createMemo(() => { + for (const m of assistantMessages()) { + const msgParts = data.store.part[m.id] + if (!msgParts) continue + for (const p of msgParts) { + if (p?.type === "reasoning") return true + } + } + return false + }) + const rawStatus = createMemo(() => { const msgs = assistantMessages() let last: PartType | undefined @@ -514,6 +525,8 @@ export function SessionTurn( retrySeconds: 0, status: rawStatus(), duration: duration(), + userMessageHovered: false, + showReasoning: false, }) createEffect(() => { @@ -747,7 +760,7 @@ export function SessionTurn( message={assistantMessage} responsePartId={responsePartId()} hideResponsePart={hideResponsePart()} - hideReasoning={!working()} + hideReasoning={!working() && !store.showReasoning} hidden={hidden} /> )} @@ -775,6 +788,22 @@ export function SessionTurn(

{i18n.t("ui.sessionTurn.summary.response")}

+ + + + +
+
Date: Tue, 10 Feb 2026 20:33:46 +0100 Subject: [PATCH 2/2] chore(ui): type mouse events in thinking toggle --- packages/ui/src/components/session-turn.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index ea034afcf8c9..abad3879cfc8 100644 --- a/packages/ui/src/components/session-turn.tsx +++ b/packages/ui/src/components/session-turn.tsx @@ -794,8 +794,8 @@ export function SessionTurn( data-slot="session-turn-thinking-toggle" variant="ghost" size="small" - onMouseDown={(e) => e.preventDefault()} - onClick={(event) => { + onMouseDown={(e: MouseEvent) => e.preventDefault()} + onClick={(event: MouseEvent) => { event.stopPropagation() setStore("showReasoning", (prev) => !prev) }}