|
|
@@ -1533,12 +1533,9 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass
|
|
|
{/* Full markdown block: `show` mode, or `hide` after the user opens it. */}
|
|
|
<box
|
|
|
id={"text-" + props.part.id}
|
|
|
- paddingLeft={2}
|
|
|
+ paddingLeft={3}
|
|
|
marginTop={1}
|
|
|
flexDirection="column"
|
|
|
- border={["left"]}
|
|
|
- customBorderChars={SplitBorder.customBorderChars}
|
|
|
- borderColor={theme.backgroundElement}
|
|
|
onMouseUp={toggle}
|
|
|
>
|
|
|
<code
|
|
|
@@ -1546,26 +1543,24 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass
|
|
|
drawUnstyledText={false}
|
|
|
streaming={true}
|
|
|
syntaxStyle={subtleSyntax()}
|
|
|
- content={(inMinimal() ? "▼ " : "") + (isDone() ? "_Thought:_ " : "_Thinking:_ ") + content()}
|
|
|
+ content={(inMinimal() ? "- " : "") + (isDone() ? "_Thought:_ " : "_Thinking:_ ") + content()}
|
|
|
conceal={ctx.conceal()}
|
|
|
fg={theme.textMuted}
|
|
|
/>
|
|
|
</box>
|
|
|
</Match>
|
|
|
<Match when={isDone()}>
|
|
|
- {/* Settled: ▶ at the start as the click-to-expand cue. */}
|
|
|
- <box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0} onMouseUp={toggle}>
|
|
|
- <text fg={theme.textMuted} wrapMode="none">
|
|
|
- {"▶ " +
|
|
|
- (title()
|
|
|
- ? "Thought: " + title() + " · " + Locale.duration(duration())
|
|
|
- : "Thought for " + Locale.duration(duration()))}
|
|
|
- </text>
|
|
|
+ <box
|
|
|
+ id={"text-" + props.part.id}
|
|
|
+ paddingLeft={3}
|
|
|
+ marginTop={1}
|
|
|
+ flexShrink={0}
|
|
|
+ onMouseUp={toggle}
|
|
|
+ >
|
|
|
+ <CollapsedReasoningText title={title()} duration={duration()} />
|
|
|
</box>
|
|
|
</Match>
|
|
|
<Match when={true}>
|
|
|
- {/* Streaming: leading animated spinner, no disclosure arrow yet — it
|
|
|
- snaps in once reasoning settles, signalling "done, click to expand". */}
|
|
|
<box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0} onMouseUp={toggle}>
|
|
|
<Spinner color={theme.textMuted}>{title() ? "Thinking: " + title() : "Thinking"}</Spinner>
|
|
|
</box>
|
|
|
@@ -1575,6 +1570,19 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+function CollapsedReasoningText(props: { title: string | null; duration: number }) {
|
|
|
+ const { theme } = useTheme()
|
|
|
+ const duration = () => Locale.duration(props.duration)
|
|
|
+
|
|
|
+ return (
|
|
|
+ <text fg={theme.warning} wrapMode="none">
|
|
|
+ <span style={{ fg: theme.warning, italic: true }}>
|
|
|
+ {props.title ? "+ Thought · " + props.title + " · " + duration() : "+ Thought · " + duration()}
|
|
|
+ </span>
|
|
|
+ </text>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
function TextPart(props: { last: boolean; part: TextPart; message: AssistantMessage }) {
|
|
|
const ctx = use()
|
|
|
const { theme, syntax } = useTheme()
|