Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style: Add minimap to chat list for quick navigation (#9470)

René Wang8db47eb8161f
diff --git a/locales/ar/chat.json b/locales/ar/chat.json
index 839f86d025b..20c9c9012d3 100644
--- a/locales/ar/chat.json
+++ b/locales/ar/chat.json
@@ -150,6 +150,11 @@
"total": "الإجمالي المستهلك"
}
},
+ "minimap": {
+ "jumpToMessage": "الانتقال إلى الرسالة رقم {{index}}",
+ "nextMessage": "الرسالة التالية",
+ "previousMessage": "الرسالة السابقة"
+ },
"newAgent": "مساعد جديد",
"pin": "تثبيت",
"pinOff": "إلغاء التثبيت",
diff --git a/locales/ar/models.json b/locales/ar/models.json
index 929695700ec..1363ece4d8d 100644
--- a/locales/ar/models.json
+++ b/locales/ar/models.json
@@ -681,7 +681,7 @@
"description": "Claude Sonnet 4 يحسن بشكل كبير على قدرات Sonnet 3.7 الرائدة في الصناعة، ويظهر أداءً ممتازًا في الترميز، محققًا 72.7% في SWE-bench. يوازن النموذج بين الأداء والكفاءة، مناسب للحالات الداخلية والخارجية، ويحقق تحكمًا أكبر في التنفيذ من خلال قابلية تحكم محسنة."
},
"anthropic/claude-sonnet-4.5": {
- "description": "كلود سونيت 4.5 هو أذكى نموذج حتى الآن من أنثروبيك."
+ "description": "كلود سونيت 4.5 هو أذكى نموذج قدمته شركة أنثروبيك حتى الآن."
},
"ascend-tribe/pangu-pro-moe": {
"description": "Pangu-Pro-MoE 72B-A16B هو نموذج لغة ضخم نادر التنشيط يحتوي على 72 مليار معلمة و16 مليار معلمة نشطة، يعتمد على بنية الخبراء المختلطين المجمعة (MoGE). في مرحلة اختيار الخبراء، يتم تجميع الخبراء وتقيد تنشيط عدد متساوٍ من الخبراء داخل كل مجموعة لكل رمز، مما يحقق توازنًا في تحميل الخبراء ويعزز بشكل كبير كفاءة نشر النموذج على منصة Ascend."
@@ -777,7 +777,7 @@
"description": "كلود سونيت 4 نموذج تفكيري يمكنه إنتاج استجابات شبه فورية أو تفكير تدريجي مطول، حيث يمكن للمستخدم رؤية هذه العمليات بوضوح."
},
"claude-sonnet-4-5-20250929": {
- "description": "كلود سونيت 4.5 هو أذكى نموذج حتى الآن من أنثروبيك."
+ "description": "كلود سونيت 4.5 هو أذكى نموذج قدمته شركة أنثروبيك حتى الآن."
},
"codegeex-4": {
"description": "CodeGeeX-4 هو مساعد برمجي قوي، يدعم مجموعة متنوعة من لغات البرمجة في الإجابة الذكية وإكمال الشيفرة، مما يعزز من كفاءة التطوير."
@@ -3149,4 +3149,4 @@
"zai/glm-4.5v": {
"description": "GLM-4.5V مبني على نموذج GLM-4.5-Air الأساسي، يرث التقنيات المثبتة من GLM-4.1V-Thinking، ويوسعها بفعالية من خلال بنية MoE القوية التي تضم 106 مليار معلمة."
}
-}
+}
\ No newline at end of file
diff --git a/locales/bg-BG/chat.json b/locales/bg-BG/chat.json
index 55fdc4867e2..7ee3469f05f 100644
--- a/locales/bg-BG/chat.json
+++ b/locales/bg-BG/chat.json
@@ -150,6 +150,11 @@
"total": "Общо разходи"
}
},
+ "minimap": {
+ "jumpToMessage": "Отиди до съобщение № {{index}}",
+ "nextMessage": "Следващо съобщение",
+ "previousMessage": "Предишно съобщение"
+ },
"newAgent": "Нов агент",
"pin": "Закачи",
"pinOff": "Откачи",
diff --git a/locales/de-DE/chat.json b/locales/de-DE/chat.json
index fdeae309a30..65c7449bf59 100644
--- a/locales/de-DE/chat.json
+++ b/locales/de-DE/chat.json
@@ -150,6 +150,11 @@
"total": "Gesamter Verbrauch"
}
},
+ "minimap": {
+ "jumpToMessage": "Zur Nachricht Nr. {{index}} springen",
+ "nextMessage": "Nächste Nachricht",
+ "previousMessage": "Vorherige Nachricht"
+ },
"newAgent": "Neuer Assistent",
"pin": "Anheften",
"pinOff": "Anheften aufheben",
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 1560aaf85c0..6a5ee0e37c0 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -150,6 +150,11 @@
"total": "Total Consumption"
}
},
+ "minimap": {
+ "jumpToMessage": "Jump to message {{index}}",
+ "nextMessage": "Next message",
+ "previousMessage": "Previous message"
+ },
"newAgent": "New Assistant",
"pin": "Pin",
"pinOff": "Unpin",
diff --git a/locales/es-ES/chat.json b/locales/es-ES/chat.json
index b53f2da6de3..4b926bd461c 100644
--- a/locales/es-ES/chat.json
+++ b/locales/es-ES/chat.json
@@ -150,6 +150,11 @@
"total": "Total consumido"
}
},
+ "minimap": {
+ "jumpToMessage": "Ir al mensaje número {{index}}",
+ "nextMessage": "Mensaje siguiente",
+ "previousMessage": "Mensaje anterior"
+ },
"newAgent": "Nuevo asistente",
"pin": "Fijar",
"pinOff": "Desfijar",
diff --git a/locales/es-ES/tool.json b/locales/es-ES/tool.json
index b82d488bc0f..60aea13b714 100644
--- a/locales/es-ES/tool.json
+++ b/locales/es-ES/tool.json
@@ -4,7 +4,7 @@
"executing": "Ejecutando...",
"files": "Archivos:",
"output": "Salida:",
- "returnValue": "Valor de retorno:"
+ "returnValue": "Valor devuelto:"
},
"dalle": {
"autoGenerate": "Auto-generar",
@@ -86,4 +86,4 @@
"keyRequired": "La clave del campo no puede estar vacía",
"stringifyError": "No se puede serializar el parámetro, por favor verifica el formato de los parámetros"
}
-}
+}
\ No newline at end of file
diff --git a/locales/fa-IR/chat.json b/locales/fa-IR/chat.json
index 672ebefe03c..dd762f9b8b0 100644
--- a/locales/fa-IR/chat.json
+++ b/locales/fa-IR/chat.json
@@ -150,6 +150,11 @@
"total": "مجموع مصرف"
}
},
+ "minimap": {
+ "jumpToMessage": "رفتن به پیام شماره {{index}}",
+ "nextMessage": "پیام بعدی",
+ "previousMessage": "پیام قبلی"
+ },
"newAgent": "دستیار جدید",
"pin": "سنجاق کردن",
"pinOff": "لغو سنجاق",
diff --git a/locales/fa-IR/models.json b/locales/fa-IR/models.json
index 6be68fb04ce..bfcdfdda1b8 100644
--- a/locales/fa-IR/models.json
+++ b/locales/fa-IR/models.json
@@ -681,7 +681,7 @@
"description": "Claude Sonnet 4 بهبود قابل توجهی بر توانایی‌های پیشرو در صنعت Sonnet 3.7 دارد و در کدنویسی عملکرد برجسته‌ای با 72.7% در SWE-bench ارائه می‌دهد. این مدل تعادل بین عملکرد و کارایی را حفظ کرده و برای موارد استفاده داخلی و خارجی مناسب است و با کنترل‌پذیری بهبود یافته، کنترل بیشتری بر نتایج فراهم می‌کند."
},
"anthropic/claude-sonnet-4.5": {
- "description": "Claude Sonnet 4.5 هو هوشمندترین مدل تا به امروز از Anthropic."
+ "description": "کلود سونت ۴.۵ هوشمندترین مدل تا به امروز شرکت Anthropic است."
},
"ascend-tribe/pangu-pro-moe": {
"description": "Pangu-Pro-MoE 72B-A16B یک مدل زبان بزرگ پراکنده با 72 میلیارد پارامتر و 16 میلیارد پارامتر فعال است که بر اساس معماری متخصصان ترکیبی گروه‌بندی شده (MoGE) ساخته شده است. در مرحله انتخاب متخصص، متخصصان به گروه‌هایی تقسیم می‌شوند و توکن‌ها در هر گروه به تعداد مساوی متخصصان فعال می‌شوند تا تعادل بار متخصصان حفظ شود، که به طور قابل توجهی کارایی استقرار مدل را در پلتفرم Ascend افزایش می‌دهد."
@@ -777,7 +777,7 @@
"description": "مدل تفکر Claude Sonnet 4 می‌تواند پاسخ‌های تقریباً فوری یا تفکر گام به گام طولانی‌مدت تولید کند که کاربران می‌توانند این فرآیندها را به وضوح مشاهده کنند."
},
"claude-sonnet-4-5-20250929": {
- "description": "Claude Sonnet 4.5 هو هوشمندترین مدل تا به امروز از Anthropic."
+ "description": "کلود سونت ۴.۵ هوشمندترین مدل تا به امروز شرکت Anthropic است."
},
"codegeex-4": {
"description": "CodeGeeX-4 یک دستیار برنامه‌نویسی قدرتمند مبتنی بر هوش مصنوعی است که از پرسش و پاسخ هوشمند و تکمیل کد در زبان‌های برنامه‌نویسی مختلف پشتیبانی می‌کند و بهره‌وری توسعه را افزایش می‌دهد."
@@ -3149,4 +3149,4 @@
"zai/glm-4.5v": {
"description": "GLM-4.5V بر پایه مدل پایه GLM-4.5-Air ساخته شده است، فناوری اثبات شده GLM-4.1V-Thinking را به ارث برده و در عین حال با معماری قدرتمند MoE با 106 میلیارد پارامتر به طور مؤثر مقیاس‌پذیر شده است."
}
-}
+}
\ No newline at end of file
diff --git a/locales/fr-FR/chat.json b/locales/fr-FR/chat.json
index 58637baed32..a0e9f7a24cf 100644
--- a/locales/fr-FR/chat.json
+++ b/locales/fr-FR/chat.json
@@ -150,6 +150,11 @@
"total": "Total consommé"
}
},
+ "minimap": {
+ "jumpToMessage": "Aller au message n° {{index}}",
+ "nextMessage": "Message suivant",
+ "previousMessage": "Message précédent"
+ },
"newAgent": "Nouvel agent",
"pin": "Épingler",
"pinOff": "Désépingler",
diff --git a/locales/fr-FR/models.json b/locales/fr-FR/models.json
index 0fece9bfc8f..f01d9d350e1 100644
--- a/locales/fr-FR/models.json
+++ b/locales/fr-FR/models.json
@@ -681,7 +681,7 @@
"description": "Claude Sonnet 4 améliore significativement les capacités de Sonnet 3.7, excelle en codage avec un score de pointe de 72,7 % sur SWE-bench. Ce modèle équilibre performance et efficacité, adapté aux cas d'usage internes et externes, avec un contrôle accru grâce à une meilleure contrôlabilité."
},
"anthropic/claude-sonnet-4.5": {
- "description": "Claude Sonnet 4.5 est le modèle le plus intelligent développé par Anthropic à ce jour."
+ "description": "Claude Sonnet 4.5 est le modèle le plus intelligent d'Anthropic à ce jour."
},
"ascend-tribe/pangu-pro-moe": {
"description": "Pangu-Pro-MoE 72B-A16B est un grand modèle de langage sparse à 72 milliards de paramètres, avec 16 milliards de paramètres activés. Il repose sur une architecture Mixture of Experts groupée (MoGE), qui regroupe les experts lors de la sélection et contraint chaque token à activer un nombre égal d'experts dans chaque groupe, assurant ainsi un équilibre de charge entre les experts et améliorant considérablement l'efficacité de déploiement sur la plateforme Ascend."
@@ -777,7 +777,7 @@
"description": "Le modèle de réflexion Claude Sonnet 4 produit des réponses quasi instantanées ou des raisonnements prolongés étape par étape, clairement visibles par l'utilisateur."
},
"claude-sonnet-4-5-20250929": {
- "description": "Claude Sonnet 4.5 est le modèle le plus intelligent développé par Anthropic à ce jour."
+ "description": "Claude Sonnet 4.5 est le modèle le plus intelligent d'Anthropic à ce jour."
},
"codegeex-4": {
"description": "CodeGeeX-4 est un puissant assistant de programmation AI, prenant en charge des questions intelligentes et l'achèvement de code dans divers langages de programmation, améliorant l'efficacité du développement."
@@ -3149,4 +3149,4 @@
"zai/glm-4.5v": {
"description": "GLM-4.5V est construit sur le modèle de base GLM-4.5-Air, héritant des techniques éprouvées de GLM-4.1V-Thinking, tout en réalisant une mise à l'échelle efficace grâce à une puissante architecture MoE de 106 milliards de paramètres."
}
-}
+}
\ No newline at end of file
diff --git a/locales/it-IT/chat.json b/locales/it-IT/chat.json
index 606c6ac6c2f..b57f04abed0 100644
--- a/locales/it-IT/chat.json
+++ b/locales/it-IT/chat.json
@@ -150,6 +150,11 @@
"total": "Totale consumato"
}
},
+ "minimap": {
+ "jumpToMessage": "Vai al messaggio n. {{index}}",
+ "nextMessage": "Messaggio successivo",
+ "previousMessage": "Messaggio precedente"
+ },
"newAgent": "Nuovo assistente",
"pin": "Fissa in alto",
"pinOff": "Annulla fissaggio in alto",
diff --git a/locales/ja-JP/chat.json b/locales/ja-JP/chat.json
index 82b76cdb73f..7d1f04df21c 100644
--- a/locales/ja-JP/chat.json
+++ b/locales/ja-JP/chat.json
@@ -150,6 +150,11 @@
"total": "合計消費"
}
},
+ "minimap": {
+ "jumpToMessage": "メッセージ {{index}} へジャンプ",
+ "nextMessage": "次のメッセージ",
+ "previousMessage": "前のメッセージ"
+ },
"newAgent": "新しいエージェント",
"pin": "ピン留め",
"pinOff": "ピン留め解除",
diff --git a/locales/ko-KR/chat.json b/locales/ko-KR/chat.json
index 7b46dd902e4..03438dca793 100644
--- a/locales/ko-KR/chat.json
+++ b/locales/ko-KR/chat.json
@@ -150,6 +150,11 @@
"total": "총 소모"
}
},
+ "minimap": {
+ "jumpToMessage": "{{index}}번째 메시지로 이동",
+ "nextMessage": "다음 메시지",
+ "previousMessage": "이전 메시지"
+ },
"newAgent": "새 도우미",
"pin": "고정",
"pinOff": "고정 해제",
diff --git a/locales/nl-NL/chat.json b/locales/nl-NL/chat.json
index 74208e9d3f0..22d2767ef55 100644
--- a/locales/nl-NL/chat.json
+++ b/locales/nl-NL/chat.json
@@ -150,6 +150,11 @@
"total": "Totaal verbruik"
}
},
+ "minimap": {
+ "jumpToMessage": "Ga naar bericht {{index}}",
+ "nextMessage": "Volgend bericht",
+ "previousMessage": "Vorig bericht"
+ },
"newAgent": "Nieuwe assistent",
"pin": "Vastzetten",
"pinOff": "Vastzetten uitschakelen",
diff --git a/locales/pl-PL/chat.json b/locales/pl-PL/chat.json
index 4829eef93b9..ea56f20ffb5 100644
--- a/locales/pl-PL/chat.json
+++ b/locales/pl-PL/chat.json
@@ -150,6 +150,11 @@
"total": "Całkowite zużycie"
}
},
+ "minimap": {
+ "jumpToMessage": "Przejdź do wiadomości nr {{index}}",
+ "nextMessage": "Następna wiadomość",
+ "previousMessage": "Poprzednia wiadomość"
+ },
"newAgent": "Nowy asystent",
"pin": "Przypnij",
"pinOff": "Odepnij",
diff --git a/locales/pt-BR/chat.json b/locales/pt-BR/chat.json
index 79749ff9f37..7c8a8e66272 100644
--- a/locales/pt-BR/chat.json
+++ b/locales/pt-BR/chat.json
@@ -150,6 +150,11 @@
"total": "Total consumido"
}
},
+ "minimap": {
+ "jumpToMessage": "Ir para a mensagem nº {{index}}",
+ "nextMessage": "Próxima mensagem",
+ "previousMessage": "Mensagem anterior"
+ },
"newAgent": "Novo Assistente",
"pin": "Fixar",
"pinOff": "Desafixar",
diff --git a/locales/ru-RU/chat.json b/locales/ru-RU/chat.json
index 54201a69702..08cf8a12086 100644
--- a/locales/ru-RU/chat.json
+++ b/locales/ru-RU/chat.json
@@ -150,6 +150,11 @@
"total": "Общее потребление"
}
},
+ "minimap": {
+ "jumpToMessage": "Перейти к сообщению № {{index}}",
+ "nextMessage": "Следующее сообщение",
+ "previousMessage": "Предыдущее сообщение"
+ },
"newAgent": "Создать помощника",
"pin": "Закрепить",
"pinOff": "Открепить",
diff --git a/locales/ru-RU/tool.json b/locales/ru-RU/tool.json
index 501a016b057..89d287872ae 100644
--- a/locales/ru-RU/tool.json
+++ b/locales/ru-RU/tool.json
@@ -1,7 +1,7 @@
{
"codeInterpreter": {
"error": "Ошибка выполнения",
- "executing": "Выполняется...",
+ "executing": "Выполнение...",
"files": "Файлы:",
"output": "Вывод:",
"returnValue": "Возвращаемое значение:"
@@ -86,4 +86,4 @@
"keyRequired": "Ключ поля не может быть пустым",
"stringifyError": "Не удалось сериализовать параметры, проверьте формат параметров"
}
-}
+}
\ No newline at end of file
diff --git a/locales/tr-TR/chat.json b/locales/tr-TR/chat.json
index 6559012708f..fab343f7567 100644
--- a/locales/tr-TR/chat.json
+++ b/locales/tr-TR/chat.json
@@ -150,6 +150,11 @@
"total": "Toplam tüketim"
}
},
+ "minimap": {
+ "jumpToMessage": "{{index}} numaralı mesaja atla",
+ "nextMessage": "Sonraki mesaj",
+ "previousMessage": "Önceki mesaj"
+ },
"newAgent": "Yeni Asistan",
"pin": "Pin",
"pinOff": "Unpin",
diff --git a/locales/tr-TR/models.json b/locales/tr-TR/models.json
index 84796ab98b5..d8af1c42bb1 100644
--- a/locales/tr-TR/models.json
+++ b/locales/tr-TR/models.json
@@ -681,7 +681,7 @@
"description": "Claude Sonnet 4, Sonnet 3.7'nin sektör lideri yetenekleri üzerine önemli geliştirmeler yapmış olup, kodlama alanında mükemmel performans sergiler ve SWE-bench'te en ileri %72.7 skoruna ulaşır. Model, performans ve verimlilik arasında denge sağlar, hem dahili hem de harici kullanım durumları için uygundur ve geliştirilmiş kontrol edilebilirlik ile uygulama üzerinde daha fazla hakimiyet sunar."
},
"anthropic/claude-sonnet-4.5": {
- "description": "Claude Sonnet 4.5, Anthropic'in şimdiye kadarki en zeki modelidir."
+ "description": "Claude Sonnet 4.5, Anthropic'in şimdiye kadarki en akıllı modelidir."
},
"ascend-tribe/pangu-pro-moe": {
"description": "Pangu-Pro-MoE 72B-A16B, 72 milyar parametreli ve 16 milyar parametre aktive eden seyrek büyük bir dil modelidir. Bu model, grup tabanlı uzman karışımı (MoGE) mimarisine dayanır; uzman seçim aşamasında uzmanları gruplar halinde düzenler ve her grupta token başına eşit sayıda uzmanı aktive ederek uzman yük dengesini sağlar. Bu sayede Ascend platformunda modelin dağıtım verimliliği önemli ölçüde artırılmıştır."
@@ -777,7 +777,7 @@
"description": "Claude Sonnet 4 düşünme modeli, neredeyse anında yanıtlar veya uzatılmış adım adım düşünme süreçleri üretebilir; kullanıcılar bu süreçleri net bir şekilde görebilir."
},
"claude-sonnet-4-5-20250929": {
- "description": "Claude Sonnet 4.5, Anthropic'in şimdiye kadarki en zeki modelidir."
+ "description": "Claude Sonnet 4.5, Anthropic'in şimdiye kadarki en akıllı modelidir."
},
"codegeex-4": {
"description": "CodeGeeX-4, çeşitli programlama dillerinde akıllı soru-cevap ve kod tamamlama desteği sunan güçlü bir AI programlama asistanıdır, geliştirme verimliliğini artırır."
@@ -3149,4 +3149,4 @@
"zai/glm-4.5v": {
"description": "GLM-4.5V, GLM-4.5-Air temel modeli üzerine inşa edilmiştir, GLM-4.1V-Thinking'in doğrulanmış teknolojisini devralır ve güçlü 106 milyar parametreli MoE mimarisi ile etkili ölçeklenebilirlik sağlar."
}
-}
+}
\ No newline at end of file
diff --git a/locales/vi-VN/chat.json b/locales/vi-VN/chat.json
index 4d07fab1736..f00e089dff4 100644
--- a/locales/vi-VN/chat.json
+++ b/locales/vi-VN/chat.json
@@ -150,6 +150,11 @@
"total": "Tổng tiêu thụ"
}
},
+ "minimap": {
+ "jumpToMessage": "Chuyển đến tin nhắn thứ {{index}}",
+ "nextMessage": "Tin nhắn tiếp theo",
+ "previousMessage": "Tin nhắn trước"
+ },
"newAgent": "Tạo trợ lý mới",
"pin": "Ghim",
"pinOff": "Bỏ ghim",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 5b22061ff6e..e21534a0bc5 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -150,6 +150,11 @@
"total": "总计消耗"
}
},
+ "minimap": {
+ "jumpToMessage": "跳转至第 {{index}} 条消息",
+ "nextMessage": "下一条消息",
+ "previousMessage": "上一条消息"
+ },
"newAgent": "新建助手",
"pin": "置顶",
"pinOff": "取消置顶",
diff --git a/locales/zh-TW/chat.json b/locales/zh-TW/chat.json
index d6dbb57382c..55239c9634d 100644
--- a/locales/zh-TW/chat.json
+++ b/locales/zh-TW/chat.json
@@ -150,6 +150,11 @@
"total": "總計消耗"
}
},
+ "minimap": {
+ "jumpToMessage": "跳轉至第 {{index}} 條訊息",
+ "nextMessage": "下一條訊息",
+ "previousMessage": "上一條訊息"
+ },
"newAgent": "新建助手",
"pin": "置頂",
"pinOff": "取消置頂",
diff --git a/src/app/[variants]/(main)/chat/(workspace)/@conversation/default.tsx b/src/app/[variants]/(main)/chat/(workspace)/@conversation/default.tsx
index 0773c41378d..5c4e5b6e5bd 100644
--- a/src/app/[variants]/(main)/chat/(workspace)/@conversation/default.tsx
+++ b/src/app/[variants]/(main)/chat/(workspace)/@conversation/default.tsx
@@ -4,6 +4,7 @@ import { RouteVariants } from '@/utils/server/routeVariants';
import ChatHydration from './features/ChatHydration';
import ChatInput from './features/ChatInput';
import ChatList from './features/ChatList';
+import ChatMinimap from './features/ChatMinimap';
import ThreadHydration from './features/ThreadHydration';
import ZenModeToast from './features/ZenModeToast';
@@ -17,6 +18,7 @@ const ChatConversation = async (props: DynamicLayoutProps) => {
<ChatInput mobile={isMobile} />
<ChatHydration />
<ThreadHydration />
+ {!isMobile && <ChatMinimap />}
</>
);
};
diff --git a/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatMinimap/index.tsx b/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatMinimap/index.tsx
new file mode 100644
index 00000000000..372f6d4d714
--- /dev/null
+++ b/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatMinimap/index.tsx
@@ -0,0 +1,335 @@
+'use client';
+
+import { Icon } from '@lobehub/ui';
+import { Tooltip } from 'antd';
+import { createStyles, useTheme } from 'antd-style';
+import { ChevronDown, ChevronUp } from 'lucide-react';
+import { memo, useCallback, useMemo, useState, useSyncExternalStore } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Flexbox } from 'react-layout-kit';
+
+import {
+ getVirtuosoActiveIndex,
+ getVirtuosoGlobalRef,
+ subscribeVirtuosoActiveIndex,
+ subscribeVirtuosoGlobalRef,
+} from '@/features/Conversation/components/VirtualizedList/VirtuosoContext';
+import { useChatStore } from '@/store/chat';
+import { chatSelectors } from '@/store/chat/selectors';
+
+const MIN_WIDTH = 16;
+const MAX_WIDTH = 30;
+const MAX_CONTENT_LENGTH = 320;
+const MIN_MESSAGES = 6;
+
+const useStyles = createStyles(({ css, token }) => ({
+ arrow: css`
+ cursor: pointer;
+
+ transform: translateX(4px);
+
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ width: 24px;
+ height: 24px;
+ padding: 0;
+ border: none;
+ border-radius: 6px;
+
+ color: ${token.colorTextTertiary};
+
+ opacity: 0;
+ background: none;
+
+ transition: opacity 0.2s ease;
+
+ &:hover {
+ color: ${token.colorText};
+ background: ${token.colorFill};
+ }
+
+ &:focus-visible {
+ outline: none;
+ box-shadow: 0 0 0 2px ${token.colorPrimaryBorder};
+ }
+ `,
+ arrowVisible: css`
+ opacity: 1;
+ `,
+ container: css`
+ pointer-events: none;
+
+ position: absolute;
+ z-index: 1;
+ inset-block: 16px 120px;
+ inset-inline-end: 8px;
+
+ width: 32px;
+ `,
+ indicator: css`
+ cursor: pointer;
+
+ flex-shrink: 0;
+
+ min-width: ${MIN_WIDTH}px;
+ height: 12px;
+ padding-block: 4px;
+ padding-inline: 4px;
+ border: none;
+ border-radius: 3px;
+
+ background: none;
+
+ transition:
+ transform 0.2s ease,
+ background-color 0.2s ease,
+ box-shadow 0.2s ease;
+
+ &:hover {
+ transform: scaleX(1.05);
+ background: ${token.colorFill};
+ }
+
+ &:focus-visible {
+ outline: none;
+ box-shadow: 0 0 0 2px ${token.colorPrimaryBorder};
+ }
+ `,
+ indicatorActive: css`
+ transform: scaleX(1.1);
+ background: ${token.colorPrimary};
+ box-shadow: 0 0 0 1px ${token.colorPrimaryHover};
+ `,
+ indicatorContent: css`
+ width: 100%;
+ height: 100%;
+ border-radius: 3px;
+ background: ${token.colorFillSecondary};
+ `,
+ indicatorContentActive: css`
+ background: ${token.colorPrimary};
+ `,
+ rail: css`
+ pointer-events: auto;
+
+ display: flex;
+ flex-direction: column;
+ gap: 0;
+ align-items: end;
+ justify-content: space-between;
+
+ width: 100%;
+ height: fit-content;
+ margin-block: 0;
+ margin-inline: auto;
+
+ &:hover .arrow {
+ opacity: 1;
+ }
+ `,
+}));
+
+const getIndicatorWidth = (content: string | undefined) => {
+ if (!content) return MIN_WIDTH;
+
+ const ratio = Math.min(content.length / MAX_CONTENT_LENGTH, 1);
+
+ return MIN_WIDTH + (MAX_WIDTH - MIN_WIDTH) * ratio;
+};
+
+const getPreviewText = (content: string | undefined) => {
+ if (!content) return '';
+
+ const normalized = content.replaceAll(/\s+/g, ' ').trim();
+ if (!normalized) return '';
+
+ return normalized.slice(0, 100) + (normalized.length > 100 ? '…' : '');
+};
+
+interface MinimapIndicator {
+ id: string;
+ preview: string;
+ virtuosoIndex: number;
+ width: number;
+}
+
+const ChatMinimap = () => {
+ const { t } = useTranslation('chat');
+ const { styles, cx } = useStyles();
+ const [isHovered, setIsHovered] = useState(false);
+ const virtuosoRef = useSyncExternalStore(
+ subscribeVirtuosoGlobalRef,
+ getVirtuosoGlobalRef,
+ () => null,
+ );
+ const activeIndex = useSyncExternalStore(
+ subscribeVirtuosoActiveIndex,
+ getVirtuosoActiveIndex,
+ () => null,
+ );
+ const messages = useChatStore(chatSelectors.mainDisplayChats);
+
+ const theme = useTheme();
+
+ const indicators = useMemo<MinimapIndicator[]>(() => {
+ return messages.reduce<MinimapIndicator[]>((acc, message, virtuosoIndex) => {
+ if (message.role !== 'user' && message.role !== 'assistant') return acc;
+
+ acc.push({
+ id: message.id,
+ preview: getPreviewText(message.content),
+ virtuosoIndex,
+ width: getIndicatorWidth(message.content),
+ });
+
+ return acc;
+ }, []);
+ }, [messages]);
+
+ const indicatorIndexMap = useMemo(() => {
+ const map = new Map<number, number>();
+ indicators.forEach(({ virtuosoIndex }, position) => {
+ map.set(virtuosoIndex, position);
+ });
+ return map;
+ }, [indicators]);
+
+ const activeIndicatorPosition = useMemo(() => {
+ if (activeIndex === null) return null;
+
+ console.log('> activeIndex', activeIndex);
+ console.log('> indicatorIndexMap', indicatorIndexMap);
+
+ return indicatorIndexMap.get(activeIndex) ?? null;
+ }, [activeIndex, indicatorIndexMap]);
+
+ const handleJump = useCallback(
+ (virtIndex: number) => {
+ virtuosoRef?.current?.scrollToIndex({
+ align: 'start',
+ behavior: 'smooth',
+ index: virtIndex,
+ // The current index detection will be off by 1, so we need to add 1 here
+ offset: 6,
+ });
+ },
+ [virtuosoRef],
+ );
+
+ const handleStep = useCallback(
+ (direction: 'prev' | 'next') => {
+ const ref = virtuosoRef?.current;
+ if (!ref || indicators.length === 0) return;
+
+ let targetPosition: number;
+
+ if (activeIndicatorPosition !== null) {
+ console.log('activeIndicatorPosition', activeIndicatorPosition);
+ // We're on an indicator, move to prev/next
+ const delta = direction === 'prev' ? -1 : 1;
+ targetPosition = Math.min(
+ Math.max(activeIndicatorPosition + delta, 0),
+ Math.max(indicators.length - 1, 0),
+ );
+ } else if (activeIndex !== null) {
+ // We're not on an indicator, find the nearest one in the direction
+ if (direction === 'prev') {
+ let matched = -1;
+ for (let pos = indicators.length - 1; pos >= 0; pos -= 1) {
+ if (indicators[pos].virtuosoIndex < activeIndex) {
+ matched = pos;
+ break;
+ }
+ }
+ targetPosition = matched === -1 ? 0 : matched;
+ } else {
+ console.log('activeIndex', activeIndex);
+ console.log('indicators', indicators);
+ let matched = indicators.length - 1;
+ for (const [pos, indicator] of indicators.entries()) {
+ if (indicator.virtuosoIndex > activeIndex) {
+ matched = pos;
+ break;
+ }
+ }
+ targetPosition = matched;
+ }
+ } else {
+ // No active index, go to first/last
+ targetPosition = direction === 'prev' ? indicators.length - 1 : 0;
+ }
+
+ const targetIndicator = indicators[targetPosition];
+
+ if (!targetIndicator) return;
+
+ ref.scrollToIndex({
+ align: 'start',
+ behavior: 'smooth',
+ index: targetIndicator.virtuosoIndex,
+ offset: 6,
+ });
+ },
+ [activeIndex, activeIndicatorPosition, indicators, virtuosoRef],
+ );
+
+ if (indicators.length <= MIN_MESSAGES) return null;
+
+ return (
+ <Flexbox align={'center'} className={styles.container} justify={'center'}>
+ <Flexbox
+ className={styles.rail}
+ onMouseEnter={() => setIsHovered(true)}
+ onMouseLeave={() => setIsHovered(false)}
+ role={'group'}
+ >
+ <Tooltip mouseEnterDelay={0.1} placement={'left'} title={t('minimap.previousMessage')}>
+ <button
+ aria-label={t('minimap.previousMessage')}
+ className={cx(styles.arrow, isHovered && styles.arrowVisible)}
+ onClick={() => handleStep('prev')}
+ type={'button'}
+ >
+ <Icon color={theme.colorTextTertiary} icon={ChevronUp} size={16} />
+ </button>
+ </Tooltip>
+ {indicators.map(({ id, width, preview, virtuosoIndex }, position) => {
+ const isActive = activeIndicatorPosition === position;
+
+ return (
+ <Tooltip key={id} mouseEnterDelay={0.1} placement={'left'} title={preview || undefined}>
+ <button
+ aria-current={isActive ? 'true' : undefined}
+ aria-label={t('minimap.jumpToMessage', { index: position + 1 })}
+ className={styles.indicator}
+ onClick={() => handleJump(virtuosoIndex)}
+ style={{
+ width,
+ }}
+ type={'button'}
+ >
+ <div
+ className={cx(styles.indicatorContent, isActive && styles.indicatorContentActive)}
+ />
+ </button>
+ </Tooltip>
+ );
+ })}
+ <Tooltip mouseEnterDelay={0.1} placement={'left'} title={t('minimap.nextMessage')}>
+ <button
+ aria-label={t('minimap.nextMessage')}
+ className={cx(styles.arrow, isHovered && styles.arrowVisible)}
+ onClick={() => handleStep('next')}
+ type={'button'}
+ >
+ <Icon icon={ChevronDown} size={16} />
+ </button>
+ </Tooltip>
+ </Flexbox>
+ </Flexbox>
+ );
+};
+
+export default memo(ChatMinimap);
diff --git a/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/TopicPanel.tsx b/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/TopicPanel.tsx
index 914cfb76f7f..a5bb2a3643e 100644
--- a/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/TopicPanel.tsx
+++ b/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/TopicPanel.tsx
@@ -59,7 +59,11 @@ const TopicPanel = memo(({ children }: PropsWithChildren) => {
mode={md ? 'fixed' : 'float'}
onExpandChange={handleExpand}
placement={'right'}
+ showHandleWhenCollapsed={false}
showHandleWideArea={false}
+ styles={{
+ handle: { display: 'none' },
+ }}
>
<DraggablePanelContainer
style={{
diff --git a/src/features/Conversation/components/ChatItem/index.tsx b/src/features/Conversation/components/ChatItem/index.tsx
index ab0fcc26c3d..9ee2bd63950 100644
--- a/src/features/Conversation/components/ChatItem/index.tsx
+++ b/src/features/Conversation/components/ChatItem/index.tsx
@@ -2,14 +2,27 @@
import { createStyles } from 'antd-style';
import isEqual from 'fast-deep-equal';
-import { MouseEventHandler, ReactNode, memo, use, useCallback, useMemo } from 'react';
+import {
+ MouseEventHandler,
+ ReactNode,
+ memo,
+ use,
+ useCallback,
+ useEffect,
+ useMemo,
+ useRef,
+} from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
import { HtmlPreviewAction } from '@/components/HtmlPreview';
import { isDesktop } from '@/const/version';
import ChatItem from '@/features/ChatItem';
-import { VirtuosoContext } from '@/features/Conversation/components/VirtualizedList/VirtuosoContext';
+import {
+ VirtuosoContext,
+ removeVirtuosoVisibleItem,
+ upsertVirtuosoVisibleItem,
+} from '@/features/Conversation/components/VirtualizedList/VirtuosoContext';
import { useAgentStore } from '@/store/agent';
import { agentChatConfigSelectors } from '@/store/agent/selectors';
import { useChatStore } from '@/store/chat';
@@ -79,6 +92,7 @@ const Item = memo<ChatListItemProps>(
}) => {
const { t } = useTranslation('common');
const { styles, cx } = useStyles();
+ const containerRef = useRef<HTMLDivElement | null>(null);
const type = useAgentStore(agentChatConfigSelectors.displayMode);
const item = useChatStore(chatSelectors.getMessageById(id), isEqual);
@@ -218,6 +232,44 @@ const Item = memo<ChatListItemProps>(
const onChange = useCallback((value: string) => updateMessageContent(id, value), [id]);
const virtuosoRef = use(VirtuosoContext);
+ useEffect(() => {
+ if (typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return;
+
+ const element = containerRef.current;
+ if (!element) return;
+
+ const root = element.closest('[data-virtuoso-scroller]');
+ const thresholds = [0, 0.01, 0.1, 0.25, 0.5, 0.75, 0.9, 1];
+ const options: any = { threshold: thresholds };
+
+ if (root instanceof Element) options.root = root;
+
+ const observer = new IntersectionObserver((entries) => {
+ entries.forEach((entry) => {
+ if (entry.target !== element) return;
+
+ if (entry.isIntersecting) {
+ const { bottom, top } = entry.intersectionRect;
+
+ upsertVirtuosoVisibleItem(index, {
+ bottom,
+ ratio: entry.intersectionRatio,
+ top,
+ });
+ } else {
+ removeVirtuosoVisibleItem(index);
+ }
+ });
+ }, options);
+
+ observer.observe(element);
+
+ return () => {
+ observer.disconnect();
+ removeVirtuosoVisibleItem(index);
+ };
+ }, [index]);
+
const onDoubleClick = useCallback<MouseEventHandler<HTMLDivElement>>(
(e) => {
if (!item || disableEditing) return;
@@ -267,7 +319,9 @@ const Item = memo<ChatListItemProps>(
{enableHistoryDivider && <History />}
<Flexbox
className={cx(styles.message, className, isMessageLoading && styles.loading)}
+ data-index={index}
onContextMenu={onContextMenu}
+ ref={containerRef}
>
<ChatItem
actions={actionBar}
diff --git a/src/features/Conversation/components/VirtualizedList/VirtuosoContext.ts b/src/features/Conversation/components/VirtualizedList/VirtuosoContext.ts
index 49397f6dc46..4b2d34cb7fa 100644
--- a/src/features/Conversation/components/VirtualizedList/VirtuosoContext.ts
+++ b/src/features/Conversation/components/VirtualizedList/VirtuosoContext.ts
@@ -2,3 +2,91 @@ import { RefObject, createContext } from 'react';
import { VirtuosoHandle } from 'react-virtuoso';
export const VirtuosoContext = createContext<RefObject<VirtuosoHandle | null> | null>(null);
+
+type VirtuosoRef = RefObject<VirtuosoHandle | null> | null;
+
+let currentVirtuosoRef: VirtuosoRef = null;
+const refListeners = new Set<() => void>();
+
+const visibleItems = new Map<number, { bottom: number; ratio: number; top: number }>();
+let currentActiveIndex: number | null = null;
+const activeIndexListeners = new Set<() => void>();
+
+const notifyActiveIndex = (next: number | null) => {
+ if (currentActiveIndex === next) return;
+
+ currentActiveIndex = next;
+ activeIndexListeners.forEach((listener) => listener());
+};
+
+const recalculateActiveIndex = () => {
+ if (visibleItems.size === 0) {
+ notifyActiveIndex(null);
+ return;
+ }
+
+ let candidate: number | null = null;
+ let minTop = Infinity;
+ let maxRatio = -Infinity;
+
+ visibleItems.forEach(({ top, ratio }, index) => {
+ const shouldUpdate =
+ top < minTop ||
+ (top === minTop &&
+ (ratio > maxRatio || (ratio === maxRatio && index < (candidate ?? Infinity))));
+
+ if (shouldUpdate) {
+ candidate = index;
+ minTop = top;
+ maxRatio = ratio;
+ }
+ });
+
+ notifyActiveIndex(candidate ?? null);
+};
+
+export const setVirtuosoGlobalRef = (ref: VirtuosoRef) => {
+ currentVirtuosoRef = ref;
+ refListeners.forEach((listener) => listener());
+};
+
+export const getVirtuosoGlobalRef = () => currentVirtuosoRef;
+
+export const subscribeVirtuosoGlobalRef = (listener: () => void) => {
+ refListeners.add(listener);
+
+ return () => {
+ refListeners.delete(listener);
+ };
+};
+
+export const upsertVirtuosoVisibleItem = (
+ index: number,
+ metrics: { bottom: number; ratio: number; top: number },
+) => {
+ visibleItems.set(index, metrics);
+ recalculateActiveIndex();
+};
+
+export const removeVirtuosoVisibleItem = (index: number) => {
+ if (!visibleItems.delete(index)) return;
+
+ recalculateActiveIndex();
+};
+
+export const resetVirtuosoVisibleItems = () => {
+ if (visibleItems.size === 0 && currentActiveIndex === null) return;
+
+ visibleItems.clear();
+ notifyActiveIndex(null);
+};
+
+export const getVirtuosoActiveIndex = () => currentActiveIndex;
+
+export const subscribeVirtuosoActiveIndex = (listener: () => void) => {
+ activeIndexListeners.add(listener);
+
+ return () => {
+ activeIndexListeners.delete(listener);
+ };
+};
diff --git a/src/features/Conversation/components/VirtualizedList/index.tsx b/src/features/Conversation/components/VirtualizedList/index.tsx
index 893e7401378..1779379c343 100644
--- a/src/features/Conversation/components/VirtualizedList/index.tsx
+++ b/src/features/Conversation/components/VirtualizedList/index.tsx
@@ -10,7 +10,7 @@ import { chatSelectors } from '@/store/chat/selectors';
import AutoScroll from '../AutoScroll';
import SkeletonList from '../SkeletonList';
-import { VirtuosoContext } from './VirtuosoContext';
+import { VirtuosoContext, resetVirtuosoVisibleItems, setVirtuosoGlobalRef } from './VirtuosoContext';
interface VirtualizedListProps {
dataSource: string[];
@@ -57,6 +57,20 @@ const VirtualizedList = memo<VirtualizedListProps>(({ mobile, dataSource, itemCo
scrollToBottom();
}, [id]);
+ useEffect(() => {
+ setVirtuosoGlobalRef(virtuosoRef);
+
+ return () => {
+ setVirtuosoGlobalRef(null);
+ };
+ }, [virtuosoRef]);
+
+ useEffect(() => {
+ return () => {
+ resetVirtuosoVisibleItems();
+ };
+ }, []);
+
// overscan should be 3 times the height of the window
const overscan = typeof window !== 'undefined' ? window.innerHeight * 3 : 0;
diff --git a/src/locales/default/chat.ts b/src/locales/default/chat.ts
index fd94c2339c0..3b932474d33 100644
--- a/src/locales/default/chat.ts
+++ b/src/locales/default/chat.ts
@@ -154,6 +154,11 @@ export default {
total: '总计消耗',
},
},
+ minimap: {
+ jumpToMessage: '跳转至第 {{index}} 条消息',
+ nextMessage: '下一条消息',
+ previousMessage: '上一条消息',
+ },
newAgent: '新建助手',
pin: '置顶',
pinOff: '取消置顶',