Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: AI Agent https://github.com/siyuan-note/siyuan/issues/17797

Danield0326476118e
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 056099fb0f..0f9ca01ffa 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "تم إنشاء لقطة تلقائيا",
- "agentThinkingDoneTime": "تم التفكير: %s",
- "agentThinking": "يفكر...",
+ "agentThinkingDoneTime": "تم التفكير %s",
+ "agentThinking": "يفكر",
"manageSessions": "إدارة الجلسات",
"scrollToBottom": "التمرير إلى الأسفل",
"featurePreview": "💡 هذه الميزة في مرحلة المعاينة المبكرة، لا تزال غير مستقرة. يرجى عمل نسخة احتياطية لبياناتك قبل الاستخدام",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 86064ce325..3c9cf512ff 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback abgeschlossen",
"snapshotAutoCreated": "Automatischer Snapshot erstellt",
- "agentThinkingDoneTime": "Nachgedacht: %s",
- "agentThinking": "Denkt nach...",
+ "agentThinkingDoneTime": "Nachgedacht %s",
+ "agentThinking": "Denkt nach",
"manageSessions": "Sitzungen verwalten",
"scrollToBottom": "Zum Ende scrollen",
"featurePreview": "💡 Diese Funktion ist in der frühen Vorschau, noch instabil. Bitte sichern Sie Ihre Daten vor der Verwendung",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 31c199ba95..9009f936dd 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "Auto snapshot created",
- "agentThinkingDoneTime": "Thought: %s",
- "agentThinking": "Thinking...",
+ "agentThinkingDoneTime": "Thought %s",
+ "agentThinking": "Thinking",
"manageSessions": "Manage sessions",
"scrollToBottom": "Scroll to bottom",
"featurePreview": "💡 This feature is in early preview, still unstable. Please back up your data before use",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 05e9e846e9..5bac2d08c0 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Restauración completada",
"snapshotAutoCreated": "Instantánea creada automáticamente",
- "agentThinkingDoneTime": "Pensado: %s",
- "agentThinking": "Pensando...",
+ "agentThinkingDoneTime": "Pensado %s",
+ "agentThinking": "Pensando",
"manageSessions": "Gestionar sesiones",
"scrollToBottom": "Desplazar al final",
"featurePreview": "💡 Esta funcionalidad está en vista previa temprana, aún inestable. Haga una copia de seguridad de sus datos antes de usarla",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index a380119cd4..d8287b4b05 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Restauration terminée",
"snapshotAutoCreated": "Instantané créé automatiquement",
- "agentThinkingDoneTime": "Réflexion terminée : %s",
- "agentThinking": "Réflexion...",
+ "agentThinkingDoneTime": "Réflexion terminée %s",
+ "agentThinking": "Réflexion",
"manageSessions": "Gérer les sessions",
"scrollToBottom": "Défiler vers le bas",
"featurePreview": "💡 Cette fonctionnalité est en aperçu anticipé, encore instable. Veuillez sauvegarder vos données avant utilisation",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 045427ae86..92b64d3d10 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "נוצרה תמונת מצב אוטומטית",
- "agentThinkingDoneTime": "חשב: %s",
- "agentThinking": "חושב...",
+ "agentThinkingDoneTime": "חשב %s",
+ "agentThinking": "חושב",
"manageSessions": "ניהול הפעלות",
"scrollToBottom": "גלול לתחתית",
"featurePreview": "💡 תכונה זו בתצוגה מקדימה מוקדמת, עדיין לא יציבה. אנא גבה את הנתונים שלך לפני השימוש",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index f41f2db7b0..6ce5311de3 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "स्वचालित स्नैपशॉट बनाया गया",
- "agentThinkingDoneTime": "सोच लिया: %s",
- "agentThinking": "सोच रहा है...",
+ "agentThinkingDoneTime": "सोच लिया %s",
+ "agentThinking": "सोच रहा है",
"manageSessions": "सत्र प्रबंधित करें",
"scrollToBottom": "नीचे स्क्रॉल करें",
"featurePreview": "💡 यह सुविधा प्रारंभिक पूर्वावलोकन में है, अभी अस्थिर है। कृपया उपयोग से पहले डेटा का बैकअप लें",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 02ad6125b8..94a9e2006e 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "Snapshot otomatis dibuat",
- "agentThinkingDoneTime": "Selesai berpikir: %s",
- "agentThinking": "Berpikir...",
+ "agentThinkingDoneTime": "Selesai berpikir %s",
+ "agentThinking": "Berpikir",
"manageSessions": "Kelola sesi",
"scrollToBottom": "Gulir ke bawah",
"featurePreview": "💡 Fitur ini dalam pratinjau awal, masih tidak stabil. Harap cadangkan data Anda sebelum digunakan",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 2eaa202dc3..da86aa71d6 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completato",
"snapshotAutoCreated": "Snapshot creato automaticamente",
- "agentThinkingDoneTime": "Pensato: %s",
- "agentThinking": "Pensando...",
+ "agentThinkingDoneTime": "Pensato %s",
+ "agentThinking": "Pensando",
"manageSessions": "Gestisci sessioni",
"scrollToBottom": "Scorri in fondo",
"featurePreview": "💡 Questa funzione è in anteprima anticipata, ancora instabile. Eseguire il backup dei dati prima dell'uso",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index c924fa0d3f..03fb60ea56 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "ロールバック完了",
"snapshotAutoCreated": "自動スナップショットが作成されました",
- "agentThinkingDoneTime": "考え済み:%s",
- "agentThinking": "考え中...",
+ "agentThinkingDoneTime": "考え済み %s",
+ "agentThinking": "考え中",
"manageSessions": "セッション管理",
"scrollToBottom": "最下部にスクロール",
"featurePreview": "💡 この機能は早期プレビュー段階で、まだ不安定です。使用前にデータをバックアップしてください",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index f2e2f465ee..94a0e4a68e 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "롤백 완료",
"snapshotAutoCreated": "자동 스냅샷 생성됨",
- "agentThinkingDoneTime": "생각함:%s",
- "agentThinking": "생각 중...",
+ "agentThinkingDoneTime": "생각함 %s",
+ "agentThinking": "생각 중",
"manageSessions": "세션 관리",
"scrollToBottom": "맨 아래로 스크롤",
"featurePreview": "💡 이 기능은 초기 미리보기 단계로 아직 불안정합니다. 사용 전에 데이터를 백업하세요",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 535e88fd63..899bcca4ca 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "Automatische snapshot gemaakt",
- "agentThinkingDoneTime": "Nagedacht: %s",
- "agentThinking": "Denkt na...",
+ "agentThinkingDoneTime": "Nagedacht %s",
+ "agentThinking": "Denkt na",
"manageSessions": "Sessies beheren",
"scrollToBottom": "Naar beneden scrollen",
"featurePreview": "💡 Deze functie is in vroege preview, nog instabiel. Maak een back-up van uw gegevens voor gebruik",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index d707a55de7..7f1d2d2e8f 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "Automatyczna migawka utworzona",
- "agentThinkingDoneTime": "Przemyślane: %s",
- "agentThinking": "Myśli...",
+ "agentThinkingDoneTime": "Przemyślane %s",
+ "agentThinking": "Myśli",
"manageSessions": "Zarządzaj sesjami",
"scrollToBottom": "Przewiń na dół",
"featurePreview": "💡 Ta funkcja jest we wczesnej fazie podglądu, wciąż niestabilna. Przed użyciem wykonaj kopię zapasową danych",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 5d926d8b2e..ec586ff9c0 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Restauração concluída",
"snapshotAutoCreated": "Instantâneo criado automaticamente",
- "agentThinkingDoneTime": "Pensado: %s",
- "agentThinking": "Pensando...",
+ "agentThinkingDoneTime": "Pensado %s",
+ "agentThinking": "Pensando",
"manageSessions": "Gerenciar sessões",
"scrollToBottom": "Rolar para o final",
"featurePreview": "💡 Este recurso está em pré-visualização inicial, ainda instável. Faça backup dos seus dados antes de usar",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 34757e9ce0..4609f68c50 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Откат завершён",
"snapshotAutoCreated": "Автоматический снимок создан",
- "agentThinkingDoneTime": "Обдумано: %s",
- "agentThinking": "Думает...",
+ "agentThinkingDoneTime": "Обдумано %s",
+ "agentThinking": "Думает",
"manageSessions": "Управление сессиями",
"scrollToBottom": "Прокрутить вниз",
"featurePreview": "💡 Эта функция на стадии раннего предпросмотра, пока нестабильна. Сделайте резервную копию данных перед использованием",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index c8d8a9b6fa..001ad76f72 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "Automatická snímka vytvorená",
- "agentThinkingDoneTime": "Premyslené: %s",
- "agentThinking": "Premýšľa...",
+ "agentThinkingDoneTime": "Premyslené %s",
+ "agentThinking": "Premýšľa",
"manageSessions": "Spravovať relácie",
"scrollToBottom": "Posunúť na koniec",
"featurePreview": "💡 Táto funkcia je v ranom náhľade, zatiaľ nestabilná. Pred použitím si zálohujte údaje",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 6a0ccf0beb..989f1483ed 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "สร้างสแนปช็อตอัตโนมัติ",
- "agentThinkingDoneTime": "คิดแล้ว: %s",
- "agentThinking": "กำลังคิด...",
+ "agentThinkingDoneTime": "คิดแล้ว %s",
+ "agentThinking": "กำลังคิด",
"manageSessions": "จัดการเซสชัน",
"scrollToBottom": "เลื่อนไปด้านล่าง",
"featurePreview": "💡 ฟีเจอร์นี้อยู่ในช่วงตัวอย่างเบื้องต้น ยังไม่เสถียร โปรดสำรองข้อมูลก่อนใช้งาน",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 3ed770a45d..f79d703a92 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "Otomatik anlık görüntü oluşturuldu",
- "agentThinkingDoneTime": "Düşünüldü: %s",
- "agentThinking": "Düşünüyor...",
+ "agentThinkingDoneTime": "Düşünüldü %s",
+ "agentThinking": "Düşünüyor",
"manageSessions": "Oturumları yönet",
"scrollToBottom": "Aşağı kaydır",
"featurePreview": "💡 Bu özellik erken önizleme aşamasında, henüz kararsız. Lütfen kullanmadan önce verilerinizi yedekleyin",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 3e22e4d1bf..6b9b68ee40 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "Rollback completed",
"snapshotAutoCreated": "Автоматичний знімок створено",
- "agentThinkingDoneTime": "Обдумано: %s",
- "agentThinking": "Думає...",
+ "agentThinkingDoneTime": "Обдумано %s",
+ "agentThinking": "Думає",
"manageSessions": "Керування сесіями",
"scrollToBottom": "Прокрутити вниз",
"featurePreview": "💡 Ця функція на ранній стадії попереднього перегляду, ще нестабільна. Зробіть резервну копію даних перед використанням",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index cd779f7ae7..8332e47f6f 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "已完成回滚",
"snapshotAutoCreated": "已自动创建数据快照",
- "agentThinkingDoneTime": "已思考:%s",
- "agentThinking": "思考中...",
+ "agentThinkingDoneTime": "已思考 %s",
+ "agentThinking": "思考中",
"manageSessions": "管理会话",
"scrollToBottom": "滚动到底部",
"featurePreview": "💡 该功能处于早期预览阶段,尚不稳定,建议备份数据后再使用",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index afea823202..62a3b25d29 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,8 +1,8 @@
{
"rollbackCompleted": "已完成回滾",
"snapshotAutoCreated": "已自動創建資料快照",
- "agentThinkingDoneTime": "已思考:%s",
- "agentThinking": "思考中...",
+ "agentThinkingDoneTime": "已思考 %s",
+ "agentThinking": "思考中",
"manageSessions": "管理會話",
"scrollToBottom": "滾動到底部",
"featurePreview": "💡 該功能處於早期預覽階段,尚不穩定,建議備份數據後再使用",
diff --git a/app/src/assets/scss/business/_agentChat.scss b/app/src/assets/scss/business/_agentChat.scss
index 378309a5fd..8d3cf3cbf1 100644
--- a/app/src/assets/scss/business/_agentChat.scss
+++ b/app/src/assets/scss/business/_agentChat.scss
@@ -677,17 +677,6 @@ pre:hover .agent-chat__copy-wrap {
user-select: none;
}
-.agent-chat__thinking-dot {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: var(--b3-theme-primary-light);
- animation: agentThinkingPulse 1.4s ease-in-out infinite;
- flex-shrink: 0;
- margin-right: 6px;
- cursor: pointer;
-}
-
.agent-chat__thinking-text {
flex: 1;
}
@@ -766,11 +755,6 @@ pre:hover .agent-chat__copy-wrap {
white-space: nowrap;
}
-@keyframes agentThinkingPulse {
- 0%, 100% { opacity: 0.4; transform: scale(0.8); }
- 50% { opacity: 1; transform: scale(1.2); }
-}
-
.agent-chat__confirm-card {
font-size: 13px;
}
diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts
index c6d3de3752..5546dda695 100644
--- a/app/src/layout/dock/AgentChat.ts
+++ b/app/src/layout/dock/AgentChat.ts
@@ -1314,7 +1314,7 @@ export class AgentChat extends Model {
this.currentThinkingText = "";
this.currentThinkingReasoning = reasoning;
this.currentThinkingReasoningContent = "";
- let text = L.agentThinking || "Thinking...";
+ let text = L.agentThinking || "Thinking";
this.currentThinkingText = text;
@@ -1363,13 +1363,9 @@ export class AgentChat extends Model {
for (let i = 0; i < oldCards.length; i++) {
const card = oldCards[i] as HTMLElement;
card.classList.add("agent-chat__msg--thinking-done");
- const dot = card.querySelector(".agent-chat__thinking-dot");
- if (dot) {
- dot.classList.add("fn__none");
- }
const txtEl = card.querySelector(".agent-chat__thinking-text");
if (txtEl) {
- txtEl.textContent = L.agentThinking || "Thinking...";
+ txtEl.textContent = L.agentThinking || "Thinking";
}
}
if (this.currentThinkingStepContent && this.currentThinkingSteps.length > 0) {
@@ -1431,10 +1427,9 @@ export class AgentChat extends Model {
el.innerHTML = '<div class="agent-chat__thinking-card">' +
'<div class="agent-chat__thinking-header">' +
'<span class="agent-chat__thinking-arrow">' +
- '<svg class="agent-chat__thinking-arrow--expand fn__none"><use xlink:href="#iconExpand"></use></svg>' +
+ '<svg class="agent-chat__thinking-arrow--expand"><use xlink:href="#iconExpand"></use></svg>' +
'<svg class="agent-chat__thinking-arrow--contract fn__none"><use xlink:href="#iconContract"></use></svg>' +
"</span>" +
- '<span class="agent-chat__thinking-dot"></span>' +
'<span class="agent-chat__thinking-text">' + escapeHtml(text) + "</span>" +
"</div>" +
bodyHTML +
@@ -2155,7 +2150,6 @@ export class AgentChat extends Model {
'<svg class="agent-chat__thinking-arrow--expand"><use xlink:href="#iconExpand"></use></svg>' +
'<svg class="agent-chat__thinking-arrow--contract fn__none"><use xlink:href="#iconContract"></use></svg>' +
"</span>" +
- '<span class="agent-chat__thinking-dot fn__none"></span>' +
'<span class="agent-chat__thinking-text">' + escapeHtml(headerText) + "</span>" +
"</div>" +
'<div class="agent-chat__thinking-body">' +
@@ -2172,9 +2166,9 @@ export class AgentChat extends Model {
private formatThinkingHeader(duration?: number): string {
const L = window.siyuan.languages;
if (duration && duration > 0) {
- return L.agentThinkingDoneTime ? L.agentThinkingDoneTime.replace("%s", Math.round(duration) + "s") : (L.agentThinking || "Thinking...");
+ return L.agentThinkingDoneTime ? L.agentThinkingDoneTime.replace("%s", Math.round(duration) + "s") : (L.agentThinking || "Thinking");
}
- return L.agentThinking || "Thinking...";
+ return L.agentThinking || "Thinking";
}
private updateTokenDisplay() {
@@ -2222,7 +2216,7 @@ export class AgentChat extends Model {
const tick = () => {
const sec = Math.floor((Date.now() - this.requestStartTime) / 1000);
const L = window.siyuan.languages;
- const live = (L.agentThinking || "Thinking...") + " " + sec + "s";
+ const live = (L.agentThinking || "Thinking") + " " + sec + "s";
const cards = this.messagesContainer.querySelectorAll(
".agent-chat__msg--thinking:not(.agent-chat__msg--thinking-done) .agent-chat__thinking-text"
);
@@ -2249,8 +2243,8 @@ export class AgentChat extends Model {
const durSec = this.requestStartTime ? (Date.now() - this.requestStartTime) / 1000 : 0;
this.currentThinkingDuration = durSec;
const doneText = durSec > 0
- ? (L.agentThinkingDoneTime ? L.agentThinkingDoneTime.replace("%s", Math.round(durSec) + "s") : (L.agentThinking || "Thinking..."))
- : (L.agentThinking || "Thinking...");
+ ? (L.agentThinkingDoneTime ? L.agentThinkingDoneTime.replace("%s", Math.round(durSec) + "s") : (L.agentThinking || "Thinking"))
+ : (L.agentThinking || "Thinking");
const items = this.messagesContainer.querySelectorAll(
".agent-chat__msg--thinking:not(.agent-chat__msg--thinking-done)"
@@ -2262,14 +2256,6 @@ export class AgentChat extends Model {
if (streamingChat) { streamingChat.remove(); }
}
el.classList.add("agent-chat__msg--thinking-done");
- const dot = el.querySelector(".agent-chat__thinking-dot");
- if (dot) {
- dot.classList.add("fn__none");
- }
- const expandIcon = el.querySelector(".agent-chat__thinking-arrow--expand");
- if (expandIcon) {
- expandIcon.classList.remove("fn__none");
- }
if (doneText) {
const textEl = el.querySelector(".agent-chat__thinking-text");
if (textEl) {
diff --git a/app/src/layout/dock/AgentMessageRenderer.ts b/app/src/layout/dock/AgentMessageRenderer.ts
index 667156c82a..bb40b99a94 100644
--- a/app/src/layout/dock/AgentMessageRenderer.ts
+++ b/app/src/layout/dock/AgentMessageRenderer.ts
@@ -90,7 +90,6 @@ export const renderQuestionCardHTML = (rawQuestions: Array<Record<string, unknow
export const renderRetryCardHTML = (attempt: number, maxRetries: number): string => {
return '<div class="agent-chat__thinking-card">' +
'<div class="agent-chat__thinking-header">' +
- '<span class="agent-chat__thinking-dot"></span>' +
'<span class="agent-chat__thinking-text">' + escapeHtml("Retrying (" + attempt + "/" + maxRetries + ")...") + "</span>" +
"</div>" +
"</div>";
@@ -129,7 +128,6 @@ export const createThinkingCardElement = (step: {reasoning: string; text: string
'<svg class="agent-chat__thinking-arrow--expand"><use xlink:href="#iconExpand"></use></svg>' +
'<svg class="agent-chat__thinking-arrow--contract fn__none"><use xlink:href="#iconContract"></use></svg>' +
"</span>" +
- '<span class="agent-chat__thinking-dot fn__none"></span>' +
'<span class="agent-chat__thinking-text">' + escapeHtml(step.text) + "</span>" +
"</div>" +
'<div class="agent-chat__thinking-body">' +
@@ -146,14 +144,9 @@ export const bindThinkingCardToggle = (el: HTMLElement): void => {
const contractIcon = el.querySelector(".agent-chat__thinking-arrow--contract") as HTMLElement;
if (!header || !body || !expandIcon || !contractIcon) { return; }
header.addEventListener("click", () => {
- const isDone = el.classList.contains("agent-chat__msg--thinking-done");
- if (isDone) {
- const isExpanded = body.classList.toggle("agent-chat__thinking-body--expanded");
- expandIcon.classList.toggle("fn__none", isExpanded);
- contractIcon.classList.toggle("fn__none", !isExpanded);
- } else {
- body.classList.toggle("agent-chat__thinking-body--expanded");
- }
+ const isExpanded = body.classList.toggle("agent-chat__thinking-body--expanded");
+ expandIcon.classList.toggle("fn__none", isExpanded);
+ contractIcon.classList.toggle("fn__none", !isExpanded);
});
};