From 6039f54126fd430af57f9391f28d2b1b2045ba4f Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 14 Jul 2026 15:26:04 -0400 Subject: [PATCH] fix(tui): refine thinking block styling --- packages/tui/src/routes/session/index.tsx | 142 ++++++++++++---------- 1 file changed, 76 insertions(+), 66 deletions(-) diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index 054d35d405..338c3dbf80 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -1090,6 +1090,7 @@ function SessionReasoningGroupView(props: { const { theme, syntax } = useTheme() const renderer = useRenderer() const [expanded, setExpanded] = createSignal(false) + const [hover, setHover] = createSignal(false) const parts = createMemo<{ message: SessionMessageAssistant; part: SessionMessageAssistantReasoning }[]>( (previous) => { const next = props.refs.flatMap((ref) => { @@ -1127,61 +1128,56 @@ function SessionReasoningGroupView(props: { {(item) => } } > - - + setHover(true)} + onMouseOut={() => setHover(false)} onMouseUp={() => { if (renderer.getSelection()?.getSelectedText()) return setExpanded((value) => !value) }} > - {latest() ? `Thinking: ${latest()}` : "Thinking"}} - > - - + Thought - : {latest()} - 1}> · {parts().length} steps - · {Locale.duration(duration())} - - } - > - - - Thought - 1}> · {parts().length} steps - · {Locale.duration(duration())} - - - - + {props.completed ? "Thought" : latest() ? `Thinking: ${latest()}` : "Thinking"} + : {latest()} + 1}> · {parts().length} steps + · {Locale.duration(duration())} + - - {(item) => { - const content = createMemo(() => item.part.text.replace("[REDACTED]", "").trim()) - const summary = createMemo(() => reasoningSummary(content())) - const markdown = createMemo(() => { - if (!summary().title) return content() - if (!summary().body) return `**${summary().title}**` - return `**${summary().title}** · ${summary().body}` - }) - return ( + + + {(item) => ( - + + + - ) - }} - + )} + + @@ -1814,27 +1810,41 @@ function ReasoningPart(props: { return ( - - - - - - + + + + + + + + +