fix(desktop): say a sub-second reasoning block was brief

The elapsed timer counts whole seconds, so reasoning that finished
inside one rendered as "Thought for 0s" — accurate and useless, and on a
turn with several short blocks it repeats down the transcript. Drop the
number below a second and say it was brief instead.
This commit is contained in:
Brooklyn Nicholson 2026-07-27 17:39:55 -05:00
parent f96997c36f
commit 6ba2f3e644
7 changed files with 16 additions and 3 deletions

View file

@ -89,6 +89,15 @@ const ThinkingDisclosure: FC<{
}
}, [elapsed, pending, watching])
// The timer counts whole seconds, so a block that finished inside one reports
// "0s" — accurate and useless. Say it was quick and leave the number out.
const thoughtLabel =
pending || thoughtFor === null
? t.assistant.thread.thinking
: thoughtFor < 1
? t.assistant.thread.thoughtBriefly
: t.assistant.thread.thoughtFor(formatElapsed(thoughtFor))
// While the preview is live, pin the scroll container to the bottom on
// every content growth so the latest tokens are always visible.
useEffect(() => {
@ -143,9 +152,7 @@ const ThinkingDisclosure: FC<{
pending && 'shimmer text-foreground/55'
)}
>
{pending || thoughtFor === null
? t.assistant.thread.thinking
: t.assistant.thread.thoughtFor(formatElapsed(thoughtFor))}
{thoughtLabel}
</span>
{pending && (
<ActivityTimerText

View file

@ -2273,6 +2273,7 @@ export const ar = defineLocale({
resumeWhenBackgroundDone: count =>
count === 1 ? 'سيُستأنف عند انتهاء المهمة الخلفية' : `سيُستأنف عند انتهاء ${count} مهام خلفية`,
thinking: 'يفكر...',
thoughtBriefly: 'فكّر قليلاً',
thoughtFor: duration => `فكّر لمدة ${duration}`,
today: time => `اليوم ${time}`,
yesterday: time => `أمس ${time}`,

View file

@ -2668,6 +2668,7 @@ export const en: Translations = {
? 'Will resume when the background task finishes'
: `Will resume when ${count} background tasks finish`,
thinking: 'Thinking',
thoughtBriefly: 'Thought briefly',
thoughtFor: duration => `Thought for ${duration}`,
today: time => `Today, ${time}`,
yesterday: time => `Yesterday, ${time}`,

View file

@ -2517,6 +2517,7 @@ export const ja = defineLocale({
? 'バックグラウンドタスクの完了後に再開します'
: `${count} 件のバックグラウンドタスクの完了後に再開します`,
thinking: '考え中',
thoughtBriefly: '少し思考',
thoughtFor: duration => `${duration} 思考`,
today: time => `今日 ${time}`,
yesterday: time => `昨日 ${time}`,

View file

@ -2267,6 +2267,7 @@ export interface Translations {
loadingResponse: string
resumeWhenBackgroundDone: (count: number) => string
thinking: string
thoughtBriefly: string
thoughtFor: (duration: string) => string
today: (time: string) => string
yesterday: (time: string) => string

View file

@ -2438,6 +2438,7 @@ export const zhHant = defineLocale({
resumeWhenBackgroundDone: count =>
count === 1 ? '背景工作完成後將自動繼續' : `${count} 個背景工作完成後將自動繼續`,
thinking: '思考中',
thoughtBriefly: '思考了片刻',
thoughtFor: duration => `思考了 ${duration}`,
today: time => `今天,${time}`,
yesterday: time => `昨天,${time}`,

View file

@ -2839,6 +2839,7 @@ export const zh: Translations = {
resumeWhenBackgroundDone: count =>
count === 1 ? '后台任务完成后将自动继续' : `${count} 个后台任务完成后将自动继续`,
thinking: '思考中',
thoughtBriefly: '思考了片刻',
thoughtFor: duration => `思考了 ${duration}`,
today: time => `今天,${time}`,
yesterday: time => `昨天,${time}`,