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.

✨ feat(settings): retire the Advanced Tools switch (#23715)

AmAzing-474865d3b2d3
diff --git a/locales/ar/setting.json b/locales/ar/setting.json
index 86da18476d5..84633e05b34 100644
--- a/locales/ar/setting.json
+++ b/locales/ar/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "سلس",
"settingChatAppearance.transitionMode.title": "رسوم الانتقال",
"settingChatAppearance.workflowStreamingExpand.title": "توسيع خطوات الأدوات أثناء التشغيل",
- "settingCommon.devMode.desc": "تمكين عرض الميزات والخيارات المتعلقة بالمطورين",
- "settingCommon.devMode.title": "وضع المطور",
"settingCommon.lang.autoMode": "اتباع النظام",
"settingCommon.lang.title": "اللغة",
"settingCommon.liteMode.desc": "تبسيط الواجهة وإخفاء الميزات المتقدمة",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "تكوين خادم MCP مخصص يدويًا",
"tab.addCustomSkill": "إضافة مهارة مخصصة",
"tab.advanced": "متقدم",
- "tab.advanced.appUpdates.title": "تحديثات التطبيق",
"tab.advanced.gatewayMode.desc": "تشغيل مهام الوكيل المدعومة عبر بوابة السحابة افتراضيًا. يمكن للوكلاء الفرديين تجاوز هذا من قائمة الدردشة.",
"tab.advanced.gatewayMode.title": "وضع البوابة",
"tab.advanced.toolsAndDiagnostics.title": "الأدوات والتشخيصات",
diff --git a/locales/bg-BG/setting.json b/locales/bg-BG/setting.json
index 6b4babda6d7..dc63a054b21 100644
--- a/locales/bg-BG/setting.json
+++ b/locales/bg-BG/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Плавно",
"settingChatAppearance.transitionMode.title": "Анимация при преход",
"settingChatAppearance.workflowStreamingExpand.title": "Разширяване на стъпките на инструмента по време на изпълнение",
- "settingCommon.devMode.desc": "Показване на функции и опции за разработчици",
- "settingCommon.devMode.title": "Режим за разработчици",
"settingCommon.lang.autoMode": "Следвай системата",
"settingCommon.lang.title": "Език",
"settingCommon.liteMode.desc": "Опростяване на интерфейса и скриване на разширени функции",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Ръчно конфигуриране на персонализиран MCP сървър",
"tab.addCustomSkill": "Добавяне на персонализирано умение",
"tab.advanced": "Разширени",
- "tab.advanced.appUpdates.title": "Актуализации на приложението",
"tab.advanced.gatewayMode.desc": "Изпълнявайте поддържаните задачи на агентите през облачния Gateway по подразбиране. Индивидуалните агенти могат да променят това от менюто за чат.",
"tab.advanced.gatewayMode.title": "Режим Gateway",
"tab.advanced.toolsAndDiagnostics.title": "Инструменти и диагностика",
diff --git a/locales/de-DE/setting.json b/locales/de-DE/setting.json
index 0064251a135..3ace298b942 100644
--- a/locales/de-DE/setting.json
+++ b/locales/de-DE/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Sanft",
"settingChatAppearance.transitionMode.title": "Übergangsanimation",
"settingChatAppearance.workflowStreamingExpand.title": "Werkzeugschritte beim Ausführen erweitern",
- "settingCommon.devMode.desc": "Aktivieren, um entwicklerbezogene Funktionen und Optionen anzuzeigen",
- "settingCommon.devMode.title": "Entwicklermodus",
"settingCommon.lang.autoMode": "Systemsprache verwenden",
"settingCommon.lang.title": "Sprache",
"settingCommon.liteMode.desc": "Benutzeroberfläche vereinfachen und erweiterte Funktionen ausblenden",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Konfigurieren Sie manuell einen benutzerdefinierten MCP-Server",
"tab.addCustomSkill": "Benutzerdefinierten Skill hinzufügen",
"tab.advanced": "Erweitert",
- "tab.advanced.appUpdates.title": "App-Updates",
"tab.advanced.gatewayMode.desc": "Führen Sie unterstützte Agentenaufgaben standardmäßig über das Cloud-Gateway aus. Einzelne Agenten können dies im Chat-Menü überschreiben.",
"tab.advanced.gatewayMode.title": "Gateway-Modus",
"tab.advanced.toolsAndDiagnostics.title": "Tools und Diagnosen",
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index 8b815a3fc37..d06a593dcd8 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -2008,6 +2008,8 @@
"settingChatAppearance.pasteAutoConvert.title": "Format Markdown on Paste",
"settingChatAppearance.showImageReadPreview.desc": "When off, tool calls that read an image fold in with the other calls and stay collapsed until clicked.",
"settingChatAppearance.showImageReadPreview.title": "Show Image Reads on Their Own",
+ "settingChatAppearance.showMessageUsage.desc": "Show the model that wrote each reply and the tokens it used, below the reply.",
+ "settingChatAppearance.showMessageUsage.title": "Show model and token usage",
"settingChatAppearance.title": "Chat Appearance",
"settingChatAppearance.transitionMode.desc": "Choose how chat messages appear",
"settingChatAppearance.transitionMode.options.fadeIn": "Fade In",
@@ -2016,8 +2018,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Smooth",
"settingChatAppearance.transitionMode.title": "Transition Animation",
"settingChatAppearance.workflowStreamingExpand.title": "Expand Tool Steps While Running",
- "settingCommon.devMode.desc": "Show technical details and manual controls for chats, models, and local tools. This does not change model responses.",
- "settingCommon.devMode.title": "Advanced tools",
"settingCommon.lang.autoMode": "Follow System",
"settingCommon.lang.title": "Language",
"settingCommon.liteMode.desc": "Simplify the interface and hide advanced features",
@@ -2541,7 +2541,6 @@
"tab.addCustomMcp.desc": "Manually configure a custom MCP server",
"tab.addCustomSkill": "Add",
"tab.advanced": "Advanced",
- "tab.advanced.appUpdates.title": "App updates",
"tab.advanced.gatewayMode.desc": "Run supported agent tasks through the cloud Gateway by default. Individual agents can override this from the chat menu.",
"tab.advanced.gatewayMode.title": "Gateway Mode",
"tab.advanced.toolsAndDiagnostics.title": "Tools and diagnostics",
diff --git a/locales/es-ES/setting.json b/locales/es-ES/setting.json
index 05f0c736253..d7a5d878a4e 100644
--- a/locales/es-ES/setting.json
+++ b/locales/es-ES/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Suave",
"settingChatAppearance.transitionMode.title": "Animación de Transición",
"settingChatAppearance.workflowStreamingExpand.title": "Expandir Pasos de Herramientas Durante la Ejecución",
- "settingCommon.devMode.desc": "Activa para mostrar funciones y opciones para desarrolladores",
- "settingCommon.devMode.title": "Modo Desarrollador",
"settingCommon.lang.autoMode": "Seguir el Sistema",
"settingCommon.lang.title": "Idioma",
"settingCommon.liteMode.desc": "Simplifica la interfaz y oculta funciones avanzadas",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Configura manualmente un servidor MCP personalizado",
"tab.addCustomSkill": "Agregar habilidad personalizada",
"tab.advanced": "Avanzado",
- "tab.advanced.appUpdates.title": "Actualizaciones de la aplicación",
"tab.advanced.gatewayMode.desc": "Ejecuta tareas de agentes compatibles a través del Gateway en la nube por defecto. Los agentes individuales pueden anular esto desde el menú de chat.",
"tab.advanced.gatewayMode.title": "Modo Gateway",
"tab.advanced.toolsAndDiagnostics.title": "Herramientas y diagnósticos",
diff --git a/locales/fa-IR/setting.json b/locales/fa-IR/setting.json
index a9013235323..3aa7114e596 100644
--- a/locales/fa-IR/setting.json
+++ b/locales/fa-IR/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "نرم",
"settingChatAppearance.transitionMode.title": "انیمیشن انتقال",
"settingChatAppearance.workflowStreamingExpand.title": "گسترش مراحل ابزار هنگام اجرا",
- "settingCommon.devMode.desc": "برای نمایش ویژگی‌ها و گزینه‌های مربوط به توسعه‌دهنده فعال کنید",
- "settingCommon.devMode.title": "حالت توسعه‌دهنده",
"settingCommon.lang.autoMode": "مطابق سیستم",
"settingCommon.lang.title": "زبان",
"settingCommon.liteMode.desc": "ساده‌سازی رابط و پنهان‌سازی ویژگی‌های پیشرفته",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "یک سرور MCP سفارشی را به‌صورت دستی پیکربندی کنید",
"tab.addCustomSkill": "افزودن مهارت سفارشی",
"tab.advanced": "پیشرفته",
- "tab.advanced.appUpdates.title": "به‌روزرسانی‌های برنامه",
"tab.advanced.gatewayMode.desc": "اجرای وظایف پشتیبانی شده‌ی عامل‌ها به صورت پیش‌فرض از طریق دروازه ابری. عامل‌های جداگانه می‌توانند این تنظیم را از منوی چت تغییر دهند.",
"tab.advanced.gatewayMode.title": "حالت دروازه",
"tab.advanced.toolsAndDiagnostics.title": "ابزارها و تشخیص‌ها",
diff --git a/locales/fr-FR/setting.json b/locales/fr-FR/setting.json
index c8bf36eeff7..834cf2910df 100644
--- a/locales/fr-FR/setting.json
+++ b/locales/fr-FR/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Fluide",
"settingChatAppearance.transitionMode.title": "Animation de transition",
"settingChatAppearance.workflowStreamingExpand.title": "Étendre les étapes des outils pendant l'exécution",
- "settingCommon.devMode.desc": "Afficher les fonctionnalités et options pour développeurs",
- "settingCommon.devMode.title": "Mode développeur",
"settingCommon.lang.autoMode": "Suivre le système",
"settingCommon.lang.title": "Langue",
"settingCommon.liteMode.desc": "Simplifier l’interface et masquer les fonctions avancées",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Configurer manuellement un serveur MCP personnalisé",
"tab.addCustomSkill": "Ajouter une compétence personnalisée",
"tab.advanced": "Avancé",
- "tab.advanced.appUpdates.title": "Mises à jour de l'application",
"tab.advanced.gatewayMode.desc": "Exécutez par défaut les tâches d'agent prises en charge via le cloud Gateway. Les agents individuels peuvent remplacer cela depuis le menu de chat.",
"tab.advanced.gatewayMode.title": "Mode Gateway",
"tab.advanced.toolsAndDiagnostics.title": "Outils et diagnostics",
diff --git a/locales/it-IT/setting.json b/locales/it-IT/setting.json
index 81f44f52f0a..dfe5e83486f 100644
--- a/locales/it-IT/setting.json
+++ b/locales/it-IT/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Scorrevole",
"settingChatAppearance.transitionMode.title": "Animazione Transizione",
"settingChatAppearance.workflowStreamingExpand.title": "Espandi i Passaggi degli Strumenti Durante l'Esecuzione",
- "settingCommon.devMode.desc": "Abilita per visualizzare funzionalità e opzioni per sviluppatori",
- "settingCommon.devMode.title": "Modalità Sviluppatore",
"settingCommon.lang.autoMode": "Segui Sistema",
"settingCommon.lang.title": "Lingua",
"settingCommon.liteMode.desc": "Semplifica l'interfaccia e nasconde le funzionalità avanzate",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Configura manualmente un server MCP personalizzato",
"tab.addCustomSkill": "Aggiungi skill personalizzata",
"tab.advanced": "Avanzato",
- "tab.advanced.appUpdates.title": "Aggiornamenti dell'app",
"tab.advanced.gatewayMode.desc": "Esegui le attività degli agenti supportati tramite il Gateway cloud per impostazione predefinita. Gli agenti individuali possono sovrascrivere questa impostazione dal menu chat.",
"tab.advanced.gatewayMode.title": "Modalità Gateway",
"tab.advanced.toolsAndDiagnostics.title": "Strumenti e diagnostica",
diff --git a/locales/ja-JP/setting.json b/locales/ja-JP/setting.json
index 640d0201e1c..d283ad90870 100644
--- a/locales/ja-JP/setting.json
+++ b/locales/ja-JP/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "スムーズ",
"settingChatAppearance.transitionMode.title": "遷移アニメーション",
"settingChatAppearance.workflowStreamingExpand.title": "実行中にツールの手順を展開",
- "settingCommon.devMode.desc": "有効にすると、開発者向けの機能とオプションが表示されます",
- "settingCommon.devMode.title": "開発者モード",
"settingCommon.lang.autoMode": "システムに従う",
"settingCommon.lang.title": "言語",
"settingCommon.liteMode.desc": "インターフェースを簡素化し、高度な機能を非表示にします",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "カスタムMCPサーバーを手動で設定",
"tab.addCustomSkill": "カスタムスキルを追加",
"tab.advanced": "高度な設定",
- "tab.advanced.appUpdates.title": "アプリの更新",
"tab.advanced.gatewayMode.desc": "サポートされているエージェントタスクをデフォルトでクラウドゲートウェイを通じて実行します。個々のエージェントはチャットメニューからこれを上書きすることができます。",
"tab.advanced.gatewayMode.title": "ゲートウェイモード",
"tab.advanced.toolsAndDiagnostics.title": "ツールと診断",
diff --git a/locales/ko-KR/setting.json b/locales/ko-KR/setting.json
index ac52feee257..e7af072e35f 100644
--- a/locales/ko-KR/setting.json
+++ b/locales/ko-KR/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "부드럽게",
"settingChatAppearance.transitionMode.title": "전환 애니메이션",
"settingChatAppearance.workflowStreamingExpand.title": "실행 중 도구 단계 확장",
- "settingCommon.devMode.desc": "활성화하면 개발자 관련 기능과 옵션이 표시됩니다",
- "settingCommon.devMode.title": "개발자 모드",
"settingCommon.lang.autoMode": "시스템 따르기",
"settingCommon.lang.title": "언어",
"settingCommon.liteMode.desc": "인터페이스를 단순화하고 고급 기능을 숨깁니다",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "사용자 정의 MCP 서버를 수동으로 구성합니다",
"tab.addCustomSkill": "사용자 정의 스킬 추가",
"tab.advanced": "고급",
- "tab.advanced.appUpdates.title": "앱 업데이트",
"tab.advanced.gatewayMode.desc": "기본적으로 클라우드 게이트웨이를 통해 지원되는 에이전트 작업을 실행합니다. 개별 에이전트는 채팅 메뉴에서 이를 재정의할 수 있습니다.",
"tab.advanced.gatewayMode.title": "게이트웨이 모드",
"tab.advanced.toolsAndDiagnostics.title": "도구 및 진단",
diff --git a/locales/nl-NL/setting.json b/locales/nl-NL/setting.json
index a96ba963dbc..7526733ca96 100644
--- a/locales/nl-NL/setting.json
+++ b/locales/nl-NL/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Vloeiend",
"settingChatAppearance.transitionMode.title": "Overgangsanimatie",
"settingChatAppearance.workflowStreamingExpand.title": "Uitbreiden van hulpmiddelenstappen tijdens uitvoering",
- "settingCommon.devMode.desc": "Schakel in om ontwikkelaarsfuncties en -opties te tonen",
- "settingCommon.devMode.title": "Ontwikkelaarsmodus",
"settingCommon.lang.autoMode": "Volg systeem",
"settingCommon.lang.title": "Taal",
"settingCommon.liteMode.desc": "Vereenvoudig de interface en verberg geavanceerde functies",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Handmatig een aangepaste MCP-server configureren",
"tab.addCustomSkill": "Aangepaste skill toevoegen",
"tab.advanced": "Geavanceerd",
- "tab.advanced.appUpdates.title": "App-updates",
"tab.advanced.gatewayMode.desc": "Voer standaard ondersteunde agenttaken uit via de cloud Gateway. Individuele agents kunnen dit overschrijven via het chatmenu.",
"tab.advanced.gatewayMode.title": "Gateway-modus",
"tab.advanced.toolsAndDiagnostics.title": "Hulpmiddelen en diagnostiek",
diff --git a/locales/pl-PL/setting.json b/locales/pl-PL/setting.json
index 5c117c5df52..4c75e1c6931 100644
--- a/locales/pl-PL/setting.json
+++ b/locales/pl-PL/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Płynne",
"settingChatAppearance.transitionMode.title": "Animacja przejścia",
"settingChatAppearance.workflowStreamingExpand.title": "Rozwiń kroki narzędzia podczas działania",
- "settingCommon.devMode.desc": "Włącz, aby wyświetlić funkcje i opcje dla deweloperów",
- "settingCommon.devMode.title": "Tryb deweloperski",
"settingCommon.lang.autoMode": "Zgodnie z systemem",
"settingCommon.lang.title": "Język",
"settingCommon.liteMode.desc": "Uprość interfejs i ukryj zaawansowane funkcje",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Ręcznie skonfiguruj niestandardowy serwer MCP",
"tab.addCustomSkill": "Dodaj własną umiejętność",
"tab.advanced": "Zaawansowane",
- "tab.advanced.appUpdates.title": "Aktualizacje aplikacji",
"tab.advanced.gatewayMode.desc": "Domyślnie uruchamiaj obsługiwane zadania agenta przez chmurę Gateway. Poszczególni agenci mogą to zmienić w menu czatu.",
"tab.advanced.gatewayMode.title": "Tryb Gateway",
"tab.advanced.toolsAndDiagnostics.title": "Narzędzia i diagnostyka",
diff --git a/locales/pt-BR/setting.json b/locales/pt-BR/setting.json
index 2bd70403927..95b2709bc04 100644
--- a/locales/pt-BR/setting.json
+++ b/locales/pt-BR/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Suave",
"settingChatAppearance.transitionMode.title": "Animação de Transição",
"settingChatAppearance.workflowStreamingExpand.title": "Expandir Etapas da Ferramenta Durante a Execução",
- "settingCommon.devMode.desc": "Ative para exibir recursos e opções voltados a desenvolvedores",
- "settingCommon.devMode.title": "Modo Desenvolvedor",
"settingCommon.lang.autoMode": "Seguir Sistema",
"settingCommon.lang.title": "Idioma",
"settingCommon.liteMode.desc": "Simplifica a interface e oculta recursos avançados",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Configure manualmente um servidor MCP personalizado",
"tab.addCustomSkill": "Adicionar habilidade personalizada",
"tab.advanced": "Avançado",
- "tab.advanced.appUpdates.title": "Atualizações do Aplicativo",
"tab.advanced.gatewayMode.desc": "Execute tarefas de agente suportadas através do Gateway na nuvem por padrão. Agentes individuais podem substituir isso no menu de chat.",
"tab.advanced.gatewayMode.title": "Modo Gateway",
"tab.advanced.toolsAndDiagnostics.title": "Ferramentas e Diagnósticos",
diff --git a/locales/ru-RU/setting.json b/locales/ru-RU/setting.json
index 59f9519ddf4..c0cbeab75b6 100644
--- a/locales/ru-RU/setting.json
+++ b/locales/ru-RU/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Плавное появление",
"settingChatAppearance.transitionMode.title": "Анимация перехода",
"settingChatAppearance.workflowStreamingExpand.title": "Раскрыть шаги инструмента во время выполнения",
- "settingCommon.devMode.desc": "Включите для отображения функций и опций для разработчиков",
- "settingCommon.devMode.title": "Режим разработчика",
"settingCommon.lang.autoMode": "Следовать системным настройкам",
"settingCommon.lang.title": "Язык",
"settingCommon.liteMode.desc": "Упростить интерфейс и скрыть расширенные функции",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Ручная настройка пользовательского сервера MCP",
"tab.addCustomSkill": "Добавить пользовательский навык",
"tab.advanced": "Дополнительно",
- "tab.advanced.appUpdates.title": "Обновления приложения",
"tab.advanced.gatewayMode.desc": "По умолчанию выполнять поддерживаемые задачи агента через облачный шлюз. Отдельные агенты могут переопределить это через меню чата.",
"tab.advanced.gatewayMode.title": "Режим шлюза",
"tab.advanced.toolsAndDiagnostics.title": "Инструменты и диагностика",
diff --git a/locales/tr-TR/setting.json b/locales/tr-TR/setting.json
index c6f5c914ce3..ac412a34a2a 100644
--- a/locales/tr-TR/setting.json
+++ b/locales/tr-TR/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Yumuşak",
"settingChatAppearance.transitionMode.title": "Geçiş Animasyonu",
"settingChatAppearance.workflowStreamingExpand.title": "Araç Adımlarını Çalışırken Genişlet",
- "settingCommon.devMode.desc": "Geliştiriciyle ilgili özellikleri ve seçenekleri göstermek için etkinleştirin",
- "settingCommon.devMode.title": "Geliştirici Modu",
"settingCommon.lang.autoMode": "Sistemi Takip Et",
"settingCommon.lang.title": "Dil",
"settingCommon.liteMode.desc": "Arayüzü basitleştir ve gelişmiş özellikleri gizle",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Özel bir MCP sunucusunu manuel olarak yapılandırın",
"tab.addCustomSkill": "Özel yetenek ekle",
"tab.advanced": "Gelişmiş",
- "tab.advanced.appUpdates.title": "Uygulama Güncellemeleri",
"tab.advanced.gatewayMode.desc": "Desteklenen ajan görevlerini varsayılan olarak bulut Gateway üzerinden çalıştırın. Bireysel ajanlar bunu sohbet menüsünden geçersiz kılabilir.",
"tab.advanced.gatewayMode.title": "Gateway Modu",
"tab.advanced.toolsAndDiagnostics.title": "Araçlar ve Tanılama",
diff --git a/locales/vi-VN/setting.json b/locales/vi-VN/setting.json
index 7451aa0bf47..bb9c7eebb2c 100644
--- a/locales/vi-VN/setting.json
+++ b/locales/vi-VN/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "Mượt mà",
"settingChatAppearance.transitionMode.title": "Hoạt ảnh chuyển tiếp",
"settingChatAppearance.workflowStreamingExpand.title": "Mở Rộng Các Bước Công Cụ Khi Đang Chạy",
- "settingCommon.devMode.desc": "Bật để hiển thị các tính năng và tùy chọn dành cho nhà phát triển",
- "settingCommon.devMode.title": "Chế độ nhà phát triển",
"settingCommon.lang.autoMode": "Theo hệ thống",
"settingCommon.lang.title": "Ngôn ngữ",
"settingCommon.liteMode.desc": "Đơn giản hóa giao diện và ẩn các tính năng nâng cao",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "Cấu hình thủ công một máy chủ MCP tùy chỉnh",
"tab.addCustomSkill": "Thêm kỹ năng tùy chỉnh",
"tab.advanced": "Nâng cao",
- "tab.advanced.appUpdates.title": "Cập nhật ứng dụng",
"tab.advanced.gatewayMode.desc": "Chạy các tác vụ của agent được hỗ trợ thông qua Gateway đám mây theo mặc định. Các agent riêng lẻ có thể ghi đè điều này từ menu trò chuyện.",
"tab.advanced.gatewayMode.title": "Chế độ Gateway",
"tab.advanced.toolsAndDiagnostics.title": "Công cụ và chẩn đoán",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index 192d72dddae..850456c9696 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -2008,6 +2008,8 @@
"settingChatAppearance.pasteAutoConvert.title": "粘贴时转换 Markdown",
"settingChatAppearance.showImageReadPreview.desc": "关闭后,读取图片的工具调用会和其他调用一起折叠,不再默认展开图片。",
"settingChatAppearance.showImageReadPreview.title": "单独展示读取的图片",
+ "settingChatAppearance.showMessageUsage.desc": "在每条回复下方显示生成它的模型和消耗的 Token。",
+ "settingChatAppearance.showMessageUsage.title": "显示模型与用量",
"settingChatAppearance.title": "聊天外观",
"settingChatAppearance.transitionMode.desc": "选择聊天消息的显示方式",
"settingChatAppearance.transitionMode.options.fadeIn": "淡入",
@@ -2016,8 +2018,6 @@
"settingChatAppearance.transitionMode.options.smooth": "平滑",
"settingChatAppearance.transitionMode.title": "过渡动画",
"settingChatAppearance.workflowStreamingExpand.title": "运行中展开工具步骤",
- "settingCommon.devMode.desc": "显示对话、模型和本地工具的技术细节与手动控制项。不会改变模型回复方式。",
- "settingCommon.devMode.title": "高级工具",
"settingCommon.lang.autoMode": "跟随系统",
"settingCommon.lang.title": "语言",
"settingCommon.liteMode.desc": "简化界面并隐藏高级功能",
@@ -2541,7 +2541,6 @@
"tab.addCustomMcp.desc": "手动配置自定义 MCP 服务器",
"tab.addCustomSkill": "添加",
"tab.advanced": "高级设置",
- "tab.advanced.appUpdates.title": "应用更新",
"tab.advanced.gatewayMode.desc": "默认通过云端 Gateway 运行支持的助理任务。单个助理可以在聊天菜单中覆盖该设置。",
"tab.advanced.gatewayMode.title": "后端运行模式",
"tab.advanced.toolsAndDiagnostics.title": "工具与诊断",
diff --git a/locales/zh-TW/setting.json b/locales/zh-TW/setting.json
index 1d04c90ba05..b02cd3c1fee 100644
--- a/locales/zh-TW/setting.json
+++ b/locales/zh-TW/setting.json
@@ -1502,8 +1502,6 @@
"settingChatAppearance.transitionMode.options.smooth": "平滑",
"settingChatAppearance.transitionMode.title": "過渡動畫",
"settingChatAppearance.workflowStreamingExpand.title": "運行時展開工具步驟",
- "settingCommon.devMode.desc": "開啟後將顯示開發者相關的功能與選項",
- "settingCommon.devMode.title": "開發者模式",
"settingCommon.lang.autoMode": "跟隨系統",
"settingCommon.lang.title": "語言",
"settingCommon.liteMode.desc": "簡化介面並隱藏進階功能",
@@ -1954,7 +1952,6 @@
"tab.addCustomMcp.desc": "手動配置自訂 MCP 伺服器",
"tab.addCustomSkill": "新增自訂技能",
"tab.advanced": "進階",
- "tab.advanced.appUpdates.title": "應用更新",
"tab.advanced.gatewayMode.desc": "預設通過雲端網關執行支援的代理任務。個別代理可從聊天選單中覆蓋此設定。",
"tab.advanced.gatewayMode.title": "網關模式",
"tab.advanced.toolsAndDiagnostics.title": "工具與診斷",
diff --git a/packages/const/src/settings/common.ts b/packages/const/src/settings/common.ts
index 8f9fed1b59f..5a9275b270c 100644
--- a/packages/const/src/settings/common.ts
+++ b/packages/const/src/settings/common.ts
@@ -8,7 +8,6 @@ export const DEFAULT_COMMON_SETTINGS: UserGeneralConfig = {
fontSize: 14,
highlighterTheme: 'lobe-theme',
interfaceDensity: 'loose',
- isDevMode: false,
isLiteMode: false,
mermaidTheme: 'lobe-theme',
telemetry: true,
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index 2687a0d53b8..603cb8f21a0 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -1703,6 +1703,9 @@ export default {
'settingChatAppearance.showImageReadPreview.desc':
'When off, tool calls that read an image fold in with the other calls and stay collapsed until clicked.',
'settingChatAppearance.showImageReadPreview.title': 'Show Image Reads on Their Own',
+ 'settingChatAppearance.showMessageUsage.desc':
+ 'Show the model that wrote each reply and the tokens it used, below the reply.',
+ 'settingChatAppearance.showMessageUsage.title': 'Show model and token usage',
'settingChatAppearance.title': 'Chat Appearance',
'settingChatAppearance.transitionMode.desc': 'Choose how chat messages appear',
'settingChatAppearance.transitionMode.options.fadeIn': 'Fade In',
@@ -1711,9 +1714,6 @@ export default {
'settingChatAppearance.transitionMode.options.none.value': 'None',
'settingChatAppearance.transitionMode.options.smooth': 'Smooth',
'settingChatAppearance.transitionMode.title': 'Transition Animation',
- 'settingCommon.devMode.desc':
- 'Show technical details and manual controls for chats, models, and local tools. This does not change model responses.',
- 'settingCommon.devMode.title': 'Advanced tools',
'settingCommon.lang.autoMode': 'Follow System',
'settingCommon.lang.title': 'Language',
'settingCommon.liteMode.desc': 'Simplify the interface and hide advanced features',
@@ -2301,7 +2301,6 @@ When I am ___, I need ___
'systemAgent.verify.title': 'Task Acceptance',
'tab.about': 'About',
'tab.advanced': 'Advanced',
- 'tab.advanced.appUpdates.title': 'App updates',
'tab.advanced.gatewayMode.desc':
'Run supported agent tasks through the cloud Gateway by default. Individual agents can override this from the chat menu.',
'tab.advanced.gatewayMode.title': 'Gateway Mode',
diff --git a/packages/types/src/user/settings/general.ts b/packages/types/src/user/settings/general.ts
index ff68ede9582..c5c5bf57498 100644
--- a/packages/types/src/user/settings/general.ts
+++ b/packages/types/src/user/settings/general.ts
@@ -67,7 +67,6 @@ export interface UserGeneralConfig {
fontSize: number;
highlighterTheme?: HighlighterProps['theme'];
interfaceDensity?: InterfaceDensity;
- isDevMode: boolean;
isLiteMode: boolean;
mermaidTheme?: MermaidProps['theme'];
neutralColor?: NeutralColors;
@@ -81,6 +80,13 @@ export interface UserGeneralConfig {
* @default true
*/
showImageReadPreview?: boolean;
+ /**
+ * Whether each answer shows the model that produced it and its token usage.
+ * Unset falls back to the retired `isDevMode` switch, so people who had
+ * Advanced Tools on keep seeing it.
+ * @default false
+ */
+ showMessageUsage?: boolean;
telemetry: boolean;
timezone?: string;
transitionMode?: ResponseAnimationStyle;
diff --git a/src/components/Skeleton/Settings/tabs/About.tsx b/src/components/Skeleton/Settings/tabs/About.tsx
index d4644b545c6..a2cbe2d05e8 100644
--- a/src/components/Skeleton/Settings/tabs/About.tsx
+++ b/src/components/Skeleton/Settings/tabs/About.tsx
@@ -1,6 +1,7 @@
'use client';
import { BRANDING_NAME } from '@lobechat/business-const';
+import { isDesktop } from '@lobechat/const';
import { Divider, Flexbox, Grid } from '@lobehub/ui';
import { Form } from '@lobehub/ui/form';
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
@@ -35,7 +36,7 @@ const LinkRow = ({ keys }: { keys: string[] }) => {
};
/**
- * The "About" group (logo + version row, the five social cards, contact and
+ * The "About" group (logo + version row, the desktop update channel, the five social cards, contact and
* legal links) above the single-row analytics group.
*/
const Body = () => {
@@ -62,6 +63,19 @@ const Body = () => {
</Flexbox>
<SkeletonBar height={32} radius={8} width={80} />
</Flexbox>
+ {isDesktop && (
+ <Flexbox horizontal align={'center'} gap={16} justify={'space-between'} width={'100%'}>
+ <Flexbox gap={4}>
+ <div style={{ fontWeight: 500 }}>
+ {setting('tab.advanced.updateChannel.title', 96, 14)}
+ </div>
+ <div style={{ color: cssVar.colorTextSecondary, fontSize: 12 }}>
+ {setting('tab.advanced.updateChannel.desc', 360, 12)}
+ </div>
+ </Flexbox>
+ <SkeletonBar height={32} radius={8} width={200} />
+ </Flexbox>
+ )}
<Divider style={{ marginBlock: 0 }} />
<Grid gap={8} maxItemWidth={160} rows={SOCIAL_COUNT} width={'100%'}>
{Array.from({ length: SOCIAL_COUNT }, (_, index) => (
diff --git a/src/components/Skeleton/Settings/tabs/Advanced.tsx b/src/components/Skeleton/Settings/tabs/Advanced.tsx
index 57c77427dce..9918eb30cda 100644
--- a/src/components/Skeleton/Settings/tabs/Advanced.tsx
+++ b/src/components/Skeleton/Settings/tabs/Advanced.tsx
@@ -8,71 +8,53 @@ import { SettingsFormSkeleton, SWITCH_CONTROL } from '../Section';
import { useSkeletonText } from '../useSkeletonText';
import type { SettingsTabSkeleton } from './types';
-/** Tools group (dev mode, gateway mode when enabled; on desktop the diagnostics package, debug logs and remote debugging) and, on desktop, the update channel. */
+/** Tools group: gateway mode when enabled; on desktop the diagnostics package, debug logs and remote debugging. */
const Body = () => {
const text = useSkeletonText('setting');
const enableGatewayMode = useServerConfigStore(serverConfigSelectors.enableGatewayMode);
+ const toolItems = [
+ ...(enableGatewayMode
+ ? [
+ {
+ control: SWITCH_CONTROL,
+ desc: text('tab.advanced.gatewayMode.desc', 280, 12),
+ label: text('tab.advanced.gatewayMode.title', 112),
+ minWidth: undefined,
+ },
+ ]
+ : []),
+ ...(isDesktop
+ ? [
+ {
+ control: { height: 32, width: 300 },
+ desc: text('settingAbout.diagnostics.bundle.desc', 280, 12),
+ label: text('settingAbout.diagnostics.bundle.title', 96),
+ minWidth: undefined,
+ },
+ {
+ control: { height: 32, width: 160 },
+ desc: text('settingAbout.debugLogs.desc', 280, 12),
+ label: text('settingAbout.debugLogs.title', 96),
+ minWidth: undefined,
+ },
+ {
+ control: SWITCH_CONTROL,
+ desc: text('settingAbout.remoteDebugging.desc', 280, 12),
+ label: text('settingAbout.remoteDebugging.title', 96),
+ minWidth: undefined,
+ },
+ ]
+ : []),
+ ];
+
return (
<SettingsFormSkeleton
- groups={[
- {
- items: [
- {
- control: SWITCH_CONTROL,
- desc: text('settingCommon.devMode.desc', 240, 12),
- label: text('settingCommon.devMode.title', 96),
- minWidth: undefined,
- },
- ...(enableGatewayMode
- ? [
- {
- control: SWITCH_CONTROL,
- desc: text('tab.advanced.gatewayMode.desc', 280, 12),
- label: text('tab.advanced.gatewayMode.title', 112),
- minWidth: undefined,
- },
- ]
- : []),
- ...(isDesktop
- ? [
- {
- control: { height: 32, width: 300 },
- desc: text('settingAbout.diagnostics.bundle.desc', 280, 12),
- label: text('settingAbout.diagnostics.bundle.title', 96),
- minWidth: undefined,
- },
- {
- control: { height: 32, width: 160 },
- desc: text('settingAbout.debugLogs.desc', 280, 12),
- label: text('settingAbout.debugLogs.title', 96),
- minWidth: undefined,
- },
- {
- control: SWITCH_CONTROL,
- desc: text('settingAbout.remoteDebugging.desc', 280, 12),
- label: text('settingAbout.remoteDebugging.title', 96),
- minWidth: undefined,
- },
- ]
- : []),
- ],
- title: text('tab.advanced.toolsAndDiagnostics.title', 160, 16),
- },
- ...(isDesktop
- ? [
- {
- items: [
- {
- desc: text('tab.advanced.updateChannel.desc', 240, 12),
- label: text('tab.advanced.updateChannel.title', 96),
- },
- ],
- title: text('tab.advanced.appUpdates.title', 112, 16),
- },
- ]
- : []),
- ]}
+ groups={
+ toolItems.length > 0
+ ? [{ items: toolItems, title: text('tab.advanced.toolsAndDiagnostics.title', 160, 16) }]
+ : []
+ }
/>
);
};
diff --git a/src/components/Skeleton/Settings/tabs/Conversation.tsx b/src/components/Skeleton/Settings/tabs/Conversation.tsx
index 93df8052fe2..f2835b50b47 100644
--- a/src/components/Skeleton/Settings/tabs/Conversation.tsx
+++ b/src/components/Skeleton/Settings/tabs/Conversation.tsx
@@ -115,7 +115,7 @@ export const SendingSectionSkeleton = () => {
);
};
-/** Message display: the vertical font-size slider with its preview, then link icons. */
+/** Message display: the vertical font-size slider with its preview, link icons, then the usage row. */
export const DisplaySectionSkeleton = () => {
const text = useSkeletonText('setting');
@@ -158,6 +158,12 @@ export const DisplaySectionSkeleton = () => {
label: text('settingChatAppearance.linkIcon.title', 120, 14),
minWidth: undefined,
},
+ {
+ control: SWITCH_CONTROL,
+ desc: text('settingChatAppearance.showMessageUsage.desc', 320, 12),
+ label: text('settingChatAppearance.showMessageUsage.title', 120, 14),
+ minWidth: undefined,
+ },
],
title: text('settingConversation.display.title', 72),
},
diff --git a/src/features/ChatInput/ActionBar/Token/TokenDetails.tsx b/src/features/ChatInput/ActionBar/Token/TokenDetails.tsx
index 3ed7b935b2e..1b9c1d4733f 100644
--- a/src/features/ChatInput/ActionBar/Token/TokenDetails.tsx
+++ b/src/features/ChatInput/ActionBar/Token/TokenDetails.tsx
@@ -4,9 +4,6 @@ import numeral from 'numeral';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
-
import TokenProgress from './TokenProgress';
import { type TokenBreakdown } from './useTokenBreakdown';
@@ -28,7 +25,6 @@ const TokenDetails = memo<TokenDetailsProps>(({ breakdown }) => {
toolsToken,
totalToken,
} = breakdown;
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
return (
<Flexbox gap={12} style={{ minWidth: 200 }}>
@@ -63,51 +59,49 @@ const TokenDetails = memo<TokenDetailsProps>(({ breakdown }) => {
</Center>
</Tooltip>
</Flexbox>
- {isDevMode && (
- <TokenProgress
- showIcon
- data={[
- {
- color: cssVar.magenta,
- id: 'system',
- title: t('tokenDetails.system'),
- value: systemToken,
- },
- {
- color: cssVar.geekblue,
- id: 'tools',
- title: t('tokenDetails.tools'),
- value: toolsToken,
- },
- {
- color: cssVar.gold,
- id: 'chats',
- title: t('tokenDetails.chats'),
- value: chatsToken,
- },
- {
- color: cssVar.orange,
- id: 'fileContext',
- title: t('tokenDetails.fileContext'),
- value: fileContextToken,
- },
- {
- color: cssVar.cyan,
- id: 'toolCalls',
- title: t('tokenDetails.toolCalls'),
- value: toolCallsToken,
- },
- {
- color: cssVar.purple,
- id: 'reasoning',
- title: t('tokenDetails.reasoning'),
- value: reasoningToken,
- },
- ]}
- />
- )}
<TokenProgress
- showIcon={isDevMode}
+ showIcon
+ data={[
+ {
+ color: cssVar.magenta,
+ id: 'system',
+ title: t('tokenDetails.system'),
+ value: systemToken,
+ },
+ {
+ color: cssVar.geekblue,
+ id: 'tools',
+ title: t('tokenDetails.tools'),
+ value: toolsToken,
+ },
+ {
+ color: cssVar.gold,
+ id: 'chats',
+ title: t('tokenDetails.chats'),
+ value: chatsToken,
+ },
+ {
+ color: cssVar.orange,
+ id: 'fileContext',
+ title: t('tokenDetails.fileContext'),
+ value: fileContextToken,
+ },
+ {
+ color: cssVar.cyan,
+ id: 'toolCalls',
+ title: t('tokenDetails.toolCalls'),
+ value: toolCallsToken,
+ },
+ {
+ color: cssVar.purple,
+ id: 'reasoning',
+ title: t('tokenDetails.reasoning'),
+ value: reasoningToken,
+ },
+ ]}
+ />
+ <TokenProgress
+ showIcon
showTotal={t('tokenDetails.total')}
data={[
{
diff --git a/src/features/ChatInput/ActionBar/Token/TokenTag.tsx b/src/features/ChatInput/ActionBar/Token/TokenTag.tsx
index f36e99718ff..adcba325d1a 100644
--- a/src/features/ChatInput/ActionBar/Token/TokenTag.tsx
+++ b/src/features/ChatInput/ActionBar/Token/TokenTag.tsx
@@ -2,9 +2,6 @@ import { TokenTag } from '@lobehub/ui/chat';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
-
import ActionPopover from '../components/ActionPopover';
import TokenDetails from './TokenDetails';
import { useTokenBreakdown } from './useTokenBreakdown';
@@ -14,12 +11,10 @@ const Token = memo(() => {
const breakdown = useTokenBreakdown();
const { maxTokens, totalToken } = breakdown;
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const content = useMemo(() => <TokenDetails breakdown={breakdown} />, [breakdown]);
- // Keep the composer quiet for regular users until context pressure is real;
- // dev mode always shows the tag for inspection.
- if (!isDevMode && maxTokens > 0 && totalToken / maxTokens <= 0.5) return null;
+ // Keep the composer quiet until context pressure is real.
+ if (maxTokens > 0 && totalToken / maxTokens <= 0.5) return null;
return (
<ActionPopover content={content}>
diff --git a/src/features/ChatInput/ActionBar/index.test.ts b/src/features/ChatInput/ActionBar/index.test.ts
index c275b41b9bb..5d614fc3020 100644
--- a/src/features/ChatInput/ActionBar/index.test.ts
+++ b/src/features/ChatInput/ActionBar/index.test.ts
@@ -17,14 +17,6 @@ vi.mock('@lobehub/ui/chat', () => ({
createElement('div', { 'data-testid': 'token-tag' }, value),
}));
-vi.mock('@/store/user', () => ({
- useUserStore: (selector: (state: object) => unknown) => selector({}),
-}));
-
-vi.mock('@/store/user/selectors', () => ({
- userGeneralSettingsSelectors: { config: () => ({ isDevMode: true }) },
-}));
-
vi.mock('./components/ActionPopover', () => ({
default: ({ children, content }: { children?: ReactNode; content?: ReactNode }) =>
createElement('div', {}, children, content),
@@ -94,5 +86,19 @@ describe('Context window token', () => {
expect(tokenMocks.useTokenBreakdown).toHaveBeenCalledTimes(1);
expect(screen.getByTestId('token-tag')).toHaveTextContent('6000');
expect(screen.getByTestId('token-progress-used')).toHaveTextContent('used:6000,rest:2000');
+ // The per-source breakdown is shown to every user, not only Advanced Tools.
+ expect(screen.getByTestId('token-progress-system')).toBeInTheDocument();
+ });
+
+ it('stays out of the composer until half the context window is used', () => {
+ tokenMocks.useTokenBreakdown.mockReturnValue({
+ chatsToken: 1000,
+ maxTokens: 8000,
+ totalToken: 4000,
+ });
+
+ render(createElement(Token));
+
+ expect(screen.queryByTestId('token-tag')).not.toBeInTheDocument();
});
});
diff --git a/src/features/Conversation/Messages/Assistant/Actions/index.tsx b/src/features/Conversation/Messages/Assistant/Actions/index.tsx
index ae3603f570d..aa367be235a 100644
--- a/src/features/Conversation/Messages/Assistant/Actions/index.tsx
+++ b/src/features/Conversation/Messages/Assistant/Actions/index.tsx
@@ -12,9 +12,9 @@ import {
const DEFAULT_BAR_WITH_TOOLS: MessageActionSlot[] = ['delAndRegenerate', 'copy'];
const DEFAULT_BAR: MessageActionSlot[] = ['edit', 'copy'];
-// The developer-facing actions live one level down, under Advanced: each is
-// gated (dev mode, Labs) and rare, so flat they were noise in the menu that
-// every user opens. It sits with the other utilities rather than after Delete —
+// The developer-facing actions live one level down, under Advanced: they are
+// rare (and eval capture is gated on Labs), so flat they were noise in the menu
+// that every user opens. It sits with the other utilities rather than after Delete —
// trailing the destructive group made a debugging aid read as a last resort.
// The submenu drops itself when none of its children apply.
const ADVANCED_GROUP: MessageActionSlot = {
@@ -63,7 +63,7 @@ export const AssistantActionsBar = memo<AssistantActionsBarProps>(({ actionsConf
const { content, error, tools } = data;
// Empty error messages render only an interception card — nothing to edit
- // or copy, so only the dev-mode operation-id action remains menu-worthy
+ // or copy, so only the operation-id action remains menu-worthy
// (failed runs are exactly what it traces; the menu collapses away when the
// action opts out). When the turn streamed content before erroring, keep
// edit/copy so the partial reply stays salvageable.
diff --git a/src/features/Conversation/Messages/Assistant/Extra/index.tsx b/src/features/Conversation/Messages/Assistant/Extra/index.tsx
index 4ef231790c0..76d7b0ebf33 100644
--- a/src/features/Conversation/Messages/Assistant/Extra/index.tsx
+++ b/src/features/Conversation/Messages/Assistant/Extra/index.tsx
@@ -28,7 +28,7 @@ export const AssistantMessageExtra = memo<AssistantMessageExtraProps>(
({ extra, id, content, performance, usage, tools, provider, model }) => {
const loading = useConversationStore(messageStateSelectors.isMessageGenerating(id));
const isLogin = useUserStore(authSelectors.isLogin);
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
+ const showMessageUsage = useUserStore(userGeneralSettingsSelectors.showMessageUsage);
// Local CLI hetero agents (claude-code, codex) only report `model` after
// turn_metadata lands mid-stream, so gating on `!!model` alone would skip
@@ -37,7 +37,7 @@ export const AssistantMessageExtra = memo<AssistantMessageExtraProps>(
// should bypass the model check, otherwise local agents render a lone
// empty-model ModelIcon while streaming.
const showUsage =
- isDevMode &&
+ showMessageUsage &&
content !== LOADING_FLAT &&
(!!model || (!!provider && isRemoteHeterogeneousType(provider)));
const showTranslate = isLogin && !!extra?.translate;
diff --git a/src/features/Conversation/Messages/Assistant/index.tsx b/src/features/Conversation/Messages/Assistant/index.tsx
index 6bde2d09cfb..b0fa609a4c9 100644
--- a/src/features/Conversation/Messages/Assistant/index.tsx
+++ b/src/features/Conversation/Messages/Assistant/index.tsx
@@ -13,7 +13,7 @@ import { selectionStyles } from '@/features/Conversation/MessageForward/selectio
import { useMessageCommentCount } from '@/features/TopicComment/hooks';
import MessageCommentBadge from '@/features/TopicComment/MessageCommentBadge';
import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors, userProfileSelectors } from '@/store/user/selectors';
+import { userProfileSelectors } from '@/store/user/selectors';
import { sx } from '@/styles/sx';
import { ReactionDisplay } from '../../components/Reaction';
@@ -116,7 +116,6 @@ const AssistantMessage = memo<AssistantMessageProps>(
useSetMessageItemActionElementPortialContext();
const setMessageItemActionTypeContext = useSetMessageItemActionTypeContext();
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const { count: commentCount, topicId: commentTopicId } = useMessageCommentCount(id);
const onMouseEnter: MouseEventHandler<HTMLDivElement> = useCallback(
@@ -177,7 +176,7 @@ const AssistantMessage = memo<AssistantMessageProps>(
}
actions={
<>
- {isDevMode && branch && (
+ {branch && (
<MessageBranch
activeBranchIndex={branch.activeBranchIndex}
count={branch.count}
diff --git a/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx
index 70bafad596b..453e0e32ee3 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx
@@ -12,10 +12,14 @@ import {
const DEFAULT_BAR_WITH_TOOLS: MessageActionSlot[] = ['delAndRegenerate', 'copy'];
const DEFAULT_BAR: MessageActionSlot[] = ['edit', 'copy'];
+// Ids for tracing sit one level down, as in the single assistant message menu.
+const ADVANCED_GROUP: MessageActionSlot = {
+ children: ['copyMessageId', 'copyOperationId'],
+ key: 'advanced',
+};
const DEFAULT_MENU: MessageActionSlot[] = [
'edit',
'copy',
- 'copyOperationId',
'comments',
'fork',
'branching',
@@ -24,6 +28,8 @@ const DEFAULT_MENU: MessageActionSlot[] = [
'share',
'select',
'divider',
+ ADVANCED_GROUP,
+ 'divider',
'regenerate',
'del',
];
@@ -41,7 +47,7 @@ const NO_TEXT_BLOCK_MENU: MessageActionSlot[] = [
'divider',
'del',
'divider',
- 'copyOperationId',
+ ADVANCED_GROUP,
];
interface GroupActionsProps {
diff --git a/src/features/Conversation/Messages/AssistantGroup/index.tsx b/src/features/Conversation/Messages/AssistantGroup/index.tsx
index 2bb40fb88fd..fa0e3975390 100644
--- a/src/features/Conversation/Messages/AssistantGroup/index.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/index.tsx
@@ -222,7 +222,7 @@ const GroupMessage = memo<GroupMessageProps>(
);
const interrupted = groupInterrupted || blockInterrupted;
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
+ const showMessageUsage = useUserStore(userGeneralSettingsSelectors.showMessageUsage);
const addReaction = useConversationStore((s) => s.addReaction);
const removeReaction = useConversationStore((s) => s.removeReaction);
const userId = useUserStore(userProfileSelectors.userId)!;
@@ -309,7 +309,7 @@ const GroupMessage = memo<GroupMessageProps>(
<>
{!disableEditing && (
<>
- {isDevMode && branch && (
+ {branch && (
<MessageBranch
activeBranchIndex={branch.activeBranchIndex}
count={branch.count}
@@ -321,7 +321,7 @@ const GroupMessage = memo<GroupMessageProps>(
)}
{/* Model + token usage rides the action row instead of claiming a
band of its own between the answer and the round's artifacts. */}
- {isDevMode && model && (
+ {showMessageUsage && model && (
<Flexbox horizontal align={'center'} paddingInline={8}>
<Usage model={model} performance={performance} provider={provider!} usage={usage} />
</Flexbox>
diff --git a/src/features/Conversation/Messages/Task/Actions/index.tsx b/src/features/Conversation/Messages/Task/Actions/index.tsx
index f6f77211e53..13d03fcafe1 100644
--- a/src/features/Conversation/Messages/Task/Actions/index.tsx
+++ b/src/features/Conversation/Messages/Task/Actions/index.tsx
@@ -11,15 +11,21 @@ import {
const DEFAULT_BAR_WITH_TOOLS: MessageActionSlot[] = ['copy'];
const DEFAULT_BAR: MessageActionSlot[] = ['edit', 'copy'];
+// Ids for tracing sit one level down, as in the assistant message menu.
+const ADVANCED_GROUP: MessageActionSlot = {
+ children: ['copyMessageId', 'copyOperationId'],
+ key: 'advanced',
+};
const DEFAULT_MENU: MessageActionSlot[] = [
'edit',
'copy',
- 'copyOperationId',
'comments',
'collapse',
'divider',
'share',
'divider',
+ ADVANCED_GROUP,
+ 'divider',
'regenerate',
'del',
];
@@ -50,7 +56,7 @@ export const AssistantActionsBar = memo<AssistantActionsBarProps>(({ actionsConf
const { content, error, tools } = data;
// Empty error messages render only an interception card — nothing to edit
- // or copy, so only the dev-mode operation-id action remains menu-worthy
+ // or copy, so only the operation-id action remains menu-worthy
// (failed runs are exactly what it traces; the menu collapses away when the
// action opts out). When the turn streamed content before erroring, keep
// edit/copy so the partial reply stays salvageable.
diff --git a/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx b/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx
index 8bae5f3d097..e0c031e9634 100644
--- a/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx
+++ b/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx
@@ -130,7 +130,7 @@ const ProcessingView = memo<{
totalToolCalls: number;
}>(({ messages, startTime, model, provider, totalToolCalls, accumulatedUsage }) => {
const { t } = useTranslation('chat');
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
+ const showMessageUsage = useUserStore(userGeneralSettingsSelectors.showMessageUsage);
const [elapsedTime, setElapsedTime] = useState(0);
const { ref, handleScroll } = useAutoScroll<HTMLDivElement>({
deps: [messages],
@@ -198,7 +198,7 @@ const ProcessingView = memo<{
/>
{/* Usage display */}
- {isDevMode && model && provider && (
+ {showMessageUsage && model && provider && (
<Usage model={model} provider={provider} usage={accumulatedUsage} />
)}
</Flexbox>
@@ -221,7 +221,7 @@ const CompletedView = memo<{
totalToolCalls: number;
}>(({ blocks, assistantId, duration, totalToolCalls, model, provider, totalTokens, totalCost }) => {
const { t } = useTranslation('chat');
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
+ const showMessageUsage = useUserStore(userGeneralSettingsSelectors.showMessageUsage);
// Split blocks: intermediate steps (all but last) and final result (last)
const { intermediateBlocks, finalBlock } = useMemo(() => {
@@ -302,7 +302,7 @@ const CompletedView = memo<{
<ContentBlock {...finalBlock} disableEditing assistantId={assistantId} />
{/* Usage display */}
- {isDevMode && model && provider && (
+ {showMessageUsage && model && provider && (
<Usage model={model} provider={provider} usage={{ cost: totalCost, totalTokens }} />
)}
</Flexbox>
diff --git a/src/features/Conversation/Messages/User/Actions/index.tsx b/src/features/Conversation/Messages/User/Actions/index.tsx
index 0640bb4af2d..5c674a1157a 100644
--- a/src/features/Conversation/Messages/User/Actions/index.tsx
+++ b/src/features/Conversation/Messages/User/Actions/index.tsx
@@ -5,8 +5,6 @@ import { memo, useMemo } from 'react';
import { MESSAGE_ACTION_BAR_PORTAL_ATTRIBUTES } from '@/const/messageActionPortal';
import { selectionStyles } from '@/features/Conversation/MessageForward/selectionStyles';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
import { sx } from '@/styles/sx';
import { revealStyles } from '../../../ChatItem/revealStyles';
@@ -71,7 +69,6 @@ const actionBarHolder = (
const Actions = memo<ActionsProps>(({ id, data, disableEditing }) => {
const { branch } = data;
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
if (!shouldShowUserActions(data)) return null;
@@ -82,7 +79,7 @@ const Actions = memo<ActionsProps>(({ id, data, disableEditing }) => {
{actionBarHolder}
</Flexbox>
)}
- {isDevMode && branch && (
+ {branch && (
<MessageBranch
activeBranchIndex={branch.activeBranchIndex}
count={branch.count}
diff --git a/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.test.ts b/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.test.ts
index 8b99800ec55..1940f576b40 100644
--- a/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.test.ts
+++ b/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.test.ts
@@ -3,26 +3,14 @@
*/
import type { UIChatMessage } from '@lobechat/types';
import { renderHook } from '@testing-library/react';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { describe, expect, it, vi } from 'vitest';
import { advancedAction } from './advanced';
-const mocks = vi.hoisted(() => ({ isDevMode: true }));
-
vi.mock('react-i18next', () => ({
useTranslation: () => ({ t: (key: string) => key }),
}));
-vi.mock('@/store/user', () => ({
- useUserStore: (selector: (state: unknown) => unknown) => selector({}),
-}));
-
-vi.mock('@/store/user/selectors', () => ({
- userGeneralSettingsSelectors: {
- config: () => ({ isDevMode: mocks.isDevMode }),
- },
-}));
-
const build = () =>
renderHook(() =>
advancedAction.useBuild({
@@ -33,20 +21,9 @@ const build = () =>
).result.current;
describe('advancedAction', () => {
- beforeEach(() => {
- mocks.isDevMode = true;
- });
-
- // The drawer is developer-facing as a whole, so the gate lives here rather
- // than on each child — this is what keeps a Labs-only child (capturing an
- // eval case) out of an ordinary user's menu.
- it('is absent when Advanced Tools (dev mode) is off', () => {
- mocks.isDevMode = false;
-
- expect(build()).toBeNull();
- });
-
- it('is the submenu shell when Advanced Tools is on', () => {
+ // Every user gets the submenu shell; each child decides on its own whether
+ // it applies (eval capture still checks its Labs flag).
+ it('is the submenu shell for every user', () => {
expect(build()).toMatchObject({ key: 'advanced', label: 'messageAction.advanced' });
});
});
diff --git a/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.ts b/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.ts
index 678bf5571ce..91e57b66b8f 100644
--- a/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.ts
+++ b/src/features/Conversation/Messages/components/MessageActionBar/actions/advanced.ts
@@ -2,9 +2,6 @@ import { Wrench } from 'lucide-react';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
-
import { defineAction } from '../defineAction';
/**
@@ -15,21 +12,14 @@ import { defineAction } from '../defineAction';
* It exists because the developer-facing actions (ids to paste into a trace,
* capturing a turn as an eval case) are individually rare but collectively a
* category, and left flat they crowd the menu everyone else uses.
- *
- * The whole drawer is developer-facing, so Advanced Tools gates it here rather
- * than child by child: one place to reason about, and it covers children that
- * carry no dev gate of their own (capturing a case is gated on Labs instead).
*/
export const advancedAction = defineAction({
key: 'advanced',
useBuild: () => {
const { t } = useTranslation('chat');
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
-
return useMemo(
- () =>
- isDevMode ? { icon: Wrench, key: 'advanced', label: t('messageAction.advanced') } : null,
- [t, isDevMode],
+ () => ({ icon: Wrench, key: 'advanced', label: t('messageAction.advanced') }),
+ [t],
);
},
});
diff --git a/src/features/Conversation/Messages/components/MessageActionBar/actions/copyMessageId.ts b/src/features/Conversation/Messages/components/MessageActionBar/actions/copyMessageId.ts
index 7be1740f058..7755c938f83 100644
--- a/src/features/Conversation/Messages/components/MessageActionBar/actions/copyMessageId.ts
+++ b/src/features/Conversation/Messages/components/MessageActionBar/actions/copyMessageId.ts
@@ -3,14 +3,10 @@ import { Braces } from 'lucide-react';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
-
import { defineAction } from '../defineAction';
/**
- * Dev-tool action (visible only with Advanced Tools enabled): copies this
- * message's id — the handle for `lh` queries, eval cases and bug reports.
+ * Copies this message's id — the handle for `lh` queries, eval cases and bug reports.
*
* For a group message the useful id is the underlying assistant message, not
* the aggregate group, same as `copyOperationId`.
@@ -19,11 +15,10 @@ export const copyMessageIdAction = defineAction({
key: 'copyMessageId',
useBuild: (ctx) => {
const { t } = useTranslation('chat');
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const messageId = ctx.contentBlock?.id ?? ctx.id;
return useMemo(() => {
- if (!isDevMode || !messageId) return null;
+ if (!messageId) return null;
return {
handleClick: async () => {
await copyToClipboard(messageId);
@@ -33,6 +28,6 @@ export const copyMessageIdAction = defineAction({
key: 'copyMessageId',
label: t('messageAction.copyMessageId'),
};
- }, [t, isDevMode, messageId]);
+ }, [t, messageId]);
},
});
diff --git a/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.test.ts b/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.test.ts
index 0e9c001c582..b53e6e154ae 100644
--- a/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.test.ts
+++ b/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.test.ts
@@ -16,7 +16,6 @@ interface MockOperation {
}
const mocks = vi.hoisted(() => ({
- isDevMode: true,
copyToClipboard: vi.fn(),
messageOperationMap: {} as Record<string, string>,
messageSuccess: vi.fn(),
@@ -55,16 +54,6 @@ vi.mock('@/store/chat', () => ({
}),
}));
-vi.mock('@/store/user', () => ({
- useUserStore: (selector: (state: unknown) => unknown) => selector({}),
-}));
-
-vi.mock('@/store/user/selectors', () => ({
- userGeneralSettingsSelectors: {
- config: () => ({ isDevMode: mocks.isDevMode }),
- },
-}));
-
vi.mock('@/store/chat/selectors', () => ({
operationSelectors: {
// Test double for the parent-chain walk: climbs `parentOperationId` until
@@ -97,17 +86,10 @@ const build = (
describe('copyOperationIdAction', () => {
beforeEach(() => {
vi.clearAllMocks();
- mocks.isDevMode = true;
mocks.messageOperationMap = {};
mocks.operations = {};
});
- it('is absent when Advanced Tools (dev mode) is off', () => {
- mocks.isDevMode = false;
-
- expect(build({ metadata: { operationId: 'op-server' } })).toBeNull();
- });
-
it('is absent when no operation id is resolvable', () => {
expect(build()).toBeNull();
});
diff --git a/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.ts b/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.ts
index a81d24e1511..28771eb5394 100644
--- a/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.ts
+++ b/src/features/Conversation/Messages/components/MessageActionBar/actions/copyOperationId.ts
@@ -5,16 +5,13 @@ import { useTranslation } from 'react-i18next';
import { useChatStore } from '@/store/chat';
import { operationSelectors } from '@/store/chat/selectors';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
import { defineAction } from '../defineAction';
/**
- * Dev-tool action (visible only with Advanced Tools enabled): copies the id of
- * the operation that produced this message, for tracing/debugging. It is gated
- * here as well as on the Advanced drawer, because it also appears flat in the
- * error, Task and AssistantGroup menus, which the drawer's gate does not reach.
+ * Copies the id of the operation that produced this message, for tracing and
+ * bug reports. Normal menus keep it under Advanced; error menus list it flat,
+ * since a failed run is exactly what someone reports.
*
* Resolution order: the creation-provenance stamp persisted on the
* block/message (`metadata.operationId`, survives reloads) → the live runtime
@@ -28,8 +25,6 @@ export const copyOperationIdAction = defineAction({
key: 'copyOperationId',
useBuild: (ctx) => {
const { t } = useTranslation('chat');
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
-
// For group messages the operation is associated with the underlying
// assistant message (the content block), not the aggregate group id.
const runtimeOperationId = useChatStore((s) => {
@@ -50,7 +45,7 @@ export const copyOperationIdAction = defineAction({
const operationId = durableOperationId ?? runtimeOperationId;
return useMemo(() => {
- if (!isDevMode || !operationId) return null;
+ if (!operationId) return null;
return {
handleClick: async () => {
await copyToClipboard(operationId);
@@ -60,6 +55,6 @@ export const copyOperationIdAction = defineAction({
key: 'copyOperationId',
label: t('messageAction.copyOperationId'),
};
- }, [t, isDevMode, operationId]);
+ }, [t, operationId]);
},
});
diff --git a/src/features/Conversation/hooks/useChatItemContextMenu.tsx b/src/features/Conversation/hooks/useChatItemContextMenu.tsx
index 66883fb65e2..60ac7795939 100644
--- a/src/features/Conversation/hooks/useChatItemContextMenu.tsx
+++ b/src/features/Conversation/hooks/useChatItemContextMenu.tsx
@@ -18,8 +18,6 @@ import type { NativeContextMenuItem } from '@/libs/contextMenu/types';
import { useChatStore } from '@/store/chat';
import { useSessionStore } from '@/store/session';
import { sessionSelectors } from '@/store/session/selectors';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
import { openShareMessageModal } from '../components/ShareMessageModal';
import {
@@ -82,7 +80,6 @@ export const useChatItemContextMenu = ({
const isThreadMode = useConversationStore(messageStateSelectors.isThreadMode);
const isGroupSession = useSessionStore(sessionSelectors.isCurrentSessionGroupSession);
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const actionsBar = useChatListActionsBar({ hasThread, isRegenerating });
const inThread = isThreadMode || inPortalThread;
@@ -163,10 +160,7 @@ export const useChatItemContextMenu = ({
const collapseAction = isCollapsed ? expand : collapse;
const list: MenuItem[] = [edit, copy, collapseAction];
- // Forking a message into a standalone topic is GA; the in-topic thread
- // creator (`branching`) is still gated behind dev mode.
- if (!inThread && !isGroupSession) list.push(fork);
- if (!inThread && !isGroupSession && isDevMode) list.push(branching);
+ if (!inThread && !isGroupSession) list.push(fork, branching);
list.push(divider, translate, divider, share, divider, regenerate, delAndRegenerate, del);
@@ -198,7 +192,7 @@ export const useChatItemContextMenu = ({
if (role === 'user') {
const list: MenuItem[] = [edit, copy];
- if (!inThread && isDevMode) list.push(branching);
+ if (!inThread) list.push(branching);
list.push(divider, translate, divider, regenerate, del);
@@ -206,17 +200,7 @@ export const useChatItemContextMenu = ({
}
return [];
- }, [
- actionsBar,
- canCreate,
- canEdit,
- error,
- inThread,
- isCollapsed,
- isDevMode,
- isGroupSession,
- role,
- ]);
+ }, [actionsBar, canCreate, canEdit, error, inThread, isCollapsed, isGroupSession, role]);
const handleShare = useCallback(() => {
const item = getMessage();
diff --git a/src/features/Electron/updater/UpdateNotification.tsx b/src/features/Electron/updater/UpdateNotification.tsx
index b630ac44fdf..ad1269f3a16 100644
--- a/src/features/Electron/updater/UpdateNotification.tsx
+++ b/src/features/Electron/updater/UpdateNotification.tsx
@@ -18,8 +18,6 @@ import { useTranslation } from 'react-i18next';
import { autoUpdateService } from '@/services/electron/autoUpdate';
import { rendererOtaService } from '@/services/electron/rendererOta';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/selectors';
import { densityVars } from '@/styles/densityVars';
import { applyCoreUpdate } from './applyCoreUpdate';
@@ -196,7 +194,6 @@ export const UpdateNotification: React.FC = () => {
setIsInstalling(false);
toast.info(tElectron('updater.rendererUpdateDeferred'));
});
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
useWatchBroadcast('updateReady', (info) => {
receivedUpdateEvent.current = true;
@@ -244,7 +241,7 @@ export const UpdateNotification: React.FC = () => {
<div className={styles.installLaterToast}>
<span>
{tElectron('updater.updateReady')}
- {isDevMode ? ` · ${formatCoreVersion(updateInfo.version)}` : ''}
+ {` · ${formatCoreVersion(updateInfo.version)}`}
</span>
<BaseButton size={'small'} type={'text'} onClick={() => setUpdateInfo(null)}>
{tElectron('updater.later')}
@@ -294,7 +291,7 @@ export const UpdateNotification: React.FC = () => {
<div className={styles.installLaterToast}>
<span style={{ cursor: 'pointer' }} onClick={() => openUpdateDetailModal(updateInfo)}>
{tElectron('updater.updateReady')}
- {isDevMode && updateInfo?.version ? ` · ${updateInfo.version}` : ''}
+ {updateInfo?.version ? ` · ${updateInfo.version}` : ''}
</span>
<BaseButton size={'small'} type={'text'} onClick={() => autoUpdateService.installLater()}>
{tElectron('updater.later')}
diff --git a/src/features/HomeSidebar/Footer/index.test.tsx b/src/features/HomeSidebar/Footer/index.test.tsx
index e19c12b5e30..e851a799556 100644
--- a/src/features/HomeSidebar/Footer/index.test.tsx
+++ b/src/features/HomeSidebar/Footer/index.test.tsx
@@ -59,7 +59,7 @@ const renderFooter = async ({
mockUserState = {
defaultSettings: {},
preference: { lab: { enableTopicBugReport: bugReportLab } },
- settings: { general: { isDevMode: false } },
+ settings: { general: {} },
};
vi.doMock('@lobechat/const', async (importOriginal) => {
@@ -174,6 +174,25 @@ afterEach(() => {
vi.doUnmock('@/store/user');
});
+describe('Footer settings entry', () => {
+ // Settings is a frequent destination, so the compact footer gives it its own
+ // icon instead of burying it in the Help menu.
+ it('shows Settings as its own icon, not inside the Help menu', async () => {
+ const user = userEvent.setup();
+ await renderFooter({ hideGitHub: false });
+
+ expect(screen.getByRole('button', { name: 'Settings' }).closest('a')).toHaveAttribute(
+ 'href',
+ '/settings',
+ );
+
+ await user.click(screen.getByRole('button', { name: 'Help' }));
+ const menu = (await screen.findByText('Docs')).closest('[role="menu"]')!;
+
+ expect(menu.textContent).not.toContain('Settings');
+ }, 20000);
+});
+
describe('Footer help menu tracking', () => {
it('shows Get App before GitHub on web', async () => {
const user = userEvent.setup();
@@ -289,8 +308,6 @@ describe('Footer help menu tracking', () => {
);
expect(sequence).toEqual([
- 'Settings',
- '|',
'Invite a friend',
'|',
'Docs',
diff --git a/src/features/HomeSidebar/Footer/index.tsx b/src/features/HomeSidebar/Footer/index.tsx
index a527f6df833..c90134af80d 100644
--- a/src/features/HomeSidebar/Footer/index.tsx
+++ b/src/features/HomeSidebar/Footer/index.tsx
@@ -33,7 +33,6 @@ import { useAnalytics } from '@/libs/analytics/client';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useUserStore } from '@/store/user';
import { labPreferSelectors } from '@/store/user/slices/preference/selectors/labPrefer';
-import { userGeneralSettingsSelectors } from '@/store/user/slices/settings/selectors/general';
type FooterMenuItems = NonNullable<DropdownItem[]>;
@@ -86,7 +85,6 @@ const Footer = memo(() => {
const isHomeSidebar = activeNavKey === 'home';
const billboardMenuItems = useBillboardMenuItems();
const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const enableBugReport = useUserStore(labPreferSelectors.enableTopicBugReport);
const bugReportItem = useHelpMenuBugReportItem();
@@ -116,8 +114,10 @@ const Footer = memo(() => {
helpMenuItems: DropdownItem[];
trackedMenuKeys: string[];
}>(() => {
+ // The compact footer gives Settings its own icon beside Help; only the
+ // expanded footer, which has no such icon, lists it in the menu.
const settingsGroup: FooterMenuItems =
- footer.showSettingsEntry && !isDevMode
+ footer.showSettingsEntry && footer.layout === 'expanded'
? [
{
icon: <Icon icon={Settings2} />,
@@ -241,7 +241,6 @@ const Footer = memo(() => {
bugReportItem,
handleOpenChangelogModal,
handleOpenFeedbackModal,
- isDevMode,
t,
settingLabelKey,
billboardMenuItems,
@@ -304,7 +303,7 @@ const Footer = memo(() => {
size={FOOTER_ICON_SIZE}
/>
</DropdownMenu>
- {isDevMode && (
+ {footer.showSettingsEntry && (
<WorkspaceLink to="/settings">
<ActionIcon
aria-label={t(settingLabelKey)}
diff --git a/src/features/ModelSwitchPanel/components/PanelContent.tsx b/src/features/ModelSwitchPanel/components/PanelContent.tsx
index 10ac7802691..9fd15e7526f 100644
--- a/src/features/ModelSwitchPanel/components/PanelContent.tsx
+++ b/src/features/ModelSwitchPanel/components/PanelContent.tsx
@@ -5,11 +5,9 @@ import { Rnd } from 'react-rnd';
import { useBusinessModelPricingPrefetch } from '@/business/client/hooks/useBusinessModelPricing';
import { useEnabledChatModels } from '@/hooks/useEnabledChatModels';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/slices/settings/selectors/general';
import type { EnabledProviderWithModels } from '@/types/aiProvider';
-import { DEFAULT_WIDTH, ENABLE_RESIZING, MAX_WIDTH } from '../const';
+import { ENABLE_RESIZING, MAX_WIDTH } from '../const';
import { usePanelSize } from '../hooks/usePanelSize';
import { usePanelState } from '../hooks/usePanelState';
import { usePanelWidthConstraints } from '../hooks/usePanelWidthConstraints';
@@ -44,7 +42,6 @@ export const PanelContent: FC<PanelContentProps> = ({
const chatEnabledList = useEnabledChatModels();
const enabledList = enabledListProp ?? chatEnabledList;
const [searchKeyword, setSearchKeyword] = useState('');
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const { groupMode, handleGroupModeChange } = usePanelState();
const { panelHeight, panelWidth, handlePanelWidthChange } = usePanelSize(enabledList.length);
const {
@@ -85,69 +82,47 @@ export const PanelContent: FC<PanelContentProps> = ({
</>
);
- if (isDevMode) {
- return (
- <>
- <div
- aria-hidden
- ref={probeRef}
- style={{
- pointerEvents: 'none',
- position: 'absolute',
- visibility: 'hidden',
- width: `min(${MAX_WIDTH}px, var(--available-width, ${MAX_WIDTH}px))`,
- }}
- />
- <Rnd
- disableDragging
- enableResizing={ENABLE_RESIZING}
- // Rnd needs a numeric `size.height`, but a fixed height overflows the top
- // edge when the upward-opening popup meets a short viewport. Pass the
- // clamp through Rnd's own `maxHeight` (a `style.maxHeight` gets overridden
- // by Rnd's internal default) so CSS caps the box to the space base-ui
- // exposes via `--available-height`; the inner list then flex-shrinks and
- // scrolls. Height resize is disabled, so this doesn't fight drag logic.
- maxHeight={`min(${panelHeight}px, var(--available-height, ${panelHeight}px))`}
- // re-resizable cannot parse CSS min() while dragging. Measure Base UI's
- // collision-aware width with the hidden probe and pass numeric bounds so
- // resize remains usable when a foldable or split window narrows the popup.
- maxWidth={constrainedMaxWidth}
- minWidth={constrainedMinWidth}
- position={{ x: 0, y: 0 }}
- size={{ height: panelHeight, width: constrainedWidth }}
- style={{
- display: 'flex',
- flexDirection: 'column',
- minHeight: 0,
- position: 'relative',
- }}
- onResizeStop={(_e, _direction, ref) => {
- handlePanelWidthChange(ref.offsetWidth);
- }}
- >
- {content}
- </Rnd>
- </>
- );
- }
-
return (
- <Flexbox
- style={{
- display: 'flex',
- flexDirection: 'column',
- // Clamp the panel to the viewport space base-ui exposes via
- // `--available-height` (falling back to the natural height before it's
- // measured). The trigger usually sits at the page bottom and the popup
- // opens upward; a fixed height would overflow the top edge and clip the
- // search box + first items on short viewports. Keeping a *concrete*
- // height (not max-height) lets the inner list flex-shrink and scroll.
- height: `min(${panelHeight}px, var(--available-height, ${panelHeight}px))`,
- position: 'relative',
- width: `min(${DEFAULT_WIDTH}px, var(--available-width, ${DEFAULT_WIDTH}px))`,
- }}
- >
- {content}
- </Flexbox>
+ <>
+ <div
+ aria-hidden
+ ref={probeRef}
+ style={{
+ pointerEvents: 'none',
+ position: 'absolute',
+ visibility: 'hidden',
+ width: `min(${MAX_WIDTH}px, var(--available-width, ${MAX_WIDTH}px))`,
+ }}
+ />
+ <Rnd
+ disableDragging
+ enableResizing={ENABLE_RESIZING}
+ // Rnd needs a numeric `size.height`, but a fixed height overflows the top
+ // edge when the upward-opening popup meets a short viewport. Pass the
+ // clamp through Rnd's own `maxHeight` (a `style.maxHeight` gets overridden
+ // by Rnd's internal default) so CSS caps the box to the space base-ui
+ // exposes via `--available-height`; the inner list then flex-shrinks and
+ // scrolls. Height resize is disabled, so this doesn't fight drag logic.
+ maxHeight={`min(${panelHeight}px, var(--available-height, ${panelHeight}px))`}
+ // re-resizable cannot parse CSS min() while dragging. Measure Base UI's
+ // collision-aware width with the hidden probe and pass numeric bounds so
+ // resize remains usable when a foldable or split window narrows the popup.
+ maxWidth={constrainedMaxWidth}
+ minWidth={constrainedMinWidth}
+ position={{ x: 0, y: 0 }}
+ size={{ height: panelHeight, width: constrainedWidth }}
+ style={{
+ display: 'flex',
+ flexDirection: 'column',
+ minHeight: 0,
+ position: 'relative',
+ }}
+ onResizeStop={(_e, _direction, ref) => {
+ handlePanelWidthChange(ref.offsetWidth);
+ }}
+ >
+ {content}
+ </Rnd>
+ </>
);
};
diff --git a/src/features/Settings/about/features/About.tsx b/src/features/Settings/about/features/About.tsx
index ce42a566ddf..642aa989890 100644
--- a/src/features/Settings/about/features/About.tsx
+++ b/src/features/Settings/about/features/About.tsx
@@ -6,6 +6,7 @@ import SiRss from '@icons-pack/react-simple-icons/icons/SiRss';
import SiX from '@icons-pack/react-simple-icons/icons/SiX';
import SiYoutube from '@icons-pack/react-simple-icons/icons/SiYoutube';
import { BRANDING_EMAIL, BRANDING_NAME, SOCIAL_URL } from '@lobechat/business-const';
+import { isDesktop } from '@lobechat/const';
import { Divider, Flexbox } from '@lobehub/ui';
import { Form } from '@lobehub/ui/form';
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
@@ -19,6 +20,7 @@ import { densityTokens } from '@/styles/density.stylex';
import AboutList from './AboutList';
import ItemCard from './ItemCard';
import ItemLink from './ItemLink';
+import UpdateChannel from './UpdateChannel';
import Version from './Version';
const styles = stylex.create({
@@ -41,6 +43,7 @@ const About = memo<{ mobile?: boolean }>(({ mobile }) => {
>
<Flexbox gap={20} paddingBlock={20} width={'100%'}>
<Version mobile={mobile} />
+ {isDesktop && <UpdateChannel mobile={mobile} />}
<Divider style={{ marginBlock: 0 }} />
<AboutList
grid
diff --git a/src/features/Settings/about/features/UpdateChannel.tsx b/src/features/Settings/about/features/UpdateChannel.tsx
new file mode 100644
index 00000000000..6e95899b460
--- /dev/null
+++ b/src/features/Settings/about/features/UpdateChannel.tsx
@@ -0,0 +1,64 @@
+'use client';
+
+import { Flexbox, Select, Text } from '@lobehub/ui';
+import { memo, useCallback, useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';
+import { autoUpdateService } from '@/services/electron/autoUpdate';
+
+type UpdateChannelValue = 'canary' | 'stable';
+
+/**
+ * Which releases the desktop app updates to. It sits under the version row in
+ * About so the version, the update action and where updates come from read as
+ * one place. Desktop only — the web app has no updater.
+ */
+const UpdateChannel = memo<{ mobile?: boolean }>(({ mobile }) => {
+ const { t } = useTranslation('setting');
+ const [channel, setChannel] = useState<UpdateChannelValue>('stable');
+
+ useEffect(() => {
+ autoUpdateService
+ .getUpdateChannel()
+ .then(setChannel)
+ .catch(() => {});
+ }, []);
+
+ const handleChange = useCallback((value: UpdateChannelValue) => {
+ setChannel(value);
+ autoUpdateService.setUpdateChannel(value);
+ }, []);
+
+ return (
+ <Flexbox
+ align={mobile ? 'stretch' : 'center'}
+ gap={mobile ? 8 : 16}
+ horizontal={!mobile}
+ justify={'space-between'}
+ width={'100%'}
+ >
+ <Flexbox gap={4}>
+ <SettingsSearchAnchor id={'about-update-channel'}>
+ <Text weight={500}>{t('tab.advanced.updateChannel.title')}</Text>
+ </SettingsSearchAnchor>
+ <Text fontSize={12} type={'secondary'}>
+ {t('tab.advanced.updateChannel.desc')}
+ </Text>
+ </Flexbox>
+ <Select
+ style={{ flex: 'none', width: mobile ? '100%' : 200 }}
+ value={channel}
+ options={[
+ { label: t('tab.advanced.updateChannel.stable'), value: 'stable' },
+ { label: t('tab.advanced.updateChannel.canary'), value: 'canary' },
+ ]}
+ onChange={handleChange}
+ />
+ </Flexbox>
+ );
+});
+
+UpdateChannel.displayName = 'UpdateChannel';
+
+export default UpdateChannel;
diff --git a/src/features/Settings/advanced/index.tsx b/src/features/Settings/advanced/index.tsx
index feae11a3d37..e5814499f55 100644
--- a/src/features/Settings/advanced/index.tsx
+++ b/src/features/Settings/advanced/index.tsx
@@ -1,10 +1,9 @@
'use client';
-import { isDesktop } from '@lobechat/const';
-import { Select, Spin, Switch } from '@lobehub/ui';
+import { Spin, Switch } from '@lobehub/ui';
import { Form, type FormFieldProps, type FormGroupItem, useForm } from '@lobehub/ui/form';
import isEqual from 'fast-deep-equal';
-import { memo, useCallback, useEffect, useState } from 'react';
+import { memo, useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
import AsyncError from '@/components/AsyncError';
@@ -12,7 +11,6 @@ import AdvancedSkeleton from '@/components/Skeleton/Settings/tabs/Advanced';
import { FORM_STYLE } from '@/const/layoutTokens';
import SettingHeader from '@/features/Settings/features/SettingHeader';
import { SettingsSearchAnchor } from '@/features/SettingsSearch/anchor';
-import { autoUpdateService } from '@/services/electron/autoUpdate';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useUserStore } from '@/store/user';
import { settingsSelectors } from '@/store/user/selectors';
@@ -21,8 +19,6 @@ import { type UserGeneralConfig } from '@/types/user/settings';
import { useDiagnosticsItems } from './useDiagnosticsItems';
import { useRemoteDebuggingItem } from './useRemoteDebuggingItem';
-type UpdateChannelValue = 'canary' | 'stable';
-
const Page = memo<{ showSettingHeader?: boolean }>(({ showSettingHeader = true }) => {
const { t } = useTranslation('setting');
@@ -53,21 +49,6 @@ const Page = memo<{ showSettingHeader?: boolean }>(({ showSettingHeader = true }
const diagnosticsItems = useDiagnosticsItems<UserGeneralConfig>();
const remoteDebuggingItem = useRemoteDebuggingItem<UserGeneralConfig>();
- const [channel, setChannel] = useState<UpdateChannelValue>('stable');
-
- useEffect(() => {
- if (!isDesktop) return;
- autoUpdateService
- .getUpdateChannel()
- .then(setChannel)
- .catch(() => {});
- }, []);
-
- const handleChannelChange = useCallback((value: UpdateChannelValue) => {
- setChannel(value);
- autoUpdateService.setUpdateChannel(value);
- }, []);
-
const handleGatewayModeChange = useCallback(
(checked: boolean) => {
updateDefaultAgent({
@@ -99,17 +80,6 @@ const Page = memo<{ showSettingHeader?: boolean }>(({ showSettingHeader = true }
const advancedGroup: FormGroupItem<UserGeneralConfig> = {
children: [
- {
- children: <Switch />,
- desc: t('settingCommon.devMode.desc'),
- label: (
- <SettingsSearchAnchor id={'advanced-dev-mode'}>
- {t('settingCommon.devMode.title')}
- </SettingsSearchAnchor>
- ),
- minWidth: undefined,
- name: 'isDevMode',
- },
...(enableGatewayMode
? [
{
@@ -136,29 +106,8 @@ const Page = memo<{ showSettingHeader?: boolean }>(({ showSettingHeader = true }
title: t('tab.advanced.toolsAndDiagnostics.title'),
};
- const channelOptions = [
- { label: t('tab.advanced.updateChannel.stable'), value: 'stable' as const },
- { label: t('tab.advanced.updateChannel.canary'), value: 'canary' as const },
- ];
-
- const updateChannelGroup: FormGroupItem<UserGeneralConfig> = {
- children: [
- {
- children: (
- <Select options={channelOptions} value={channel} onChange={handleChannelChange} />
- ),
- desc: t('tab.advanced.updateChannel.desc'),
- label: (
- <SettingsSearchAnchor id={'advanced-update-channel'}>
- {t('tab.advanced.updateChannel.title')}
- </SettingsSearchAnchor>
- ),
- },
- ],
- title: t('tab.advanced.appUpdates.title'),
- };
-
- const items = isDesktop ? [advancedGroup, updateChannelGroup] : [advancedGroup];
+ // The update channel lives in About, beside the version and update action.
+ const items = (advancedGroup.children as unknown[]).length > 0 ? [advancedGroup] : [];
return (
<>
diff --git a/src/features/Settings/advanced/settingsCopy.test.ts b/src/features/Settings/advanced/settingsCopy.test.ts
index 7188b767f73..3318a71cbe6 100644
--- a/src/features/Settings/advanced/settingsCopy.test.ts
+++ b/src/features/Settings/advanced/settingsCopy.test.ts
@@ -3,16 +3,8 @@ import { describe, expect, it } from 'vitest';
import setting from '@/locales/default/setting';
describe('settings copy', () => {
- it('describes Advanced tools without repeating Developer Mode wording', () => {
- expect(setting['settingCommon.devMode.title']).toBe('Advanced tools');
- expect(setting['settingCommon.devMode.desc']).toBe(
- 'Show technical details and manual controls for chats, models, and local tools. This does not change model responses.',
- );
- });
-
it('uses non-repeating Advanced page group titles', () => {
expect(setting['tab.advanced.toolsAndDiagnostics.title']).toBe('Tools and diagnostics');
- expect(setting['tab.advanced.appUpdates.title']).toBe('App updates');
expect(setting['tab.advanced.updateChannel.title']).toBe('Update channel');
});
});
diff --git a/src/features/Settings/conversation/features/Display.tsx b/src/features/Settings/conversation/features/Display.tsx
index c26713440f9..b6d06bb331e 100644
--- a/src/features/Settings/conversation/features/Display.tsx
+++ b/src/features/Settings/conversation/features/Display.tsx
@@ -16,13 +16,14 @@ import { settingsSelectors, userGeneralSettingsSelectors } from '@/store/user/se
import { FontSizeControl } from './FontSize';
import LinkIconPreview from './LinkIconPreview';
-/** How messages render: text size and link icons. */
+/** How messages render: text size, link icons and the per-reply usage row. */
const Display = memo(() => {
const { t } = useTranslation('setting');
const fontSize = useUserStore(userGeneralSettingsSelectors.fontSize);
const enableMessageLinkIcon = useUserStore(
(s) => settingsSelectors.currentSettings(s).general.enableMessageLinkIcon ?? true,
);
+ const showMessageUsage = useUserStore(userGeneralSettingsSelectors.showMessageUsage);
const [setSettings, isUserStateInit] = useUserStore((s) => [s.setSettings, s.isUserStateInit]);
const { status: saveStatus, lastSavedAt, save, retry } = useSaveState();
const form = useForm();
@@ -64,6 +65,23 @@ const Display = memo(() => {
),
minWidth: undefined,
},
+ {
+ children: (
+ <Switch
+ checked={showMessageUsage}
+ onChange={(checked) =>
+ save(() => setSettings({ general: { showMessageUsage: checked } }))
+ }
+ />
+ ),
+ desc: t('settingChatAppearance.showMessageUsage.desc'),
+ label: (
+ <SettingsSearchAnchor id={'conversation-message-usage'}>
+ {t('settingChatAppearance.showMessageUsage.title')}
+ </SettingsSearchAnchor>
+ ),
+ minWidth: undefined,
+ },
],
extra: <AutoSaveHint lastUpdatedTime={lastSavedAt} saveStatus={saveStatus} onRetry={retry} />,
title: t('settingConversation.display.title'),
diff --git a/src/features/Settings/hooks/useCategory.test.tsx b/src/features/Settings/hooks/useCategory.test.tsx
index c6529f3e114..af4076633cc 100644
--- a/src/features/Settings/hooks/useCategory.test.tsx
+++ b/src/features/Settings/hooks/useCategory.test.tsx
@@ -115,20 +115,13 @@ describe('settings useCategory', () => {
expect(keys).not.toContain(SettingsTabs.Provider);
});
- it('lists API Key once when both of its flags are on', () => {
- useUserStore.setState({
- preference: {
- ...initialUserStoreState.preference,
- general: { ...initialUserStoreState.preference.general, isDevMode: true },
- },
- });
-
- const { result } = renderHook(() => useCategory(), {
+ const renderWithApiKeyFlag = (showApiKeyManage: boolean) =>
+ renderHook(() => useCategory(), {
wrapper: ({ children }: { children: ReactNode }) => (
<Provider
createStore={() =>
initServerConfigStore({
- featureFlags: { ...mapFeatureFlagsEnvToState({}), showApiKeyManage: true },
+ featureFlags: { ...mapFeatureFlagsEnvToState({}), showApiKeyManage },
serverConfig: { aiProvider: {}, telemetry: {} },
})
}
@@ -136,10 +129,42 @@ describe('settings useCategory', () => {
{children}
</Provider>
),
- });
- const keys = result.current.flatMap((group) => group.items.map((item) => item.key));
+ }).result.current.flatMap((group) => group.items.map((item) => item.key));
+
+ it('lists API Key once when the deployment enables it', () => {
+ expect(renderWithApiKeyFlag(true).filter((key) => key === SettingsTabs.APIKey)).toHaveLength(1);
+ });
+
+ // The retired Advanced Tools switch used to reveal API Key past the
+ // deployment flag; a value still stored for it must not.
+ it('hides API Key when the deployment disables it, even with the retired switch stored', () => {
+ useUserStore.setState({
+ settings: { general: { isDevMode: true } },
+ } as unknown as Parameters<typeof useUserStore.setState>[0]);
+
+ expect(renderWithApiKeyFlag(false)).not.toContain(SettingsTabs.APIKey);
+ });
- expect(keys.filter((key) => key === SettingsTabs.APIKey)).toHaveLength(1);
+ // With Advanced Tools gone, gateway mode is all Advanced holds on the web.
+ it('lists Advanced on the web only when gateway mode is available', () => {
+ const keysWithGateway = (enableGatewayMode: boolean) =>
+ renderHook(() => useCategory(), {
+ wrapper: ({ children }: { children: ReactNode }) => (
+ <Provider
+ createStore={() =>
+ initServerConfigStore({
+ featureFlags: mapFeatureFlagsEnvToState({}),
+ serverConfig: { aiProvider: {}, enableGatewayMode, telemetry: {} },
+ })
+ }
+ >
+ {children}
+ </Provider>
+ ),
+ }).result.current.flatMap((group) => group.items.map((item) => item.key));
+
+ expect(keysWithGateway(false)).not.toContain(SettingsTabs.Advanced);
+ expect(keysWithGateway(true)).toContain(SettingsTabs.Advanced);
});
it('shows OAuth Apps when the Labs preference is enabled', () => {
diff --git a/src/features/Settings/hooks/useCategory.tsx b/src/features/Settings/hooks/useCategory.tsx
index f7737d0e613..113b05d7c79 100644
--- a/src/features/Settings/hooks/useCategory.tsx
+++ b/src/features/Settings/hooks/useCategory.tsx
@@ -45,7 +45,6 @@ import {
import { useUserStore } from '@/store/user';
import { labPreferSelectors } from '@/store/user/selectors';
import { userProfileSelectors } from '@/store/user/slices/auth/selectors';
-import { userGeneralSettingsSelectors } from '@/store/user/slices/settings/selectors';
export enum SettingsGroupKey {
Account = 'account',
@@ -82,9 +81,12 @@ export const useCategory = () => {
userProfileSelectors.nickName(s),
]);
const remoteServerUrl = useElectronStore(electronSyncSelectors.remoteServerUrl);
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
const enableOAuthApps = useUserStore(labPreferSelectors.enableOAuthApps);
const enableWebhook = useServerConfigStore(serverConfigSelectors.enableWebhook);
+ // Advanced holds gateway mode and desktop diagnostics; on the web without
+ // gateway mode it would be an empty page.
+ const enableGatewayMode = useServerConfigStore(serverConfigSelectors.enableGatewayMode);
+ const showAdvanced = isDesktop || enableGatewayMode;
const avatarUrl = useMemo(() => {
if (!avatar) return undefined;
@@ -277,12 +279,12 @@ export const useCategory = () => {
key: SettingsTabs.Trash,
label: t('tab.trash'),
},
- {
+ showAdvanced && {
icon: EllipsisIcon,
key: SettingsTabs.Advanced,
label: t('tab.advanced'),
},
- (showApiKeyManage || isDevMode) && {
+ showApiKeyManage && {
icon: KeyIcon,
key: SettingsTabs.APIKey,
label: tAuth('tab.apikey'),
@@ -321,9 +323,9 @@ export const useCategory = () => {
mobile,
showApiKeyManage,
showProvider,
- isDevMode,
enableOAuthApps,
enableWebhook,
+ showAdvanced,
avatarUrl,
username,
]);
diff --git a/src/features/Settings/system-tools/index.tsx b/src/features/Settings/system-tools/index.tsx
index a1244787787..585cf89d283 100644
--- a/src/features/Settings/system-tools/index.tsx
+++ b/src/features/Settings/system-tools/index.tsx
@@ -1,8 +1,6 @@
import { useTranslation } from 'react-i18next';
import SettingHeader from '@/features/Settings/features/SettingHeader';
-import { useUserStore } from '@/store/user';
-import { userGeneralSettingsSelectors } from '@/store/user/slices/settings/selectors';
import AppEnvironmentSection from './features/AppEnvironmentSection';
import CliTestSection from './features/CliTestSection';
@@ -11,15 +9,14 @@ import ToolDetectorSection from './features/ToolDetectorSection';
const Page = ({ showSettingHeader = true }: { showSettingHeader?: boolean }) => {
const { t } = useTranslation('setting');
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
-
return (
<>
{showSettingHeader && <SettingHeader title={t('tab.systemTools')} />}
<ShellSection />
<ToolDetectorSection />
<AppEnvironmentSection />
- {isDevMode ? <CliTestSection /> : null}
+ {/* Internal check of the embedded CLI; untranslated, so dev builds only. */}
+ {__DEV__ ? <CliTestSection /> : null}
</>
);
};
diff --git a/src/features/SettingsSearch/items.ts b/src/features/SettingsSearch/items.ts
index 08da0f6c93b..c8f17efbe94 100644
--- a/src/features/SettingsSearch/items.ts
+++ b/src/features/SettingsSearch/items.ts
@@ -515,6 +515,13 @@ export const SETTINGS_SEARCH_ITEMS: SettingsSearchItem[] = [
labelKey: 'settingChatAppearance.linkIcon.title',
tab: SettingsTabs.Conversation,
},
+ {
+ anchor: 'conversation-message-usage',
+ descKey: 'settingChatAppearance.showMessageUsage.desc',
+ keywords: ['token', 'usage', 'model', 'cost', 'developer', 'advanced tools'],
+ labelKey: 'settingChatAppearance.showMessageUsage.title',
+ tab: SettingsTabs.Conversation,
+ },
{
anchor: 'conversation-transition',
keywords: ['transition', 'animation', 'fade', 'streaming'],
@@ -554,13 +561,6 @@ export const SETTINGS_SEARCH_ITEMS: SettingsSearchItem[] = [
visible: (ctx) => ctx.isDesktop && ctx.isWindows,
},
// Advanced
- {
- anchor: 'advanced-dev-mode',
- descKey: 'settingCommon.devMode.desc',
- keywords: ['developer', 'debug', 'dev mode'],
- labelKey: 'settingCommon.devMode.title',
- tab: SettingsTabs.Advanced,
- },
{
anchor: 'advanced-gateway-mode',
descKey: 'tab.advanced.gatewayMode.desc',
@@ -569,12 +569,13 @@ export const SETTINGS_SEARCH_ITEMS: SettingsSearchItem[] = [
tab: SettingsTabs.Advanced,
visible: (ctx) => ctx.enableGatewayMode,
},
+ // About
{
- anchor: 'advanced-update-channel',
+ anchor: 'about-update-channel',
descKey: 'tab.advanced.updateChannel.desc',
keywords: ['update', 'version', 'canary', 'stable'],
labelKey: 'tab.advanced.updateChannel.title',
- tab: SettingsTabs.Advanced,
+ tab: SettingsTabs.About,
visible: (ctx) => ctx.isDesktop,
},
// Labs — derived from the LAB_FEATURES catalog the page renders, so a new
diff --git a/src/routes/(mobile)/me/settings/features/useCategory.tsx b/src/routes/(mobile)/me/settings/features/useCategory.tsx
index 30e9a85d60e..d15351fa35d 100644
--- a/src/routes/(mobile)/me/settings/features/useCategory.tsx
+++ b/src/routes/(mobile)/me/settings/features/useCategory.tsx
@@ -32,7 +32,6 @@ import {
} from '@/store/serverConfig';
import { useUserStore } from '@/store/user';
import { labPreferSelectors } from '@/store/user/selectors';
-import { userGeneralSettingsSelectors } from '@/store/user/slices/settings/selectors';
export enum SettingsGroupKey {
Agent = 'agent',
@@ -57,7 +56,8 @@ export const useCategory = (): CategoryGroup[] => {
const { t } = useTranslation(['setting', 'auth', 'subscription']);
const { hideDocs, showApiKeyManage, showProvider } = useServerConfigStore(featureFlagsSelectors);
const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
- const isDevMode = useUserStore((s) => userGeneralSettingsSelectors.config(s).isDevMode);
+ // Advanced only holds gateway mode on mobile; without it the page is empty.
+ const enableGatewayMode = useServerConfigStore(serverConfigSelectors.enableGatewayMode);
const enableOAuthApps = useUserStore(labPreferSelectors.enableOAuthApps);
return useMemo(() => {
@@ -122,12 +122,13 @@ export const useCategory = (): CategoryGroup[] => {
const system: CategoryItem[] = [
makeItem({ icon: Database, key: SettingsTabs.Storage, label: t('setting:tab.storage') }),
- makeItem({
- icon: EllipsisIcon,
- key: SettingsTabs.Advanced,
- label: t('setting:tab.advanced'),
- }),
- (showApiKeyManage || isDevMode) &&
+ enableGatewayMode &&
+ makeItem({
+ icon: EllipsisIcon,
+ key: SettingsTabs.Advanced,
+ label: t('setting:tab.advanced'),
+ }),
+ showApiKeyManage &&
makeItem({ icon: KeyIcon, key: SettingsTabs.APIKey, label: t('auth:tab.apikey') }),
enableOAuthApps &&
makeItem({
@@ -155,8 +156,8 @@ export const useCategory = (): CategoryGroup[] => {
hideDocs,
showApiKeyManage,
showProvider,
- isDevMode,
enableOAuthApps,
+ enableGatewayMode,
navigate,
]);
};
diff --git a/src/store/user/slices/settings/selectors/general.test.ts b/src/store/user/slices/settings/selectors/general.test.ts
index 97eb02f7968..70dde8d6f3b 100644
--- a/src/store/user/slices/settings/selectors/general.test.ts
+++ b/src/store/user/slices/settings/selectors/general.test.ts
@@ -22,7 +22,6 @@ describe('settingsSelectors', () => {
fontSize: 12,
highlighterTheme: 'lobe-theme',
interfaceDensity: 'loose',
- isDevMode: false,
isLiteMode: false,
mermaidTheme: 'lobe-theme',
telemetry: true,
@@ -45,6 +44,28 @@ describe('settingsSelectors', () => {
});
});
+ describe('showMessageUsage', () => {
+ it('is off when nothing was chosen', () => {
+ expect(userGeneralSettingsSelectors.showMessageUsage(initialState as UserStore)).toBe(false);
+ });
+
+ it('keeps it on for people who had the retired Advanced Tools switch on', () => {
+ const s = merge(initialState, {
+ settings: { general: { isDevMode: true } },
+ }) as unknown as UserStore;
+
+ expect(userGeneralSettingsSelectors.showMessageUsage(s)).toBe(true);
+ });
+
+ it('lets the explicit choice win over the retired switch', () => {
+ const s = merge(initialState, {
+ settings: { general: { isDevMode: true, showMessageUsage: false } },
+ }) as unknown as UserStore;
+
+ expect(userGeneralSettingsSelectors.showMessageUsage(s)).toBe(false);
+ });
+ });
+
describe('interfaceDensity', () => {
it('defaults to loose when unset', () => {
expect(userGeneralSettingsSelectors.interfaceDensity(initialState as UserStore)).toBe(
diff --git a/src/store/user/slices/settings/selectors/general.ts b/src/store/user/slices/settings/selectors/general.ts
index 62a1da3aa78..1f7283cb354 100644
--- a/src/store/user/slices/settings/selectors/general.ts
+++ b/src/store/user/slices/settings/selectors/general.ts
@@ -40,6 +40,12 @@ const enablePasteAutoConvert = (s: UserStore) =>
generalConfig(s).enablePasteAutoConvert ?? s.preference.lab?.enableInputMarkdown !== false;
const enableVoiceMessage = (s: UserStore) => generalConfig(s).enableVoiceMessage ?? false;
const showImageReadPreview = (s: UserStore) => generalConfig(s).showImageReadPreview ?? true;
+// `isDevMode` (the retired Advanced Tools switch) used to gate the usage row,
+// so it seeds the default for people who never chose this setting.
+const showMessageUsage = (s: UserStore) =>
+ generalConfig(s).showMessageUsage ??
+ (generalConfig(s) as { isDevMode?: boolean }).isDevMode ??
+ false;
const fontAntialiasing = (s: UserStore) => generalConfig(s).fontAntialiasing ?? true;
const interfaceDensity = (s: UserStore): InterfaceDensity =>
generalConfig(s).interfaceDensity ?? 'loose';
@@ -78,6 +84,7 @@ export const userGeneralSettingsSelectors = {
currentTimezone,
responseLanguage,
showImageReadPreview,
+ showMessageUsage,
telemetry,
timezone,
transitionMode,