From 6ba2f3e6444dee14d8911b2a2f97cd1efa8a0919 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Mon, 27 Jul 2026 17:39:55 -0500 Subject: [PATCH] fix(desktop): say a sub-second reasoning block was brief MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../assistant-ui/thread/message-parts.tsx | 13 ++++++++++--- apps/desktop/src/i18n/ar.ts | 1 + apps/desktop/src/i18n/en.ts | 1 + apps/desktop/src/i18n/ja.ts | 1 + apps/desktop/src/i18n/types.ts | 1 + apps/desktop/src/i18n/zh-hant.ts | 1 + apps/desktop/src/i18n/zh.ts | 1 + 7 files changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx index c3ddb255c7f..93a4f24a6eb 100644 --- a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx @@ -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} {pending && ( count === 1 ? 'سيُستأنف عند انتهاء المهمة الخلفية' : `سيُستأنف عند انتهاء ${count} مهام خلفية`, thinking: 'يفكر...', + thoughtBriefly: 'فكّر قليلاً', thoughtFor: duration => `فكّر لمدة ${duration}`, today: time => `اليوم ${time}`, yesterday: time => `أمس ${time}`, diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts index f68b2657bc8..4f5b8fe1048 100644 --- a/apps/desktop/src/i18n/en.ts +++ b/apps/desktop/src/i18n/en.ts @@ -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}`, diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts index ab01313842d..ec428cc7638 100644 --- a/apps/desktop/src/i18n/ja.ts +++ b/apps/desktop/src/i18n/ja.ts @@ -2517,6 +2517,7 @@ export const ja = defineLocale({ ? 'バックグラウンドタスクの完了後に再開します' : `${count} 件のバックグラウンドタスクの完了後に再開します`, thinking: '考え中', + thoughtBriefly: '少し思考', thoughtFor: duration => `${duration} 思考`, today: time => `今日 ${time}`, yesterday: time => `昨日 ${time}`, diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts index f566b17f8cf..ae676578905 100644 --- a/apps/desktop/src/i18n/types.ts +++ b/apps/desktop/src/i18n/types.ts @@ -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 diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts index e133f4ff3e7..cfcda590134 100644 --- a/apps/desktop/src/i18n/zh-hant.ts +++ b/apps/desktop/src/i18n/zh-hant.ts @@ -2438,6 +2438,7 @@ export const zhHant = defineLocale({ resumeWhenBackgroundDone: count => count === 1 ? '背景工作完成後將自動繼續' : `${count} 個背景工作完成後將自動繼續`, thinking: '思考中', + thoughtBriefly: '思考了片刻', thoughtFor: duration => `思考了 ${duration}`, today: time => `今天,${time}`, yesterday: time => `昨天,${time}`, diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts index eebbba53eb8..586b8cedafa 100644 --- a/apps/desktop/src/i18n/zh.ts +++ b/apps/desktop/src/i18n/zh.ts @@ -2839,6 +2839,7 @@ export const zh: Translations = { resumeWhenBackgroundDone: count => count === 1 ? '后台任务完成后将自动继续' : `${count} 个后台任务完成后将自动继续`, thinking: '思考中', + thoughtBriefly: '思考了片刻', thoughtFor: duration => `思考了 ${duration}`, today: time => `今天,${time}`, yesterday: time => `昨天,${time}`,