Просмотр исходного кода

feat(desktop): show richer status when thinking

Adam 9 месяцев назад
Родитель
Сommit
0660433921
1 измененных файлов с 11 добавлено и 2 удалено
  1. 11 2
      packages/ui/src/components/session-turn.tsx

+ 11 - 2
packages/ui/src/components/session-turn.tsx

@@ -185,11 +185,20 @@ export function SessionTurn(
                     default:
                       break
                   }
-                } else if (last.type === "reasoning") {
+                }
+
+                if (last.type === "reasoning") {
+                  const text = last.text ?? ""
+                  const trimmed = text.trimStart()
+                  const match = trimmed.match(/^\*\*(.+?)\*\*/)
+                  if (match) return `Thinking · ${match[1].trim()}`
                   return "Thinking"
-                } else if (last.type === "text") {
+                }
+
+                if (last.type === "text") {
                   return "Gathering thoughts"
                 }
+
                 return undefined
               })